Looks like a bug on that particular object because testing on others, either no cursor is returned, or even if it is, the query doesn’t error out but simply returns an empty edges array.
Thus I wouldn’t rely on the cursor’s presence in the response for paging, but use pageInfo.hasNextPage instead.
Hope that helps and good catch - might want to report as a possible bug to @Shopify?
What I meant is that you get a cursor as long as there is a next page. When hasNextPage: false ignore the cursor and making the next call otherwise you end up with the error you’re seeing.
Regarding Shopify devs, I suppose they do lurk around the hallows of forums but am not aware of ways to directly contact them - as a dev I’d be scared of users contacting me… the horror the horror
Ah right, so you aren’t getting that error until using the cursor when there are no more pages left? I’m seeing the error even if there are more pages, I haven’t been able to use the cursor variable at all
Nope, not getting it. That is, I only ever get that error on your specific query on Checkout object. Other objects seem to work fine for the few I tried. And I only get it when using the cursor on after where hasNextPage: false. Have you checked that your checkout has more than 2 items?
I’m only getting the error on checkout too, I’ve got a similar query running fine on shop. Strange, yeah there’s definitely more than 2 items. Have you got a checkout id I could try?
Okay this is embarassing, you were right all along. Checkout lineItem paging is broken no matter if you have hasNextPage: true or not. No idea what I did earlier this morning - going to blame myself answering questions before having coffee.
Coffee is always a good idea!
While this is definitely a bug IMO, being on the Checkout object I don’t think we’d run in to this issue in practice - just set first:250 lineItems and hope billionaires don’t fill up your cart with more until @Shopify fix it
Haha don’t worry about it, I appreciate your help either way! I’m just glad that someone else has confirmed the bug, because I was convinced it was me doing something silly!
That’s what I’ve done in the past, but I thought since I’m being all fancy and using GraphQL instead of JSON, I’ll load data when I need to rather than all at once. Plus I can sleep easy knowing that even though its theoretically impossible, those billionaires can’t break the site!
One of our team members is going to take a deeper look into this, but for now, I can pass along that the query seems to work if you pass the cartId and not the cursor value.
Querying with cartId works just fine. It’s when the cart contains more line items than we fetch, we cannot page (i.e. after: $cursorFromPreviousResponse).
Steps to reproduce:
Run this query on a cart that has more than 1 line item