Pagination
This guide will help you get started with fetching sequences of Alerts from the Alerts API
Depending on the use-case, there might be a need to fetch more than 100 entities from the Alerts API for local data processing. For such scenarios, Alerts API implements id-based cursor pagination.
Example
Let's assume we have the following set of Alerts available in the API:
Running the following GraphQL query would return the very first of the three Alerts:
Since this response contains the same amount of items as was requested with the first
argument, we can assume there are more Alerts available for the same query.
To fetch the next page, it's possible to specify after
argument on the alerts
node which accepts a valid Alert ID. It instructs the API to return all the entities following the one with the given ID.
Running the same query, but with after
argument:
Will return the second Alert from the initial group.
after
argument can be combined with any other arguments available on the alerts
node, including orderBy
If we'll run the same query, using last Alert's ID, it'll return the empty array:
This indicates that we have paginated through all available entities and there are no more Alerts left.
Last updated