Pagination
Guide to pagination in the IXO Blocksync GraphQL API
Pagination is crucial for managing large datasets efficiently, ensuring smooth navigation and data retrieval without overwhelming clients or servers.
Default Pagination
The IXO Blocksync GraphQL API uses a default pagination value of 10 items across all queries.
Pagination Parameters
first
first
Defines the number of records to return in each query.
Usage
last
last
Defines the number of records to return, starting from the end of the dataset.
Usage
after
after
Cursor to indicate the point in the dataset from which to continue fetching results.
Usage
before
before
Cursor to navigate backward from a specific point in the dataset.
Usage
Response Structure
A paginated response includes metadata for navigation:
Response Fields
- edges: Array of results
- pageInfo.endCursor: Reference point for next results
- pageInfo.hasNextPage: Indicates more data availability
Best Practices
Set Reasonable Limits
Use 20-100 items per query for optimal performance
Handle End of Data
Check hasNextPage
to determine if more data is available
Avoid Hardcoding
Use cursor values from responses, don’t hardcode them
Monitor Rate Limits
Implement rate limiting strategies to avoid 429 errors
Error Handling
400 Bad Request
400 Bad Request
Occurs with invalid cursor values. Always use cursors from previous responses.
429 Too Many Requests
429 Too Many Requests
Implement retry logic with exponential backoff when rate limits are reached.
For optimal performance, implement client-side caching of paginated results when appropriate.