gatsbyjs/gatsby-source-shopify

Exclude variant images on the main images

Closed this issue · 10 comments

Hi is there a way that all variant images will be excluded on the images array? (edges -> node -> images)
In my design, my thumbnail images is from (edges -> node -> images) and the problem is it includes my variant color images which is not what we wanted. I only want my variant color images shows on my variant color sections.

image

I think Shopify's admin API is for some reason returning these images where it otherwise wouldn't for the Storefront API. I'll have to see if I can find out why, and what we can possibly do about it. Thanks for reporting!

@sslotsky thanks hope you can find possible ways. I had read some similar cases like this but in shopify theme, they use to filter out using the variant images attributes I think maybe we can also get those images that has attributes equal to variants?

As far as I can tell there is no filter like this for the admin API on the product.images connection. https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/product

In fact I don't see a filter like that in the Storefront API either.

@sslotsky so sad :(. do you have an idea for an alternative remedy?

I'll be doing some testing early this week to make sure I have a case to report, and then I'll inquire with Shopify about it. But there's one thing that puzzles me. In my last reply I said,

In fact I don't see a filter like that in the Storefront API either.

And so I'd like to make sure that I understand what happens for you when you're using the Storefront API instead. By any chance are you able to get a list of images that you receive for a product from the Storefront API, and a second list of images that you receive for the same product when using this plugin?

@sslotsky thank you for your response. sorry for late response I didnt notice the notifcation and I lost hope. but when I see your reply it seems there is a chance to solve my problem.

for question 1) I didnt tried to used directly the storefront api. I only used the experimental plugin. is there a guide to use it?
for question 2) the images I receive when querying images using this plugin from (edges -> node -> images) is the media images + the variants images.

I didnt tried to used directly the storefront api. I only used the experimental plugin.

Maybe I misunderstood. I thought your expectations came from what you were seeing previously with the existing gatsby-source-shopify plugin, which uses the Storefront API to get all this data. I'll have to just run some of my own tests and see what I find.

@sslotsky okay. I believe this plugin will revolutionize the eCommerce site. The only reasons it won't really convinced the people to transition in headless eCommerce is because of some limitations. but i believed this plugin are so close to achieve the possibilities of traditional eCommerce.

Closing this issue for now! Feel free to comment/reopen if you're still having trouble with variant images.

Hi @jacksellwood this has not been resolve x.x