A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi all,
I'm trying to post a "productVariantCreate" mutation to my store and is not working. The other mutation ("productCreate") works fine so is definitely not a problem with the connection to the store.
This is the body of the post:
"mutation { productVariantCreate(input: { id: \"#{gid}\", sku: \"#{variant.sku}\", price: \"#{variant.price}\" }) { product { id } } }"
where gid = gid://shopify/Product/4458873847945, variant.sku = 123456789, price = 100.0
I'm getting the following message after attempting the post:
"Internal error. Looks like something went wrong on our end.\nRequest ID: 29e634db-c496-494d-adc9-62c2924d5f0f (include this in support requests)."
Please help me solve this issue 🙂
Hey @tomasdelaveau ,
Looking into the platform logs on our end for this Request ID, it seems that this error was thrown by the Exception of "invalid id". Can you please check to ensure that the Product ID you entering into this mutation is in the correct format and has the correct ID value?
To learn more visit the Shopify Help Center or the Community Blog.
Hey @hassain , the value for the ID was fine, the problem was that I was using "id" instead of "productId" as the field.