Ensure gatsby-source-shopify correctly deletes products #36164
Unanswered
KyleAMathews
asked this question in
Ideas / Feature Requests
Replies: 1 comment 2 replies
-
+1 I'm finding this to be the case for changing a product status as well (i.e. from 'Active' to 'Draft') which is not triggering a build, and in subsequent unrelated builds, the cache still appears to have that product. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I debugged a Gatsby Cloud customer site using Shopify that reported that removing products from the Sales Channel they're using for the site didn't result in the product being removed from the site unless they cleared cache and did a full build.
Investigating this, I found that there was no update from Shopify when a product had its Sales Channel changed. The reason being that gatsby-source-shopify only queries for updates to products in a specific sales channel. When a product is removed from that channel, we no longer get updates about it.
We do handle actual deleted products fine as Shopify has an API for that but we're not setup to get updates about a product's sales channel being removed.
Talking to @byronlanehill, the solution would be to query all Sales Channels in Shopify so we still get updates when a product's sales channels is updated.
This would mean potentially querying more products and then filtering out products without the right Sales Channel set.
This would mostly a non-breaking change as the end result would be the same. It could potentially create pain if a store has lots of products that aren't in the sales channel that the Gatsby site is using as currently those wouldn't be fetched and with this proposed change they would be. A way to help them keep the status quo is to let them opt back into the current behavior & make it very clear that they'll need to clear the cache when they remove the product from the Gatsby sales channel.
I'm not sure how many sites have lots of unused products — in case we think there is a significant number, than this would need to be a breaking change.
Beta Was this translation helpful? Give feedback.
All reactions