Is it possible to create an image for a variant by using imageSrc in productVariantsBulkUpdate?

Hello,

I’m trying to create an image for a variant by using the “imageSrc” field in the productVariantsBulkUpdate mutation. But for some reason, it is returning a null value for the image object. It works perfectly fine with other mutations like productVariantCreate and productCreate.

Hi @pranavambre :waving_hand:

The ProductVariantsBulkInput. imageSrc field can only be used through mutations that create product images and must match one of the URLs being created on the product. I’d recommend checking your image URL already belongs to the product before inputting it in the productVariantsBulkUpdate mutation. We can use the below product query to verify that the URL exists in the product media image list:

query ($id: ID!){
    product(id: $id) {
        media (first:100){
            nodes {
                ... on MediaImage {
                    id
                }
            }
        }
    }
}

Hope that helps!