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
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:
versus: