strawberry-django icon indicating copy to clipboard operation
strawberry-django copied to clipboard

Pass field lookups to the custom filter method

Open iamcrookedman opened this issue 1 year ago • 1 comments

Feature Request Type

  • [ ] Core functionality
  • [X] Alteration (enhancement/optimization) of existing feature(s)
  • [ ] New behavior

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

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

iamcrookedman avatar Nov 27 '23 14:11 iamcrookedman

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 avatar Nov 27 '23 16:11 bellini666

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

bellini666 avatar Mar 18 '24 21:03 bellini666