-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graphql: AND/OR filter #4080
graphql: AND/OR filter #4080
Conversation
I am still trying to wrap my head around what this all means - the notation that GraphQL imposes on us makes this all pretty confusing. If I have predicates
because we need to define precedence rules. I would expect the above to mean I wonder if we should enforce the latter notation by making it illegal to have There's also the mixed case of As for this being expensive: if people start using |
Thanks so much @saihaj! I think this is close.. I wonder if we can address some of @lutter's concerns by making the approaches exclusive, i.e. the filter can only be one of the following: Retained for backwards compatibility & simplicity (this is effectively a simple AND):
Allows for "or conditions":
Allows for more nuanced AND filtering, sub-filters with OR etc:
So in summary:
|
Per @saihaj's note in Slack, we can't do a Union here, so we have to have the combined type. One point of clarification:
I read this as |
@saihaj as this is still in draft, just let us know when this is ready to take a look! |
One thing: it would be good if there was an (undocumented) feature flag |
e34c2e4
to
1d6c889
Compare
0426e99
to
1d6c889
Compare
Co-authored-by: Kamil Kisiela <[email protected]>
1d6c889
to
0f75ac1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good, you just need to add the environment variable that allows disabling boolean filters
4f77299
to
9bc891a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks great now!
introduces alternative syntax for doing
AND/OR
filters.Generated filter will have these new types
Example queries
Downside with this approach is users can still have nested
AND
/OR
which can be quite expensive example