graphene-django-extras icon indicating copy to clipboard operation
graphene-django-extras copied to clipboard

Getting duplicate results on a filter across multiple fields. Cannot add distinct.

Open paulsermon-gemfair opened this issue 2 years ago • 0 comments

As stated, I am adding a filter field that crosses 3 foreign keys. eg Filtering a TrainingSession object on attendees__user__roles__office

When I filter with this method I get duplicate results in my GQL response. Usually as many duplicates as there are attendees. The obvious fix for this in Django is to add .distinct() to the queryset, but it seems overriding get_queryset, or setting the queryset value on the list object type doesn't do anything.

Any ideas?

paulsermon-gemfair avatar Aug 19 '22 16:08 paulsermon-gemfair