Handling A bulk operation for this app and shop is already in progress correctly in GraphQL

Solved
annapurna
Tourist
12 0 2

We are hitting this error and my guess is that it is because we are submitting exactly the same query twice. 

For example below:

{
    "data": {
        "bulkOperationRunQuery": {
            "bulkOperation": null,
            "userErrors": [
                {
                    "field": null,
                    "message": "A bulk operation for this app and shop is already in progress: gid://shopify/BulkOperation/{operation_id}."
                }
            ]
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 10,
            "actualQueryCost": 10,
            "throttleStatus": {
                "maximumAvailable": 2000.0,
                "currentlyAvailable": 1990,
                "restoreRate": 100.0
            }
        }
    }
}
    

 

Does this mean that I can use the {operation_id} instead of waiting for the previously submitted operation?

Or the {operation_id} that is currently running is for a different query? Is this truth that one QUERY per APP per SHOP? 

 

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
213 27 39

This is an accepted solution.

Hey @annapurna 

Per https://shopify.dev/tutorials/perform-bulk-operations-with-admin-api your app is only able to run a single bulk operation at a time on your shop. You can query the status of any running bulk operations on the shop before submitting another one (see the heading "Check an operation's progress" in the guide linked above).

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog