SolariumSolariumDocs
Browse The Docs

Docs/Resources

Pagination

Page through long lists with limit and offset.

All list endpoints use offset-based pagination with a consistent interface.

Parameters

ParameterTypeDefaultDescription
limitInt25Number of items per page (max 200)
offsetInt0Number of items to skip
searchString—Case-insensitive text filter (searches relevant fields like name, memo, etc.)
sortByString—Field to sort by (e.g. name, currentBalance, txnDate)
sortDirStringascSort direction: asc or desc

Response shape

Every paginated response includes:

  • items: the array of results
  • totalCount: total number of matching records (before pagination)
  • pageSize: the limit that was applied
  • offset: the offset that was applied

To check if there are more pages: offset + items.length < totalCount.

Requesting beyond the end of the data returns an empty items array, not an error.

Example

Request
# Page 1: first 10 accounts
query {
  listAccounts(
    organizationId: "a1b2c3d4-..."
    limit: 10
    offset: 0
    sortBy: "name"
    sortDir: "asc"
  ) {
    items { id name currentBalance }
    totalCount
    pageSize
    offset
  }
}

# Page 2: next 10
query {
  listAccounts(
    organizationId: "a1b2c3d4-..."
    limit: 10
    offset: 10
    sortBy: "name"
    sortDir: "asc"
  ) {
    items { id name currentBalance }
    totalCount
    pageSize
    offset
  }
}
Response
# Page 1 response
{
  "data": {
    "listAccounts": {
      "items": [
        { "id": "...", "name": "Accounts Payable", "currentBalance": 4200.00 },
        { "id": "...", "name": "Accounts Receivable", "currentBalance": 12400.00 }
      ],
      "totalCount": 24,
      "pageSize": 10,
      "offset": 0
    }
  }
}

# Last page (fewer items than limit)
{
  "data": {
    "listAccounts": {
      "items": [
        { "id": "...", "name": "Travel", "currentBalance": 890.00 }
      ],
      "totalCount": 24,
      "pageSize": 10,
      "offset": 20
    }
  }
}