Pagination

Guide to pagination in the IXO Blocksync GraphQL API

Default Pagination

The IXO Blocksync GraphQL API uses a default pagination value of 10 items across all queries.

Pagination Parameters

first

Defines the number of records to return in each query.

Usage
query {
  entities(first: 50) {
    edges {
      node {
        id
        name
      }
    }
  }
}
last

Defines the number of records to return, starting from the end of the dataset.

Usage
query {
  entities(last: 10) {
    edges {
      node {
        id
        name
      }
    }
  }
}
after

Cursor to indicate the point in the dataset from which to continue fetching results.

Usage
query {
  entities(first: 20, after: "YXJyYXljb25uZWN0aW9uOjEw") {
    edges {
      node {
        id
        name
      }
    }
  }
}
before

Cursor to navigate backward from a specific point in the dataset.

Usage
query {
  entities(last: 10, before: "YXJyYXljb25uZWN0aW9uOjIw") {
    edges {
      node {
        id
        name
      }
    }
  }
}

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

400 Bad Request

Occurs with invalid cursor values. Always use cursors from previous responses.

429 Too Many Requests

Implement retry logic with exponential backoff when rate limits are reached.