Pagination & Filtering
Most list queries support pagination, filtering, sorting, and search.
Pagination
Offset-based with first (page size) and page (1-based):
query {
peoples(first: 25, page: 2) {
data { id name email }
paginatorInfo {
currentPage
lastPage
perPage
total
count
hasMorePages
}
}
}Filtering
# Exact match
query {
peoples(where: { column: EMAIL, operator: EQ, value: "jane@example.com" }) {
data { id name email }
}
}
# Pattern match
query {
peoples(where: { column: EMAIL, operator: LIKE, value: "%@acme.com" }) {
data { id name email }
}
}
# AND conditions
query {
peoples(where: {
AND: [
{ column: IS_ACTIVE, operator: EQ, value: true }
{ column: CREATED_AT, operator: GTE, value: "2024-01-01" }
]
}) {
data { id name }
}
}
# OR conditions
query {
leads(where: {
OR: [
{ column: STATUS, operator: EQ, value: "open" }
{ column: STATUS, operator: EQ, value: "in_progress" }
]
}) {
data { id title status { name } }
}
}Available Operators
| Field | Type | Description |
|---|---|---|
| EQ | Comparison | Equal to |
| NEQ | Comparison | Not equal to |
| GT | Comparison | Greater than |
| GTE | Comparison | Greater than or equal |
| LT | Comparison | Less than |
| LTE | Comparison | Less than or equal |
| LIKE | Pattern | Pattern match (% as wildcard) |
| IN | Set | Value in list |
| NOT_IN | Set | Value not in list |
| IS_NULL | Null check | Is null |
| IS_NOT_NULL | Null check | Is not null |
| BETWEEN | Range | Between two values |
Sorting
# Single column
query {
products(first: 20, orderBy: [{ column: CREATED_AT, order: DESC }]) {
data { id name created_at }
}
}
# Multiple columns
query {
leads(orderBy: [
{ column: STATUS, order: ASC }
{ column: CREATED_AT, order: DESC }
]) {
data { id title status { name } created_at }
}
}Search
query {
products(search: "widget") {
data { id name description }
paginatorInfo { total }
}
}