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

FieldTypeDescription
EQComparisonEqual to
NEQComparisonNot equal to
GTComparisonGreater than
GTEComparisonGreater than or equal
LTComparisonLess than
LTEComparisonLess than or equal
LIKEPatternPattern match (% as wildcard)
INSetValue in list
NOT_INSetValue not in list
IS_NULLNull checkIs null
IS_NOT_NULLNull checkIs not null
BETWEENRangeBetween 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 }
  }
}