Skip to main content

Pagination

List queries in the Vasco GraphQL API usually return a Connection object instead of a raw array. This follows the common GraphQL connection pattern and makes large result sets easier to browse page by page.

Connection structure

A paginated response generally contains:

FieldDescription
edgesThe list wrapper. Each edge contains one result and its pagination cursor.
nodeThe actual business object returned by the query.
cursorAn opaque position marker attached to an edge.
pageInfoMetadata about the current page, such as hasNextPage and hasPreviousPage.
totalCountThe total number of matching items, when exposed by the connection.

Requesting a page

Most Vasco list queries use resultsPerPage and page arguments. Start with page: 1 and keep resultsPerPage to a reasonable value for your use case.

query ListAccounts {
GetAccounts(
resultsPerPage: 20
page: 1
) {
totalCount
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
cursor
node {
id
label
}
}
}
}

Some operations expose query-specific arguments such as start and end. Check the API Reference for the exact arguments supported by each list query.

Best practices

  • Request only the fields your screen or integration needs inside node.
  • Avoid very large pages; prefer loading the next page when needed.
  • Use totalCount for counters and page controls when it is available.
  • Use pageInfo to know whether another page exists.
  • Treat cursors as opaque values: do not parse or build them yourself.

For more background on GraphQL pagination patterns, see the official GraphQL pagination guide.