Resolved

Jonathan_Aplin
New Member
3 0 0

Hey Folks,

 

First time poster here, apologies if my post doesn't adhere to good standards - I'm a new developer.  I seem to have found a bit of strange behaviour with the new cursor-based pagination while I have been updating an old private app.

 

On making my initial call to the API, without page_info, I don't get the "Link" property in the response header if I provide a limit above 156 in my request. It works with all equal to or below 156 (<=156) but nothing above it (>156). Examples:

 

GET https://@{shop}.myshopify.com/admin/api/2020-04/products.json?

Returns "Link" in the response header

 

GET https://@{shop}.myshopify.com/admin/api/2020-04/products.json?limit=156

Returns "Link" in the response header

 

GET https://@{shop}.myshopify.com/admin/api/2020-04/products.json?limit=157

Doesn't return "Link" in the response header

 

This behaviour is weird because I want to be able to use the maximum limit (250) on each request that I make including the initial request. Interestingly, "Link" is returned in the header when I use limit=250 AND a given page_info from a response header. For example:

 

GEThttps://@{shop}.myshopify.com/admin/api/2020-04/products.json?page_info={page_info}&limit=250'

Returns "Link" in the response header

 

The behaviour seems like a bug but it's possible that I'm missing something. It would be nice to be able to get 250 results even on the initial request.

 

Replies 0 (0)