Wave uses limit/offset pagination. Clients can provide the optional parameter pageSize
indicating the number of results per page, and a page
parameter indicating the page number they want to return results for (1-based indexing).
When receiving paginated data, a pageInfo
object can be requested. It contains information about the collection including the currentPage
, total number of pages (totalPages
), and the total number of items (totalCount
).
To determine if there are more pages available, check if currentPage < totalPages
.
- Operation
-
query { businesses(page: 1, pageSize: 10) { pageInfo { currentPage totalPages totalCount } edges { node { id name } } } }
- Response
-
{ "data": { "businesses": { "pageInfo": { "currentPage": 1, "totalPages": 1, "totalCount": 2 }, "edges": [ { "node": { "id": "QnVzaW5lc3M6NzE1MjQ3NjEtZjYxMS00ODk0LWE3NDgtNzg3MmYwODgyNWIw", "name": "Personal" } }, { "node": { "id": "QnVzaW5lc3M6MWRhMmExNzctNzg2OC00NmMxLTgzMzktM2M4NjdlZDJlZGQ5", "name": "Smith Consulting" } } ] } } }