Generated queries are paginated with a Paging input argument and return a PageInfo object alongside the rows.
Paging Input #
1
2
3
4
5
input Paging {
page: Int = 1
perPage: Int = 100
}
-
page— the 1-based page number, defaulting to1. -
perPage— rows per page, defaulting to100. It is validated to be at least1and at most the configured maximum (seemaxRecordsPerPage, default2000).
Page Info #
Every paginated result includes a PageInfo:
1
2
3
4
5
6
7
8
9
type PageInfo {
currentPage: Int
hasNext: Boolean
hasPrevious: Boolean
maxPages: Int
nextPage: Int
previousPage: Int
}
Pass nextPage and previousPage back in paging to move between pages. They are null at the ends. The total used to compute maxPages comes from the query builder's count CTE, so pagination metadata is accurate in a single round trip. See sorting and paging.
Total Count #
Alongside nodes and pageInfo, the generated connection type exposes a totalCount. This is the total number of matching rows before paging. It comes from the same count CTE, so you get it without a second query.