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!