More info on cursor based pagination in JSON

Highlighted
Shopify Expert
1 0 1

Is it possible to provide more documentation on the JSON cursor pagination? I have questions such as:

 

Is the "pageInfo" connection available forever?

 

How do we get a specific page?

 

What if we want to concurrently download several pages at the same time?

 

Thank you,

1 Like
Shopify Staff
Shopify Staff
5 0 0

@bgilbert99 wrote:

Is it possible to provide more documentation on the JSON cursor pagination? I have questions such as:

 

Is the "pageInfo" connection available forever?

 

We consider `pageInfo` to be a temporary value if that's what you're asking. From the docs:

 

The link header URLS are temporary and we don't recommend saving them to use later. Use these URLs only while working with the request that generated them.

 

 

How do we get a specific page?

That isn't possible with cursor-based pagination unfortunately. You need to use the `pageInfo` returned from a response to get the next page.

 

What if we want to concurrently download several pages at the same time?

This is another limitation of cursor pagination. It was detailed in this blog post: https://www.shopify.com/partners/blog/relative-pagination

 

One common case for using page right now is to make concurrent requests on a series of page numbers all at once. With relative cursors this will no longer be possible, as it will require getting one page to know where the next page starts. Relative cursor-based pagination is faster for getting all the records on large shops, and this increase in speed will make up for the lack of concurrent requests on these shops

0 Likes