Hi I’m working to pull down shipment data, and want to run the following query; however, I’m receiving an error “Unexpected Error” with the code 22. I can create requests successfully using the after parameter to move forward through the pagination, using the before parameter to go back pages causes the code 22 message
I’ve looked into it, and I can see what’s going on.
The way pagination works require you to use after with first and before with last. I will try to explain as best as possible.
In pagination, when you use the before or after cursors, you query for everything that comes before or after that cursor, respectively. So when you use the after, you need to poll for the first: #, so you get the immediate batch that follows. But when you use the before cursor, you need to use last: #, as you want to fetch the items closer to your cursor from the bulk. In this case, last would mean something like, bring me the last part of everything that comes before this cursor. If you use first+before, you would go back to page one. However, that is not supported, so that’s why you are getting that error.
Please let me know if I wasn’t clear enough.
Have a great day!