I have created a product and assign a color in the category metadata on the Admin UI. I am trying to retrieve that information using GraphQL.
Query in the form:
query {
product(id: “gid://shopify/Product/9839925821731”)
{
metafields(first:1) { nodes {id ownerType value key type
definition {name metafields(first:2) {nodes {id namespace value }}}} }
category{ fullName }}}
This returns
{
“data”: { “product”: { “metafields”: { “nodes”: [
{ “id”: “gid://shopify/Metafield/40439661953315”, “ownerType”: “PRODUCT”, “value”: “["gid://shopify/Metaobject/74067444003"]”,
“key”: “color-pattern”, “type”: “list.metaobject_reference”,
“definition”: {
“name”: “Color”,
“metafields”: {
“nodes”: [
{
“id”: “gid://shopify/Metafield/40331134435619”,
“namespace”: “shopify”,
“value”: “["gid://shopify/Metaobject/74067444003"]”
},
{
“id”: “gid://shopify/Metafield/40331219960099”,
“namespace”: “shopify”,
“value”: “["gid://shopify/Metaobject/124484387107"]”
}]}}}]},
“category”: {
“fullName”: “Business & Industrial > Signage > Digital Signs”
}}},
But I cannot find a way to associate a label with the value returned?
Please let me know what I am missing.