Skip to main content

Filtering

Filter records by any field in your data using JSON path-based expressions. Combine multiple conditions with AND, OR, and NOT logic.

JSON Path Filtering

Filter by any field using path to specify the location in your JSON data:

query GetAvailableProducts {
products(data: {
where: {
AND: [
{ data: { path: ["status"], equals: "available" } },
{ data: { path: ["specifications", "certified"], equals: true } },
{ data: { path: ["price"], gte: 50 } }
]
}
}) {
edges {
node {
id
data {
name
status
price
}
}
}
totalCount
}
}

Path examples:

  • ["status"] — top-level field
  • ["specifications", "certified"] — nested object field
  • ["settings", "ui", "theme"] — deeply nested
note

Filtering by objects inside arrays is not currently supported — you can filter by arrays themselves using array_contains.

String Operators

OperatorDescription
equalsExact match
notNot equal
inValue is one of the listed values
notInValue is not any of the listed values
string_containsSubstring match
string_starts_withPrefix match
string_ends_withSuffix match
mode: insensitiveCase-insensitive (combine with any string operator)
query StringFilterExamples {
products(data: {
where: {
OR: [
{ data: { path: ["name"], string_contains: "wireless", mode: insensitive } },
{ data: { path: ["sku"], string_starts_with: "ELEC-" } },
{ data: { path: ["category"], in: ["electronics", "accessories"] } }
]
}
}) {
edges { node { data { name sku category } } }
}
}

Numeric Operators

OperatorDescription
equalsEqual to
notNot equal to
gtGreater than
gteGreater than or equal
ltLess than
lteLess than or equal
inValue is one of the listed values
query GetProductsByPrice {
products(data: {
where: {
AND: [
{ data: { path: ["price"], gte: 50 } },
{ data: { path: ["price"], lt: 500 } },
{ data: { path: ["stock_quantity"], gt: 0 } }
]
}
}) {
edges { node { data { name price stock_quantity } } }
}
}

Boolean Operators

query GetActiveProducts {
products(data: {
where: {
AND: [
{ data: { path: ["available"], equals: true } },
{ data: { path: ["recalled"], equals: false } }
]
}
}) {
edges { node { data { name available } } }
}
}

Array Operators

OperatorDescription
array_containsArray includes the value
array_starts_withFirst element matches
query GetProductsByFeatures {
products(data: {
where: {
data: { path: ["features"], array_contains: "wireless" }
}
}) {
edges { node { data { name features } } }
}
}

Logical Operators

Combine conditions with AND, OR, and NOT:

query GetTargetedUsers {
users(data: {
where: {
AND: [
{ data: { path: ["status"], equals: "active" } },
{
OR: [
{ data: { path: ["role"], equals: "admin" } },
{
AND: [
{ data: { path: ["role"], equals: "developer" } },
{ data: { path: ["level"], equals: "senior" } }
]
}
]
},
{
NOT: {
data: { path: ["department"], in: ["temp", "contractor"] }
}
}
]
}
}) {
edges { node { data { name role level department } } }
}
}

System Field Filtering

Filter by built-in system metadata:

FieldTypeExample
idString{ id: { startsWith: "user-" } }
createdAtDateTime{ createdAt: { gte: "2025-01-01T00:00:00Z" } }
updatedAtDateTime{ updatedAt: { gte: "2025-01-10T00:00:00Z" } }
readonlyBoolean{ readonly: { equals: false } }

Mixed Filtering

System field filters and JSON path filters can be combined in the same AND/OR clause:

query {
users(data: {
where: {
AND: [
{ createdAt: { gte: "2025-01-01T00:00:00Z" } },
{ data: { path: ["status"], equals: "active" } },
{ data: { path: ["role"], in: ["admin", "editor"] } }
]
}
}) {
edges { node { id createdAt data { name status role } } }
}
}