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

Response Structure

A paginated response includes metadata for navigation:

{
  "data": {
    "entities": {
      "edges": [
        {
          "node": {
            "id": "did:ixo:entity:001",
            "name": "Entity One"
          }
        }
      ],
      "pageInfo": {
        "endCursor": "YXJyYXljb25uZWN0aW9uOjIw",
        "hasNextPage": true
      }
    }
  }
}

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

For optimal performance, implement client-side caching of paginated results when appropriate.

Was this page helpful?