Skip to content

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

Closed
@bobbyrenwick

Description

@bobbyrenwick

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions