I am new to GraphQL and I've been trying to come up with a simple query but I'm not getting the results I need.
Basically, I am writing a mutation to delete a row when the following conditions are met:
(A = a AND B = b) OR (A = b AND B = a)
However, I can't seem to figure out how to write it.
I tried doing something like:
delete_links(where: {_or: {_and: {a: {_eq: a}, b: {_eq: b}}}, {_and: {a: {_eq: b}, b: {_eq: a}}}) {
affected_rows
}
}
I am using Hasura on postgresql.
Basically I have a table called Links storing:
link_a | link_b
The problem is a link between item 9 and 2 in link can either be:
link_a | link_b
2 | 9
or
link_a | link_b
9 | 2
Hence I want my delete mutation to delete BOTH cases. However I cant seem to do a query (A = a AND B = b) OR (A = b AND B = a)