mirror of
https://github.com/AnimeThemes/animethemes-api-docs.git
synced 2026-07-11 01:34:06 +02:00
1c0fbd5233
(cherry picked from commit 316aabdb2a)
1.5 KiB
1.5 KiB
title
| title |
|---|
| Pagination |
Pagination
The AnimeThemes API query that uses pagination shall contain a paginatorInfo object for pagination strategies and a data collection with the resources.
Arguments
There are two arguments available for every query that uses pagination.
| Name | Type | Default | Max | Description |
|---|---|---|---|---|
| first | Int! | 15 | 100 | Limits number of fetched items |
| page | Int | 1 | lastPage | The offset from which items are returned |
Query
The following query
query {
animes(first: 2, page: 1) {
paginatorInfo {
count
currentPage
firstItem
hasMorePages
lastItem
lastPage
perPage
total
}
data {
name
}
}
}
will return the JSON:
{
"data": {
"animes": {
"paginatorInfo": {
"count": 2,
"currentPage": 1,
"firstItem": 1,
"hasMorePages": true,
"lastItem": 2,
"lastPage": 2317,
"perPage": 2,
"total": 4633
},
"data": [
{
"name": ".hack//Liminality"
},
{
"name": ".hack//roots"
}
]
}
}
}