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

Parsing and validation of queries is doubled up in graphene_django + graphql_sync #1198

Closed
bobbyrenwick opened this issue May 4, 2021 · 0 comments
Labels

Comments

@bobbyrenwick
Copy link

The parsing and validation of graphql queries is doubled up!

Using the following versions:

graphql-core==3.1.4
graphene==3.0.0b7
graphene-django==3.0.0b7 
  1. graphene_django.views.GraphQLView. execute_graphql_request parses and validates the query but then passes the string version of the query to `graphene
  2. graphene.Schema.execute calls graphql.graphql_sync
  3. graphql.graphql_sync calls grapqhl.graphql.graphql_impl
  4. graphql.graphql.graphql_impl calls parse and validate again.

My knowledge of these libraries is pretty minimal but I noticed this as our largest queries can take ~300ms or so of parsing + validating, and even after introducing a cache inside a subclass of graphene_django.views.GraphQLView I was still getting a delay on execution.

I would make a pull request, but I think the approach probably requires a discussion first!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants