learnshopify.dev/Workspace
code reading

The nightly export job: the submission mutation and the poll that follows. Trace it, then answer.

mutation {
  bulkOperationRunQuery(
    query: """
    {
      products {
        edges {
          node {
            id
            title
            variants {
              edges {
                node {
                  id
                  sku
                }
              }
            }
          }
        }
      }
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

# Minutes later, poll until status is COMPLETED,
# then download the JSONL file at url:
query {
  bulkOperation(id: "gid://shopify/BulkOperation/720918") {
    id
    status
    objectCount
    url
  }
}
1. Why a bulk operation for 9,400 variants instead of the pagination loop?
2. In the JSONL result, how does a variant relate to its product?
3. The mutation responds in milliseconds. Where's the data?
4. Which task should NOT be a bulk operation?
0 / 1 task solved