The current implementation of the productSet mutation on 2024-10, is encountering an error when attempting to upload a new image for an already existing product variant.
The mutation being executed is as follows:
mutation updateProductVariantPricing($productSet: ProductSetInput!) {
productSet(synchronous: true, input: $productSet) {
userErrors {
field
message
}
product {
id
media(first: 250) {
nodes {
id
alt
status
preview {
image {
url
}
}
}
}
variants(first: 250) {
nodes {
id
inventoryItem {
id
}
}
}
}
productSetOperation {
id
status
userErrors {
code
field
message
}
}
}
}
With the payload :
{
"productSet": {
"seo": {},
"handle": "Wide dress",
"title": "Wide dress",
"descriptionHtml": "Description",
"status": "ACTIVE",
"tags": [
"6102-Women coats",
"reference_dress",
"Permanent",
"6102-Women coats",
"Permanent",
"reference_dress"
],
"id": "gid://shopify/Product/9873264574774",
"variants": [
{
"sku": "color_reference_spring_dress-VARIANT-SPRINGD-M",
"inventoryPolicy": "CONTINUE",
"id": "gid://shopify/ProductVariant/51101311566134",
"file": {
"alt": "",
"id": "gid://shopify/MediaImage/43511358226742"
},
"optionValues": [
{
"optionName": "Colour",
"name": "white"
},
{
"optionName": "Size",
"name": "M"
}
]
},
{
"sku": "color_reference_spring_dress-VARIANT-SPRINGD-L",
"inventoryPolicy": "CONTINUE",
"id": "gid://shopify/ProductVariant/51101311598902",
"file": {
"alt": "",
"id": "gid://shopify/MediaImage/43511358226742"
},
"optionValues": [
{
"optionName": "Colour",
"name": "white"
},
{
"optionName": "Size",
"name": "S"
}
]
},
{
"sku": "color_reference_spring_dress-VARIANT-SPRINGD-XL",
"inventoryPolicy": "CONTINUE",
"id": "gid://shopify/ProductVariant/51101311631670",
"file": {
"alt": "",
"id": "gid://shopify/MediaImage/43511437558070"
},
"optionValues": [
{
"optionName": "Colour",
"name": "white"
},
{
"optionName": "Size",
"name": "XL"
}
]
},
{
"sku": "color_reference_spring_dress-VARIANT-SPRINGD-XML",
"id": "gid://shopify/ProductVariant/51102004445494",
"inventoryPolicy": "CONTINUE",
"file": {
"alt": "",
"id": "gid://shopify/MediaImage/43511437558070"
},
"optionValues": [
{
"optionName": "Colour",
"name": "white"
},
{
"optionName": "Size",
"name": "XML"
}
]
},
{
"sku": "color_reference_spring_dress-VARIANT-SPRINGD-XML",
"inventoryPolicy": "CONTINUE",
"file": {
"alt": "fallback text for a video",
"contentType": "IMAGE",
"filename":"61zqyvHsHWL.jpg",
"originalSource": "https://www.guillain-barre.fr/wp-content/uploads/2024/03/sac-a-main-femme-913wcv.jpg"
},
"optionValues": [
{
"optionName": "Colour",
"name": "white"
},
{
"optionName": "Size",
"name": "XM"
}
]
},
{
"sku": "color_reference_spring_dress-VARIANT-SPRINGD-XMLM",
"inventoryPolicy": "CONTINUE",
"file": {
"alt": "fallback text for a video",
"contentType": "IMAGE",
"originalSource": "https://gandy.fr/118962-medium_default/sac-main-sierra-lancaster-vertfonce.webp"
},
"optionValues": [
{
"optionName": "Colour",
"name": "white"
},
{
"optionName": "Size",
"name": "XMM"
}
]
}
],
"productOptions": [
{
"name": "Colour",
"position": 1,
"values": [
{
"name": "white"
}
]
},
{
"name": "Size",
"position": 2,
"values": [
{
"name": "M"
},
{
"name": "S"
},
{
"name": "XL"
},
{
"name": "XML"
},
{
"name": "XM"
},
{
"name": "XMM"
}
]
}
],
"files": [
{
"alt": "",
"id": "gid://shopify/MediaImage/43511358193974"
},
{
"alt": "",
"id": "gid://shopify/MediaImage/43511358226742"
},
{
"alt": "",
"id": "gid://shopify/MediaImage/43511437558070"
},
{
"alt": "fallback text for a video",
"id":"gid://shopify/MediaImage/43511504109878"
},
{
"alt": "fallback text for a video",
"contentType": "IMAGE",
"originalSource": "https://gandy.fr/118962-medium_default/sac-main-sierra-lancaster-vertfonce.webp"
}
]
}
}
We got the error :
"userErrors": [
{
"field": [
"input",
"variants",
"4",
"file",
"originalSource"
],
"message": "File original source missing from the product files input"
}
]
Additional Notes- Uploading a new image to a new variant works fine.
- Uploading an already existing image with a new variant also functions correctly.
- Uploading an already existing image for an existing variant is successful as well.