Is there a reason that media
(videos) isn't included in the gatsby-source-shopify products query?
#32832
Replies: 2 comments
-
@belugamatt I am working on a fork right now that accomplishes this. The problem that I am currently facing is that the media object from the Shopify GraphQL API is a union type. Because of the way that the plugin processes data, each of the possible media union types (ShopifyExternalVideo, ShopifyMediaImage, ShopifyModel3D, ShopifyVideo) become their own nodes. I have solved the issue of getting the media nodes into the product.media field, but the problem is currently they do not respect the order defined in Shopify. They go in order of external video, media image, model 3d, video. This is a problem and will require a fair bit of code rewriting to get the functionality. Any help would be appreciated as this is my first time contributing to Gatsby and it is a fairly large task. |
Beta Was this translation helpful? Give feedback.
-
Hi there, we're currently testing the next major version of gatsby-source-shopify. This may address your issue. Learn more about upgrading: https://www.notion.so/gatsbyjs/Instructions-for-upgrading-to-Shopify-7-e5cb1068b35b4de7ba7e9ffb160aad26 |
Beta Was this translation helpful? Give feedback.
-
Is there a reason that
media
isn't included in the products query?I found a post from January where someone asked the same question, but it unfortunately got no attention. He created a patch to get make
media
available, but it's outdated now, and all my attempts leave me withmedia
still missing from the Gatsby GraphQL explorer.The
media
item is important to me because of product videos. In Shopify, it's possible to add videos as product media, alongside images. Using the Shopify GraphQL App I can query for media Shopify-side and see the all the data I need on these product videos, but through gatsby-source-shopify it's not possible. I can accessfeaturedMedia
, but even there I'm only allowed to get the preview image and not the video url itself.Originally posted by @rub1e in #29030
Beta Was this translation helpful? Give feedback.
All reactions