learnshopify.dev/Workspace
code reading

The catalog sync job's query. The comments show what the caller passes on each call.

query CatalogPage($cursor: String) {
  products(first: 50, after: $cursor) {
    edges {
      node {
        id
        title
        status
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

# Call 1 variables: { "cursor": null }
# Call 2 variables: { "cursor": "eyJsYXN0X2lkIjo4NDQyMjkxNzgxODU4fQ==" }
#   (call 1's pageInfo.endCursor, passed back unchanged)
1. Why cursors instead of page numbers for a catalog that changes while you export it?
2. What is `endCursor`, exactly?
3. When does the sync loop stop asking for more pages?
4. The job could request `first: 250` and fire calls back to back. What's the catch?
0 / 1 task solved