Hey @Jentsch and @aliaz_1 ! Thanks for posting these questions and for your solutions @aliaz_1 .
Just looking here, I can see that you’re using the 2024-04 API version. As of that version, our product model has changed. If you haven’t reviewed this already, I highly recommend it https://shopify.dev/docs/api/admin/migrate/new-product-model
We also have a dedicated board here for questions specific to the new product API to help developers with the transition https://community.shopify.com/c/new-graphql-product-apis/bd-p/new-graphql-product-apis
To the topic at hand, the new productVariantsBulkUpdate should work for your task.
Here’s an example of a working mutation, of uploading a new image from URL to the product and appending it to the variant within a single request.
mutation ProductVariantsBulkUpdate {> productVariantsBulkUpdate(> variants: {> id: “gid://shopify/ProductVariant/47363597074454”> mediaSrc: “https://images.images.jpeg”> }> productId: “gid://shopify/Product/8015282962454”> allowPartialUpdates: true> media: {> originalSource: “https://images.images.jpeg”> mediaContentType: IMAGE> }> ) {> product {> id> }> productVariants {> media(first: 10) {> nodes {> id> … on MediaImage {> alt> createdAt> fileStatus> id> mediaContentType> mimeType> status> updatedAt> fileErrors {> code> details> message> }> }> }> }> }> }> }
Let me know if that helps! I’m happy to dig in further here to find other ways to make this work and to pass feedback on to our product teams.
- Kyle G.