I have a GraphQL query that returns a variant’s metafields.
{
productVariant(id: "gid://shopify/ProductVariant/123456789") {
title
metafields(namespace: "custom", first: 10) {
nodes {
id
key
type
value
}
}
}
}
This works fine, but it will only return metafields that contain values. I am new to GraphQL but I understand this may be because the fields are nullable.
I need to find the ids of all the metafields on a given variant - How can I achieve this?