Shopify graphql API bulk mutation of products, is it possible?

Topic summary

A developer built a program to update product categories via Shopify’s GraphQL API using a CSV mapping file (product type → taxonomy ID). The current implementation processes products individually, taking ~1 second per product—making bulk operations (e.g., 1000 products = 15 minutes) impractical.

Core Question:
Can the ProductUpdate mutation accept an array of product IDs instead of processing one at a time?

Solution Provided:
Shopify supports bulk mutations, but requires a different approach:

  • Create a JSONL file containing mutation variables
  • Upload to Shopify’s temporary storage
  • Initiate a bulk operation
  • Poll for completion

The responder referenced Shopify’s bulk operations documentation and suggested the official Shopify dev forums for more technical GraphQL support.

Status: Question answered with implementation guidance, but requires significant code refactoring from the current single-mutation approach.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

I have made a program that changes the category of products based on a pre-mapped csv file. The file consists of a product type and taxonomy ID, all the products and are then collected by a query and their product types are compared to the ones on the file, if there’s a match on the file, then a mutation is created where that product’s category is changed with connecting to the Shopify API. The problem is that its pretty unfeasible for large scale lists of products as it takes about a second per product, so 1000 products becomes 15 minutes. And the majority of that time is the API call itself as I’ve tested with just the comparison algorithm itself and fake data.

So I am wondering if its possible to apply a mutation to an array of products in one go instead of individually?

This is my mutation code, can i change the input of the productid to an array of ids? Thanks

mutation = """
    mutation ProductUpdate($input: ProductInput!) {
      productUpdate(input: $input) {
        product {
            id
            category {
                id
            }
        }
        userErrors {
          field
          message
        }
      }
    }
    """

    variables = {
        "input": {
            "id": product_id,
            "category": category_id  
        }
    }

 headers = {'Content-Type': 'application/json',
    'X-Shopify-Access-Token': TokenVar}
    response = requests.post(g_url, json={'query': mutation, 'variables': variables}, headers=headers)

Hi @mttwTHQ1216 ,

Shopify does have a the option to run mutations in bulk but it’s a little more complicated: you need to create a JSONL files with the variables you want to use, upload that to a temporary location in Shopify, create a ‘bulk operation’ and then wait for it to complete.

There’s some more details in the docs that walk through the whole process.

Also, if in the future you have trouble getting answers here I’d try out the official Shopify dev forums at https://community.shopify.dev/. There’s a lot more of the technical GraphQL nitty gritty on those forums.

Best,
Daniel