The Product.media connection already allows us to query by media_type.
However, ProductVariant.media does not have the same query, which can be surprising.
Reasoning: I believe that when the vast majority of apps fetch variant data for display in their interface, they want an image, as opposed to other types of media, like video, etc. So, it’s incredibly useful to be able to efficiently fetch the first image associated with a variant.
Getting an image for a product is a bit confusing. I think it’s due to the discrepancy between images for products without variants and images for products with variants.
Hey @flavio-b and @sshaw - thanks for raising this and sharing these examples.
This thread surfaced while I was searching for related reports about the deprecation of ProductVariant.image. I’ve acknowledged both the request for query: "media_type:IMAGE" on ProductVariant.media and the related request for a singular ProductVariant.featuredMedia field here:
I’m checking internally whether either capability can be considered for ProductVariant. I don’t have a confirmed change or timeline to share, but I’ll keep the context together in the linked thread and update it if I have anything concrete.