strawberry-graphql / strawberry-django

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

Pass field lookups to the custom filter method #427

Closed iamcrookedman closed 8 months ago

iamcrookedman commented 1 year 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 1 year 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 8 months ago

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