Skip to main content
For any query that returns a list of results, you should use pagination. Without pagination, a large query is more likely to time out and return a 502 error. A 502 occurs when an API call doesn’t receive a response within 30 seconds. The ION GraphQL API uses a cursor pagination pattern.

Fetch the first page

This example queries the first five parts with the first parameter and fetches the endCursor in the pageInfo object:
In addition to first, ION queries have the pagination parameters last, before, and after.

Fetch the next page

To fetch the next page, pass the endCursor from the previous query to the after parameter:
To query every part in ION, repeat this pattern to fetch parts in batches of five. Use hasNextPage to determine whether more results remain after each query.