Product variants query pagination broken?

When using the productVariants query, the API doesn’t respect the number of data I’m querying for, so when I use first: 250, I get much less than 250 results even though there are many more than 250 variants in the store. That’s one problem, but one I could live with.

The bigger problem is that when using pagination and querying the second page, I get a certain number of results, hasNextPage: true , and an endCursor. Clearly, there should be more results when using the endCursor to query the third page, right? But using it yields zero results. Yet still, hasNextPage is true .

First query:

Querying the second page:

Querying the third page:

I am thus unable to use pagination to get all the results. Is pagination of this query’s results broken?

Hey @Radek_Zabransky :waving_hand: - thanks for sharing all the query info there. I think there may have been an issue on our end which I think I’ve fixed - can you give the pagination queries a try now and let me know if the issue persists?

Hope this helps!

Thanks, it seems to have helped! The volume of returned data is correct and pagination works as well.

Do I understand it correctly that this is now fixed in all versions of the GraphQL API on all Shopify stores? Wow, what a prompt solution, thank you.

Hey @Radek_Zabransky :waving_hand: - no worries! I can’t share too much internal info, but it looks like what happened here was a database/search layer disconnection (which is the connector between our DB and the API for queries) that was isolated only to this shop. I ran a quick task on our end that resolved the issue.

It shouldn’t pop up on any other stores, but let me know if you do see any further issues and we can take a look.

1 Like