strawberry-graphql / strawberry-django

Strawberry GraphQL Django extension
https://strawberry.rocks/docs/django
MIT License
408 stars 118 forks source link

Pass field lookups to the custom filter method #427

Closed iamcrookedman closed 6 months ago

iamcrookedman commented 10 months ago

Feature Request Type

Description

When a filter includes another nested filter with custom methods, it is impossible to get to the lookup and use it for filtering.

Essentially, custom filtering methods can be used within a specific filter, but cannot be used if the filter is nested. In this case, you have to build workarounds based on the type of queriset model, which is quite unpleasant

The simplest solution seems to be passing the lookup as a method argument.

Upvote & Fund

Fund with Polar

bellini666 commented 10 months ago

This is one of the issues being discussed in https://github.com/strawberry-graphql/strawberry-graphql-django/issues/399 and how to improve that API

bellini666 commented 6 months ago

Fixed by https://github.com/strawberry-graphql/strawberry-django/pull/478