with the productSet mutation not able to update existing image on existing varinat

below are the query and variables that are being used.
Use case: Varinats on this product already have an image trying to update the image with the below mutation.
There are no errors in the response but the variant level image is not updated with the latest value instead they are being removed. The product-level image is properly updated.
If we send the same request again without any changes, variants are updated with the latest images

mutation createEntireProduct($input: ProductSetInput!, $synchronous: Boolean!) {
    productSet(synchronous: $synchronous, input: $input) {
        product {
            id
            title
            description
            options(first: 5) {
                name
                position
                optionValues {
                    name
                }
            }
            variants(first: 5) {
                nodes {
                    id
                    price
                    compareAtPrice
                    selectedOptions {
                        name
                        optionValue {
                            id
                            name
                        }
                    }
                    taxable
                    taxCode
                    barcode
                    inventoryPolicy
                    metafields(first: 5) {
                        nodes {
                            key
                            value
                            type
                            namespace
                        }
                    }
                }
            }
        }
        userErrors {
            field
            message
        }
    }
}
{
    
    "synchronous": true,
    "input": {
      "title": "image-test-matrix22",
      "id": "gid://shopify/Product/8894817075501",
      "variants": [
        {
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix22-B-M",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Blue",
              "optionName": "color"
            },
            {
              "name": "Medium",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312528441645",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-Bl-M",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Black",
              "optionName": "color"
            },
            {
              "name": "Medium",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312528474413",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-G-M",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Green",
              "optionName": "color"
            },
            {
              "name": "Medium",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312559866157",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-Bl-S",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Black",
              "optionName": "color"
            },
            {
              "name": "Small",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312559898925",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-Bl-L",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Black",
              "optionName": "color"
            },
            {
              "name": "Large",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312559800621",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-B-S",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Blue",
              "optionName": "color"
            },
            {
              "name": "Small",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312559833389",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-B-L",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Blue",
              "optionName": "color"
            },
            {
              "name": "Large",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312559931693",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-G-S",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Green",
              "optionName": "color"
            },
            {
              "name": "Small",
              "optionName": "size"
            }
          ]
        },
        {
          "id": "gid://shopify/ProductVariant/47312559964461",
          "barcode": "image-test-matrix",
          "price": 90,
          "sku": "image-test-matrix21-G-L",
          "inventoryPolicy": "DENY",
          "file": {
            "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
            "contentType": "IMAGE"
          },
          "optionValues": [
            {
              "name": "Green",
              "optionName": "color"
            },
            {
              "name": "Large",
              "optionName": "size"
            }
          ]
        }
      ],
      "productOptions": [
        {
          "name": "color",
          "values": [
            {
              "name": "Blue"
            },
            {
              "name": "Black"
            },
            {
              "name": "Green"
            }
          ],
          "position": 1
        },
        {
          "name": "size",
          "values": [
            {
              "name": "Medium"
            },
            {
              "name": "Small"
            },
            {
              "name": "Large"
            }
          ],
          "position": 1
        }
      ],
      "files": [
        {
          "originalSource": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg",
          "contentType": "IMAGE"
        }
      ]
    }
}
2 Likes