You can use the where argument in your queries to filter results based on some field’s values (even
nested objects’ fields). You can even use multiple filters in the same where clause using the _and or the
_or operators.

For example, to fetch data for an author whose name is “Sidney”:

query{author( where: {name: {_eq: "Sidney"}}){idname}}

You can also use nested objects` fields to filter rows from a table and also filter the nested objects as well.

For example, to fetch a list of authors who have articles with a rating greater than 4 along with those articles:

The _in (in a list) and _nin (not in list) operators are used to comparing field values to a list of values.
They are compatible with any Postgres type other than json or jsonB (like Integer, Float, Double,
Text, Boolean, Date/Time/Timestamp, etc.).

The following are examples of using these operators on different types:

Fetch if all of the nested objects defined via an array relationship satisfy a condition¶

As by default a row is returned if any of the nested objects satisfy a condition, to achieve the above we need to frame
the where expression as {_not:{inverse-of-condition}}. This reads as: fetch if not (any of the nested objects
satisfy the inverted condition) i.e. all of the nested objects satisfy the condition.

Fetch if none of the nested objects defined via an array relationship satisfy a condition¶

As by default a row is returned if any of the nested objects satisfy a condition, to achieve the above we need to frame
the where expression as {_not:{condition}}. This reads as: fetch if not (any of the nested objects
satisfy the condition) i.e. none of the nested objects satisy the condition.