-
Notifications
You must be signed in to change notification settings - Fork 191
Unexpected behavior of queries that include OR #153
Copy link
Copy link
Closed
Description
To Reproduce
Steps to reproduce the behavior:
- Go to http://194.233.167.225:4350/graphql
- Paste the query:
{
channels(where: {
id_in: ["1", "2", "3"],
OR: [
{ title_contains: "test" },
{ description_contains: "test" }
]
}) {
id
}
}- Hit the "Execute" button
- Notice results including channels other than
1,2and3
Expected behavior
The OR condition is joined with other conditions using the default operator (AND)
Expected difference in SQL:
SELECT "channel"."id" AS _c0 FROM "channel" AS "channel"
- WHERE (("channel"."id" IN ($1, $2, $3)) OR (position($4 in "channel"."title") > 0) OR (position($5 in "channel"."description") > 0))
+ WHERE (("channel"."id" IN ($1, $2, $3)) AND ((position($4 in "channel"."title") > 0) OR (position($5 in "channel"."description") > 0)))Environment (please complete the following information):
@subsquid/graphql-server:3.2.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels