For performance and scale reasons, the number of entries returned per request is limited. There is a pagination mechanism that makes it possible to jump to the next batch of entries via cursor-paged pagination.
The concept is based on connections and edges, which are a quasi-standard for pagination in GraphQL. For queries that allow pagination, the arguments can First
and After
as well as a requested PageInfo
be defined. The first argument defines how many items should be returned with the request. For performance reasons, this value must not exceed 50. Die PageInfo
contains a EndCursor
who the cursor
Defined the last element on the page. This EndCursor
Can then for the After
argument of the next request can be used to add the following elements after EndCursor
to receive. The parameters for controlling page numbering are documented in the diagram.
For the first page, no After
argument can be set. The following query returns the first 50 entries along with a PageInfo
Back that the EndCursor
the page contains.
{
allEntries(first: 50) {
totalCount
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
name
}
}
}
}
To request the next 50 entries, we use the EndCursor
the previous answer and set it as follows for the after argument of the next request:
{
allEntries(first: 50, after: "NTA") {
totalCount
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
name
}
}
}
}