Contentful logo

Contentful Community

Shopify + Contentful (with new app)

I am working on a Gatsby e-commerce app using Shopify with Contentful.
Just recently with the updates to the Contentful Marketplace, the Shopify UI Extension was deprecated in favor of the Shopify App. This new app only returns the product ID from Shopify now, where the old extension gave an object instead with more fields like the price, title etc. that enabled me to get this data on buildtime.

Now I am thinking of using gatsby-source-shopify and then inserting the product data I get from there into the contentful schema using the ID I get from contentful.

Another option might be to create a new app based on the new shopify app that returns more fields.

Was wondering if anyone has experience with either of these options and is able to give me some tips, examples or resources on how to go about doing this.

Kind regards,

Guy

Hey Guy! Indeed, the new Shopify app only returns the ID of the product you select. We have carefully decided for this option in order to prevent users from duplicating product data across Shopify and Contentful which would eventually go out of sync. As you are working with Gatsby, we do recommend you to fetch the product info at build time.

For this, check out the documentation of Gatsby’s node APIs, especially onCreateNode and the tutorial about transforming nodes.