A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
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 👋
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!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog