Pagination
You can use the following arguments for every collection field to page the results:
Name | Default value | Description |
---|---|---|
limit |
10 |
The maximum items to return |
offset |
0 |
The number of items to skip |
To select communities from 5th to 10th, each with a maximum of two child domains, use the following query:
query {
communities(limit: 5, offset: 5) {
subDomains(limit: 2) {
name
}
}
}
Offset-based pagination works well for the first pages, but using a very large offset will have a negative impact on performance. If you need to select many assets in small chunks it's better to achieve pagination using a where
argument. For example, to fetch the first page, use:
|
|
For each of the next pages, use the ID of the last item in the where clause. In this example, with the default limit of 10 elements it's going to be 00000000-0000-0000-0000-000000008010
.
|
|