To limit the amount of payload data and keep requests fast, most list queries are paginated.
The concept is based on Connections and Edges, which is effectively the standard for pagination in GraphQL. Pagination uses a cursor-based model with the following arguments:
first: Number of items to return (maximum: 50)after: Cursor of the last item from the previous page (omit for the first page)Paginated queries return the following:
nodes: the actual itemspageInfo.endCursor: cursor for the last item on the current pagepageInfo.hasNextPage: indicates whether another page existstotalCount: total number of items (if supported by the query)No after argument needs to be set for the first page. The following request returns the first 50 entries along with a pageInfo object containing the endCursor for the page.
{
allEntries(first: 50) {
totalCount
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
name
}
}
}
}
To request the next 50 entries, use the endCursor from the previous response and set it as the after argument for the next request as follows:
{
allEntries(first: 50, after: "NTA") {
totalCount
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
name
}
}
}
}