Given query not working
query ances {
places(where: {_or: {country: {_like: "an%", _like: "an"}}}) {
id
country
}
}
Expected
Place Load (102.6ms) SELECT "places".* FROM "places" WHERE ("places"."country" LIKE 'an%' OR "places"."country" = 'an')
Try:
query ances {
places(where: {_or: [{country: {_like: "an%"}}, {country: {_like: "an"}}] }) {
id
country
}
}
Just fyi, in this particular example, your first condition will subsume your second condition i.e. like 'an%' will also match an
@tirumaraiselvan Thank you, it worked. I couldn't find it in the document. Wouldn't it be good to be included in the document?
@fastengineer It is mentioned here: https://hasura.io/docs/1.0/graphql/manual/queries/query-filters.html#using-multiple-filters-in-the-same-query-and-or
You can also use the search bar on the top to search for a query like "multiple or" and the first result is the above.
Closing the issue now.
I can also recommend joining our community on Discord https://discordapp.com/invite/hasura for more syntax related queries.