Navigating between pages
You can add pagination for your queries by sending the page
and first
parameter to your queries.
Param | Description | Type | Default |
---|---|---|---|
page | Page number | int | 1 |
first | Number of results to return | int | 50 (max: 250) |
query {
Customers(page: 5, first: 10) {
data {
id
label
}
}
}
Ask for page information
There is a lot of information you can also ask about the current query.
Param | Description | Type |
---|---|---|
count | Number of items in the current page. | int |
currentPage | Index of the current page. | int |
hasMorePages | Are there more pages after this one? | bool |
total | Number of total available items. | int |
lastPage | Index of the last available page. | int |
perPage | Number of items per page. | int |
lastItem | Index of the last item in the current page. | int |
firstItem | Index of the first item in the current page. | int |
{
Customers(page: 3, first: 5) {
data {
id
label
}
paginatorInfo {
count
currentPage
hasMorePages
total
lastPage
perPage
lastItem
firstItem
}
}
}
{
"data": {
"Customers": {
"data": [
{
"id": 100011,
"label": "Yundt"
},
{
"id": 100012,
"label": "Collier"
}
],
"paginatorInfo": {
"count": 2,
"currentPage": 3,
"hasMorePages": false,
"total": 12,
"lastPage": 3,
"perPage": 5,
"lastItem": 12,
"firstItem": 11
}
}
}
}