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

Support for DjangoConnectionField #45

Open
levinotik opened this issue Apr 20, 2020 · 1 comment
Open

Support for DjangoConnectionField #45

levinotik opened this issue Apr 20, 2020 · 1 comment

Comments

@levinotik
Copy link

levinotik commented Apr 20, 2020

I have a query and resolver using DjangoConnectionField as follows

  items = DjangoConnectionField(ItemType)

  def resolve_items(root, info, **kwargs):
       return gql_optimizer.query(Item.objects.all(), info)

The SQL not optimized, as I can see all fields are queried when inspecting the raw sql output via GraphQL.

@gghildyal
Copy link

I have seen this as well, but only when accessing the 'id' field in the query. If you remove the id, the sql query only the requested fields as expected.

I think this is to do something with the DjangoConnectionField encoding/decoding the id field which conflicts with the query optimization.

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

No branches or pull requests

2 participants