Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REFACTOR fetch schema at start of session #167

Conversation

leszekhanusz
Copy link
Collaborator

Until now, the schema was fetched using an introspection query:

  • in the __init__ of the client for sync transports
  • just before the first execute for the async transports

With this PR, both cases are modified so that the introspection query is executed just after the establishment of the first session.

This is a breaking changes for users using the RequestsHTTPTransport but only if they needed to use the schema before doing any query.

@KingDarBoja
Copy link
Contributor

Does this change improves overall performance? Seems like it does as now the schema will be fetched if needed and not everytime a request is made 🤔

@leszekhanusz
Copy link
Collaborator Author

It does improve performance (especially if we are using https) for the RequestsHTTPTransport as it will now use the same session for fetching the schema and for the first query.
For the async transports, it is basically the same.
But overall I think it is better to have the same logic for sync and async transports as it is more coherent.

@KingDarBoja KingDarBoja added the type: optimization A code change that improves performance label Nov 7, 2020
@leszekhanusz leszekhanusz merged commit 6254ab9 into graphql-python:master Nov 8, 2020
@leszekhanusz leszekhanusz deleted the refactor_fetch_schema_at_start_of_session branch November 8, 2020 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: optimization A code change that improves performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants