The API allows you to filter precisely on the results you need. Every entities has its own parameters available and you can find those parameters in each entities documentation.
You can add your conditions to your plural queries using the where
key in your queries:
{
Customers(
where: {
column: LABEL
operator: EQ
value: "Glover"
}
) {
data {
id
label
}
}
}
You can then start to write more complexe queries with AND and OR groups.
{
Customers(
where: {
OR: [
{
column: LABEL,
operator: EQ,
value: "Bauch"
},
{
column: LABEL,
operator: EQ,
value: "Glover"
}
],
AND: [
{
column: ACTIVE,
operator: EQ,
value: true
},
{
OR: [
{
column: UPDATED_AT,
operator: GTE,
value: "2023-12-25 00:00:00"
},
{
column: CREATED_AT,
operator: GTE,
value: "2023-12-25 00:00:00"
}
],
}
]
}
) {
data {
id
label
}
}
}
The following operators are available:
Operator | Description |
---|---|
EQ | Checks if the given column is equal to the given value. |
NEQ | Checks if the given column is different to the given value. |
GT | Checks if the given column is greater than the given value. |
GTE | Checks if the given column is greater or equal to the given value. |
LT | Checks if the given column is lower than the given value. |
LTE | Checks if the given column is lower or equal to the given value. |
IN | Checks if the given column is equal to at least one value in the given array of values. |
NOT_IN | Checks if the given column is different to all values in the given array of values. |
LIKE | Checks if the given column of type string contains the given value as a substring. |
NOT_LIKE | Checks if the given column of type string doesn't contains the given value as a substring. |
BETWEEN | Checks if the given column is set between the two given values. |
NOT_BETWEEN | Checks if the given column isn't set between the two given values. |
IS_NULL | Checks if the given column is null. |
NOT_IS_NULL | Checks if the given column isn't null. |