strawberry-graphql / strawberry-django

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

fix handling of null for lookup filters #460

Closed devkral closed 6 months ago

devkral commented 8 months ago

When a lookup is detected, ignore null values. This PR is a bit conservative and also ignores UNSET but this is most probably not necessary.

This prevents django errors for null specifications and ignores null like the rest of the API does.

Is an exception for the filter exact wanted (e.g. foo_exact=null)? Shall I make a settings switch?

note: exact=null is the same like is_null=true, so there would be no functionality loss, when exact=null would not filter anymore

Types of Changes

Issues Fixed or Closed by This PR

Checklist

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (b5adb23) 87.89% compared to head (8ff2cf5) 87.91%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #460 +/- ## ========================================== + Coverage 87.89% 87.91% +0.01% ========================================== Files 37 37 Lines 3164 3169 +5 ========================================== + Hits 2781 2786 +5 Misses 383 383 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

devkral commented 6 months ago

fixed in an another PR