Skip to content
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: fields of object should be ANDed always #4171

Merged
merged 1 commit into from
Nov 15, 2022
Merged

Conversation

saihaj
Copy link
Member

@saihaj saihaj commented Nov 14, 2022

Let's take this query as an example

{
  musicians(where: { or: [{name: "John", id: "m2"},{bandId: "7j"}]}){
    id
  }
}

Before when the filter for OR/AND was parsed and SQL was generated it would flatten all the filters and then all the fields were ORed so it would look like

EntityFilter::Or([{name: "John"}, {id: "m2"}, {bandId: "7j"}])

After this PR it will alway AND the fields in an object and then OR the adjacent fields so it would look like

EntityFilter::Or([EntityFilter::And([{name: "John"}, {id: "m2"}]), EntityFilter::And([{bandId: "7j"}])])

Copy link
Collaborator

@lutter lutter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the quick fix!

@saihaj saihaj merged commit 9535adf into master Nov 15, 2022
@saihaj saihaj deleted the saihaj/fix-or-filter branch November 15, 2022 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants