Skip to main content

PageInfo

PageInfo provides cursor-based pagination metadata returned by all connection types. See How Pagination Works for a full explanation.

Fields

FieldTypeDescription
startCursorStringCursor of the first item (for paginating backward)
endCursorStringCursor of the last item (for paginating forward)
hasNextPageBoolean!Whether more items exist after the last item
hasPreviousPageBoolean!Whether more items exist before the first item

Example

query PaginatedDocuments {
group(id: "Z3JwbGVnYWxlc2lnbxRldg==") {
documentConnection(first: 25) {
documents {
id
name
}
pageInfo {
endCursor
hasNextPage
}
totalCount
}
}
}

To fetch the next page, pass endCursor as the after argument:

query NextPage {
group(id: "Z3JwbGVnYWxlc2lnbxRldg==") {
documentConnection(first: 25, after: "Y3Vyc29yOjI1") {
documents {
id
name
}
pageInfo {
endCursor
hasNextPage
}
}
}
}

Export This Article

Save a copy of this page as PDF or plain text.