client.product.fetch(variant.shopifyId) not returning product info - Shopfiy Buy SDK

joshua-isaac
Tourist
7 0 1

Hello all,

I am trying to build a Gatsby + Shopify site and I'm using the shopify buy sdk. My goal is to dynamically fetch the product to make sure it's available for checkout. I have my shopify-buy client configured.

I have a function:

 

  const fetchProduct = async () => {
   // in this case, variant.shopifyId = Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8zODA1ODQ1NjA4ODczNg==
    const product = await client.product.fetch(variant.shopifyId)
    console.log(product)
  }

 

However when I log `product`, I don't seem to get the actual product data, i get a GraphModel with the following: 

Screen Shot 2021-02-24 at 9.20.36 PM.png

I'm not too sure what I'm doing wrong here so any help would be greatly appreciated  

Thanks!

0 Likes