Wanting to run productVariantsBulkUpdate inside of bulkOperationRunMutation

user1029523
Shopify Partner
1 0 0

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!

Replies 0 (0)