[Seeking graphql assistance] Adding new product image when creating variant

[Seeking graphql assistance] Adding new product image when creating variant

dwight9339
Shopify Partner
3 0 0

Having no previous experience with graphql, I'm a bit confused by this description given for the ProductVariantInput.imageSrc attribute in the docs:

The URL of an image to associate with the variant. This 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 like to add the ability to upload an image for a new product variant from a variant creation form and this description seems to imply that I can add a new image to the product and associate it with the new variant at the same time but I'm unsure how to write such a query. Thanks in advance.

Reply 1 (1)

dwight9339
Shopify Partner
3 0 0

After doing some more research I realized that the imageSrc attribute can only be assigned when adding both new variants and new images to a product during a product creation or update operation.