Code Monkey home page Code Monkey logo

python-qlient-core's People

Contributors

deepsourcebot avatar dfseifert avatar qlient-org avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

python-qlient-core's Issues

Speed up requests by caching schema?

Looking over the code I see there is a way to load schema from a file. Would it make sense to have a cache mechanism? When using the qlient with smaller schema, the delay isn't noticeable but using it with api.github.com/graphql it adds ~5 seconds to each request.

For example:

2022-10-11 16:31:19,800 DEBUG:Loading remote schema using `<qlient.http.backends.HTTPBackend object at 0x7facd59b2ca0>`
2022-10-11 16:31:19,800 DEBUG:Sending request: ...snipped_introspection_for_brevity...
2022-10-11 16:31:19,802 DEBUG:Starting new HTTPS connection (1): api.github.com:443
2022-10-11 16:31:25,098 DEBUG:https://api.github.com:443 "POST /graphql HTTP/1.1" 200 None
2022-10-11 16:31:25,304 DEBUG:Schema successfully introspected
2022-10-11 16:31:25,304 DEBUG:Sending request: {"query": "query viewer { viewer { login } }", "operationName": "viewer", "variables": {}}
2022-10-11 16:31:25,398 DEBUG:https://api.github.com:443 "POST /graphql HTTP/1.1" 200 None
2022-10-11 16:31:25,399 INFO: Query: query viewer { viewer { login } }
2022-10-11 16:31:25,399 INFO: Data: {'viewer': {'login': 'eisenhowerj'}}
2022-10-11 16:31:25,399 DEBUG:done

versus:

2022-10-11 16:35:51,867 DEBUG:Loading remote schema using `<qlient.http.backends.HTTPBackend object at 0x7f6b51b6ebb0>`
2022-10-11 16:35:51,867 DEBUG:Sending request: ...snipped_introspection_for_brevity...
2022-10-11 16:35:51,869 DEBUG:Starting new HTTPS connection (1): swapi-graphql.netlify.app:443
2022-10-11 16:35:52,046 DEBUG:https://swapi-graphql.netlify.app:443 "POST /.netlify/functions/index HTTP/1.1" 200 None
2022-10-11 16:35:52,057 DEBUG:Schema successfully introspected
2022-10-11 16:35:52,058 DEBUG:Sending request: {"query": "query film($id: ID) { film(id: $id) { id title episodeID } }", "operationName": "film", "variables": {"id": "ZmlsbXM6MQ=="}}
2022-10-11 16:35:52,121 DEBUG:https://swapi-graphql.netlify.app:443 "POST /.netlify/functions/index HTTP/1.1" 200 74
2022-10-11 16:35:52,123 INFO: Query: query film($id: ID) { film(id: $id) { id title episodeID } }
2022-10-11 16:35:52,123 INFO:{'id': 'ZmlsbXM6MQ=='}
2022-10-11 16:35:52,123 INFO: Data: {'film': {'id': 'ZmlsbXM6MQ==', 'title': 'A New Hope', 'episodeID': 4}}
2022-10-11 16:35:52,123 DEBUG:done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.