Pagination
For responses that return lists it’s important to understand how we paginate
The Ownright Partner API uses the GraphQL “Connection” pattern for pagination — a powerful and flexible way to request data in chunks while maintaining full control over ordering and navigation.
If you’re used to page and per_page style pagination, this might feel different at first, but it offers more precision and consistency — especially in real-time environments where data can change frequently.
🔄 What are GraphQL connections?
Connections are a GraphQL pattern for handling lists of objects (like referrals or matters) in a standardized way. Instead of simple arrays, connections return a structured object with:
A list of edges, each containing:
- A node (the item you care about)
- A cursor (a pointer used for pagination)
A pageInfo object that helps you know:
- If there’s a
hasNextPage
orhasPreviousPage
- What the
startCursor
andendCursor
are for the current page
This model helps avoid missing or duplicate items when new data is created during pagination.
📦 Example paginating matters
Let’s say you want to fetch a list of matters you have access to, 10 at a time:
When you get the response, you’ll receive a list of matters, and if hasNextPage
is true,
you can request the next page using the endCursor
:
This gives you cursor-based pagination, which is more reliable than offset-based pagination when the data is constantly changing.
🧠 Common use cases
Here are a few common ways to use connections in the Partner API:
- List all matters using matters(first: N) with pagination
- Build an activity feed by scrolling through matter updates
- Export historical data one page at a time for internal reporting
- Sync new matters incrementally by storing the last cursor you’ve seen
📚 Learn more about GraphQL connections
If you’re new to GraphQL pagination, here are some great resources:
GraphQL Cursor Connections Specification – the original spec
Apollo Pagination Docs – practical client-side usage
Hasura Pagination Primer – friendly intro with visual examples
💡 Tips for implementation
- Always check pageInfo.hasNextPage before paginating
Don’t assume cursors are sequential strings — treat them as opaque tokens
- Use cursors to resume pagination if a sync job is interrupted
Avoid using GraphQL offset or skip patterns — they’re not supported in our API