Wanting to run productVariantsBulkUpdate inside of bulkOperationRunMutation

Topic summary

Attempt to run a Shopify Admin GraphQL bulk mutation to create variants fails with an “allowed mutation” error. The user is trying bulkOperationRunMutation with the inner mutation productVariantsBulkCreate (despite the title referencing productVariantsBulkUpdate) and a stagedUploadPath.

  • Mutation used: productVariantsBulkCreate(productId, variants) inside bulkOperationRunMutation. They previously used a similar flow to bulk upload initial products.
  • Error returned: “You must use an allowed mutation name.” bulkOperation is null; userErrors reference the mutation field.

Key point: bulkOperationRunMutation only permits a limited, whitelisted set of mutations. The user is unsure if their syntax is wrong or if productVariantsBulkCreate/Update is not on the allowed list.

Open questions/outcomes:

  • Whether productVariantsBulkCreate (or productVariantsBulkUpdate) is supported by bulkOperationRunMutation.
  • If not supported, what is the recommended approach to bulk create variants across multiple products (e.g., alternative mutations, batching per product, or other supported bulk operations).

Status: No resolution yet; seeking confirmation of allowed mutations and viable bulk-creation workflow.

Summarized with AI on December 30. AI used: gpt-5.

Hi! I am new to graphQL and I have been having some trouble with the bulkOperationRunMutation when using it with productVariantsBulkUpdate. I am getting this error when trying to upload my products’ variants. I followed the bulkMutationRunMutation steps aswell, similar to what I did when bulk uploading the initial products.

Here is the block I’m trying to post (with %s being the upload path):

mutation {
  bulkOperationRunMutation(
    mutation: "mutation CreateProductVariants($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
  productVariantsBulkCreate(productId: $productId, variants: $variants) {
    productVariants {
      id
      title
      selectedOptions {
        name
        value
      }
    }
    userErrors {
      field
      message
    }
  }
}
",
    stagedUploadPath: "%s") {
    bulkOperation {
      id
      status
    }
    userErrors {
      message
      field
    }
  }
}

And here is the error I am receiving:

{'data': {'bulkOperationRunMutation': {'bulkOperation': None, 'userErrors': [{'message': 'You must use an allowed mutation name.', 'field': ['mutation']}]}}, 'extensions': {'cost': {'requestedQueryCost': 10, 'actualQueryCost': 10, 'throttleStatus': {'maximumAvailable': 2000.0, 'currentlyAvailable': 1990, 'restoreRate': 100.0}}}}

Is there something wrong with my syntax, or is productVariantsBulkUpdate just not allowed to be used with bulkOperationRunMutation? If the latter is the case, how would I go about bulk creating multiple variants for multiple products?

Any help is appreciated!