I've got a Gatsby site with Contentful as CMS and Shopify as Ecommerce. I'm trying to accomplish automatically creating a buy button, but the Shopify id that's provided in the Graphql is different from the id that Shopify uses in its button creation. At least, that's what I can discern. For instance, when getting the product id from Graphql:
It also provides an id for the div, which I assume helps with verifying the correct product.
I just don't see how to get it all to relate and automatically create buy buttons. Individually creating them for 1000+ products isn't realistic. Is there a way to call the Buy link and provide it the Graphql id?
Is there perhaps a better way to go about this? I want the cart to open and other functionality there, and I'm trying to save a little time in implementation, so that's why I thought just automatically creating Buy Buttons would be viable. But is it?