Hello!
I am using GraphQL productVariantAppendMedia path to associate product image to one of its variants. Below is the mutation:
mutation {
productVariantAppendMedia(productId: "gid://shopify/Product/7723406459105", variantMedia: {mediaIds: ["gid://shopify/ProductImage/36771612623073"], variantId: "gid://shopify/ProductVariant/42940636594401"}) {
product {
id
}
productVariants {
id
}
userErrors {
field
message
}
}
}
When I execute the above mutation on GraphiQL then I receive below (vague) response:
{
"data": {
"productVariantAppendMedia": null
},
"errors": [
{
"message": "invalid id",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"productVariantAppendMedia"
]
}
],
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 1,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 999,
"restoreRate": 50
}
}
}
Which id of which field is invalid? I don’t get it.
Can I even use this path for this purpose?
I will really appreciate quick responses.