A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi All
I've this simple mutation
mutation productVariantUpdate($input: ProductVariantInput!) {
productVariantUpdate(input: $input) {
userErrors {
field
message
}
}
} { "input": { "id": "gid://shopify/ProductVariant/48122871087427", "price": 3.465, "compareAtPrice": 0, "inventoryItem": { "cost": 2.6, "tracked": true }, "metafields": null } }
I've tryed this mutation many times and always was good, this mutaion is part of my software to update price and cost, but today it fail.
That fail with this error:
{ "errors": [ { "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 4a5fe55c-28f3-42c1-a988-75bad99ae434-1711723233 (include this in support requests).", "extensions": { "code": "INTERNAL_SERVER_ERROR", "requestId": "4a5fe55c-28f3-42c1-a988-75bad99ae434-1711723233" } } ] }
I can't understand WHY!!!
Solved! Go to the solution
This is an accepted solution.
Hey @CarloB,
Metafields isn't a required field on ProductVariantInput. Can you try removing the "metafields": null to see if it resolves the issue?
If you are trying to delete actual metafields on a productVariant there's a separate metafieldDelete mutation that you can use.
Hope that helps!
- James
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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
This is an accepted solution.
Hey @CarloB,
Metafields isn't a required field on ProductVariantInput. Can you try removing the "metafields": null to see if it resolves the issue?
If you are trying to delete actual metafields on a productVariant there's a separate metafieldDelete mutation that you can use.
Hope that helps!
- James
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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
YEEES...It's work