Hi,
I have the following mutation and variable. I have carefully checked the ids and they are those returned from a product query. I am using the GraphiQL installed on my dev store to try this.
I get this error but can’t figure out why:
“errors”: [{“message”: “invalid id”,
“locations”: [{“line”: 4,“column”: 3}],
“path”: [“productVariantDetachMedia”]
The mutation is:
mutation productVariantDetachMedia(
$variantMedia: [ProductVariantDetachMediaInput!]!
) {
productVariantDetachMedia(productId: “gid://shopify/Product/6117569069212”, variantMedia:$variantMedia)
{product {id}
productVariants {id}
userErrors {field
message}
}
}
and the variable:
{“variantMedia”: [
{“variantId”: “gid://shopify/ProductVariant/41707314643100”,
“mediaIds”: [“gid://shopify/ProductImage/33883924463772”]
}]
}
If anyone can see an issue or suggest another way to try this, I’d be really grateful!
Thanks,
Haydn