Bulk Operation works in GraphQL but not in Postman or Firebase Functions ?

Hi :slightly_smiling_face:

I’m trying to run a bulkOperationRunQuery mutation… in the Shopify GraphQL Explorer everything works great but when I try to run the same function in Postman or Firebase functions it doesn’t work.

Here is the exact same mutation I that I run in Shopify GraphQL Explorer, Postman and Firebase functions:

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

Always the same result for Shopify GraphQL Explorer, Postman and Firebase Functions:

{
  "data": {
    "bulkOperationRunQuery": {
      "bulkOperation": {
        "id": "gid://shopify/BulkOperation/XXX",
        "status": "CREATED"
      },
      "userErrors": []
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 990,
        "restoreRate": 50
      }
    }
  }
}

So far so good… but when I double check the status with:

{
  node(id: "gid://shopify/BulkOperation/XXX") {
    ... on BulkOperation {
      id
      status
      errorCode
      createdAt
      completedAt
      objectCount
      fileSize
      url
      partialDataUrl
    }
    id
    __typename
  }
}​

I get the following result for Postman and Firebase functions:

{
  "data": {
    "node": null
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 1,
      "actualQueryCost": 1,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 999,
        "restoreRate": 50
      }
    }
  }
}​

… and for Shopify GraphQL Explorer I get:

{
  "data": {
    "node": {
      "id": "gid://shopify/BulkOperation/XXX",
      "status": "COMPLETED",
      "errorCode": null,
      "createdAt": "2022-05-09T15:18:20Z",
      "completedAt": "2022-05-09T15:18:21Z",
      "objectCount": "6",
      "fileSize": "497",
      "url": "XXX",
      "partialDataUrl": null,
      "__typename": "BulkOperation"
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 1,
      "actualQueryCost": 1,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 999,
        "restoreRate": 50
      }
    }
  }
}​

:confused: Any Ideas why it works in Shopify GraphQL Explorer and not when I fire the mutation in Postman and Firebase Functions even when I get the “status”: “CREATED” back?

Things I checked already:

  • Same API version (2022-04) for Shopify Explorer, Postman and Firebase Functions
  • Query the status with currentBulkOperation → bulkOperation that was fired in Postman and Firebase functions is not showing up, just the Shopify Explorer bulkOperation
  • Tried to chancel operations with bulkOperationCancel to make sure a operation is not looping
  • Double check access token → normal product fetch works