strawberry-graphql / strawberry-django

Strawberry GraphQL Django extension
MIT License
391 stars 115 forks source link

manually using strawberry_django.filters.apply does not work anymore after v0.27 #432

Closed devkral closed 6 months ago

devkral commented 7 months ago

my queries which use OR and AND doesn't work anymore. I think the sorting breaks stuff, you may need to convert the key lambda to

lambda f: (f.name not in {"OR", "AND", "NOT"}, f.name)

but I didn't investigated the bug in detail.

Note: I use strawberry_django.filters.apply manually

Edit: fix the code suggestion (was inverted)

Upvote & Fund

Fund with Polar

devkral commented 7 months ago

maybe f.name isn't required at all (but useful for sorted results) as well as reverse (note: in this case the suggested code must be changed to f.name in ...)

bellini666 commented 7 months ago

@devkral ohh thank you for raising that issue.

The changes was done in this PR to fix https://github.com/strawberry-graphql/strawberry-graphql-django/issues/422

Apparently you have made some changes that should fix your issue while not regressing on that fix. Would you like to open a PR with that? I'll try to review it ASAP!