Skip to main content
Tesouro’s GraphQL API supports pagination and filtering on collection queries.

Pagination

Collection queries accept a paging input with two fields:
FieldTypeDescription
skipInt!The number of records to skip (offset).
takeInt!The number of records to return per page.
Each collection query returns a pageInfo object alongside the result items:
FieldTypeDescription
hasNextPageBoolean!Whether more records exist after this page.
hasPreviousPageBoolean!Whether records exist before this page.

Example

query ListItems($input: ListItemsInput!) {
  listItems(input: $input) {
    items {
      id
      createdAt
      status
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
    }
  }
}
Variables
{
  "input": {
    "paging": {
      "skip": 0,
      "take": 25
    }
  }
}
To retrieve the next page, increment skip by the take value:
{
  "input": {
    "paging": {
      "skip": 25,
      "take": 25
    }
  }
}
Continue paginating until pageInfo.hasNextPage is false.

Filtering

Collection queries accept a where input containing typed filter fields. The available filter fields vary by query. Common filter input types include:
Filter typeOperatorsDescription
GuidFilterInputeq, inFilter by a single UUID or a list of UUIDs.
StringFilterInputeq, inFilter by exact string match or a list of strings.
DateRangeFilterInputgte, lteFilter by a date range (inclusive).
EnumFilterInputeq, in, ninFilter by enum value, inclusion, or exclusion.
Refer to the schema reference for each query to see its available filter fields and types.