Page numbers (page=2) break on a live store: products get created and deleted between calls, so offsets skip some records and repeat others. The Admin API uses cursors: each page's pageInfo.endCursor is an opaque bookmark meaning 'continue after this exact item'.
The loop: call with no cursor, pass endCursor back as after:, repeat while hasNextPage is true. You never parse a cursor or build one.
{
"data": {
"products": {
"edges": [
{ "node": { "id": "gid://shopify/Product/8442291749090", "title": "Ethiopian Yirgacheffe", "status": "ACTIVE" } },
{ "node": { "id": "gid://shopify/Product/8442291781858", "title": "Kenya AA Nyeri", "status": "ACTIVE" } }
],
"pageInfo": { "hasNextPage": true, "endCursor": "eyJsYXN0X2lkIjo4NDQyMjkxNzgxODU4fQ==" }
}
},
"extensions": {
"cost": {
"requestedQueryCost": 56,
"actualQueryCost": 56,
"throttleStatus": { "maximumAvailable": 1000.0, "currentlyAvailable": 944, "restoreRate": 50.0 }
}
}
}
extensions.cost is the rate limit. Every query spends points from a bucket that refills, and bigger pages cost more.
AI tell: a tight while-loop that never looks at throttleStatus and dies mid-catalog with a THROTTLED error.