Retrieve Metafield ID of a product variant

Retrieve Metafield ID of a product variant

Rachid_98
Shopify Partner
12 1 0

I'm trying to retrieve the ID of a metafield of a product variant so I can use later to update the metafield of that product variant, however I haven't been able to see the result.

Here is my attempt: 

 

 

const myQuery = await client.query({
        data: `query 
        {
          product(id: "gid://shopify/Product/8547626647858") {
            variants(first: 15) 
            {
              edges 
              {
                node {
                  id
                  sku
                }
              }
            }
          }
        }`,
      });
      console.log("Hello: "+myQuery.response.data);

 

 

How can I log the ID because currently the response returns undefined!

Replies 0 (0)