There's no specific property for end cursor. In this case, you can save the cursor from the last object in the response when
this is breaking the GraphQl specification: https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
PageInfo must contain fields hasPreviousPage and hasNextPage, both of which return non‐null booleans. It must also contain fields startCursor and endCursor, both of which return non‐null opaque strings.
Also in the example it clearly states how to use it: https://graphql.org/learn/pagination/
Please take a look at the bottom of the page.
Of course iterating over the response and use the last cursor is no issue, as long one codes the json parse logic by hand, but with tools expecting the endCursor field in the pageInfo this is a PITA. This breaks them every GraphQl client SDK supporting paging. I would expect this describes all of them.
Is there a way to report this as bug?
This is definitely an interesting point you raise, I'd like to bring this up with our product teams. Can you provide some examples of tools where pagination doesn't work with Shopify's GraphQL implementation? If you have any examples of specific methods/functions that expect the missing fields, please provide those as well.
thanks for reaching out!
I am currently developing in Python. There is only one library geared towards GraphQL I could find in Python, which is SGQLC.
It's main purpose is to create Python Classes based on the GraphQL schema. They are used to formulate queries, mutations, fragments and parse the JSON response into Python objects again.
Very similar to your Syrup library (at least that's the impression I got by a first glimpse into the Syrup Githup Repo).
SGQLC offers a method += to concatenate responses from cursor based paging. The method def __iadd__(self, other) in this source file implements it.
The line 374 in the current version is the breaking one: self.page_info.end_cursor = other.page_info.end_cursor
I am sorry, but I can't give you more examples. But this is the essential one for me.