WebPixie

Pagination & Sorting

Paginate and sort WebPixie GraphQL list queries with page, limit, and sort.

List queries (e.g. findSite, findUptimeLink, findIncident) accept page, limit, and sort arguments, and their responses include a pagination object.

Pagination

query {
  findUptimeLink(page: 1, limit: 25) {
    pagination {
      page
      limit
      count
    }
    items {
      id
      name
    }
  }
}
  • page — defaults to 1
  • limit — defaults to 10; values above 100 are silently capped at 100
  • pagination.count — total number of matching records, useful for calculating how many pages there are

Sorting

Pass one or more { field, direction } pairs to sort:

query {
  findUptimeLink(sort: [{ field: "name", direction: ASC }]) {
    items {
      name
    }
  }
}
  • direction accepts ASC or DESC, and defaults to DESC when omitted
  • If sort isn't provided at all, results are returned newest-created first

A query can be sorted by the same fields it can be filtered by. See Discovering Filterable Fields for how to find them. Sorting by an unsupported field returns a GraphQL error naming the invalid field.

On this page