You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If two different resolvers of a DjangoObjectType have hints with the same value in to_attr of Prefetch, then Django will raise an exception ("Lookup was already seen with a different queryset" from django.db.models.query.prefetch_related_objects).
What we would like instead is that graphene-django-optimizer lets us add those two hints but makes sure that, if both resolvers are needed in a query, it only adds the "common hint" once (therefore not leading to a duplicate prefetch that will raise an error).
The benefit of this is that we would be able to add duplicate hints where we want, to make sure the hints are triggered even when one of the fields is queried and not the other, while also allowing for both fields being queried together without duplicate prefetches nor exceptions being risen.
If two different resolvers of a DjangoObjectType have hints with the same value in to_attr of Prefetch, then Django will raise an exception ("Lookup was already seen with a different queryset" from django.db.models.query.prefetch_related_objects).
What we would like instead is that graphene-django-optimizer lets us add those two hints but makes sure that, if both resolvers are needed in a query, it only adds the "common hint" once (therefore not leading to a duplicate prefetch that will raise an error).
The benefit of this is that we would be able to add duplicate hints where we want, to make sure the hints are triggered even when one of the fields is queried and not the other, while also allowing for both fields being queried together without duplicate prefetches nor exceptions being risen.
This PR solves the problem #76
The text was updated successfully, but these errors were encountered: