Pagination
The paginated list queries take a PageOptionsInput and return a page object with data (the items) and meta:
| Query | Argument name |
|---|---|
getPublicContentsByTags | pageOptionsDto |
publicProducts | pageOptionsDto |
publicCategories | pageOptionsDto |
projectContents | pageOptionInput |
query Products($page: Int!) {
publicProducts(pageOptionsDto: { page: $page, limit: 20, order: DESC }) {
data { id slug }
meta { page take itemCount pageCount hasNextPage hasPreviousPage }
}
}PageOptionsInput fields, all optional:
page: 1-based page number, default1, minimum1.limit: page size, default10, from1to 200. A larger value fails withBAD_REQUEST.order:ASC(default) orDESC. For contents it orders by publish date, so passDESCfor “newest first”.
meta (PageMetaDto):
page: the page you asked for;take: the page size used.itemCount: total number of matching items;pageCount: total number of pages.hasNextPage/hasPreviousPage: loop untilhasNextPageisfalse.
Other lists are not paginated this way: getPublicFeaturedPets, getPublicPetsByCategory and the connection queries
take a limit argument, and getPublicPets takes limit and offset inside its filterInput.