productVariantUpdate mutation fail with internal error

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!!!

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

YEEES…It’s work

1 Like