Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
I have an issue with querying metaobjects. I have objects with key collection referencing a collection and name just being text.
The query:
query { metaobjects(type: "brands", first: 10){ nodes { id type collection: field(key: "collection") { value type reference { __typename ... on Collection { title } } } name: field(key: "name") { value type } } } }
The response:
{
"data": {
"metaobjects": {
"nodes": [
{
"id": "gid://shopify/Metaobject/4041507108",
"type": "brands",
"collection": {
"value": "gid://shopify/Collection/450838626596",
"type": "collection_reference",
"reference": null
},
"name": {
"value": "iUNIK",
"type": "single_line_text_field"
}
},
{
"id": "gid://shopify/Metaobject/4041965860",
"type": "brands",
"collection": {
"value": "gid://shopify/Collection/450838069540",
"type": "collection_reference",
"reference": null
},
"name": {
"value": "Beauty of Joseon",
"type": "single_line_text_field"
}
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 42,
"actualQueryCost": 9,
"throttleStatus": {
"maximumAvailable": 1000.0,
"currentlyAvailable": 991,
"restoreRate": 50.0
}
}
}
}
As you can see the reference does not resolve. What am I doing wrong?
Bump...