Product Variant Append Media Graphql Mutatation transient failure

Hi!

We’re expanding our Product Integration to handle Medias attached to variants. The following scenario fails with this user error: "“Non-ready media cannot be attached to variants”

  1. Create Product (succeed)

  2. Upload Media (succeed)

  3. Attach Media to Product (succeed)

  4. Attach Product Media to Variant (fails)

I suppose the error message makes sense, however this quite troublesome, since we cannot know for sure, when the media is ready in Shopify (without heavy cost to the bucket size). Is there a reason to why the mutation cannot accept the product variant to media attachment even though the media is not yet fully ready yet in Shopify’s system? Anyone else found a neat workaround for this?

You may want to try using the REST API to do this. You’ll be able to combine your steps 2-4 into one API call to upload the image and attach it to a variant, but the downside is that you’ll need to do it one image at a time. See the example here https://shopify.dev/docs/api/admin-rest/2023-07/resources/product-image#post-products-product-id-images-examples

Hey @tnbnovicell

Are you seeing a MediaStatus of UPLOADED or READY?

There are examples of how to create products with media as well as variants with media in a single mutation in the documentation, but if you are still seeing issues with media listed as READY, can you post full examples of the steps you are taking so we can take a closer look?