Hello, I encounter a very strange case. Please help to check it.
I tried to get a specific metafield for customer & product using namespace & key:
query {
customer(id: "gid://shopify/Customer/7283356106") {
metafield(namespace: "test", key: "hello") {
value
}
}
}
query {
product(id: "gid://shopify/Product/3667578847316") {
id
metafield (namespace: "test", key: "test_key") {
value
}
}
}
Both of them return result successfully, but when I try it for collection
query {
collection(id: "gid://shopify/Collection/135688257620") {
id
metafields(first:10){
edges{
node{
id
namespace
key
value
}
}
}
metafield (namespace: "test", key: "hello") {
value
}
}
}
It failed to return the metafield value (as shown below, it is null). But I can see the records under metafields:
{
"data": {
"collection": {
"id": "gid://shopify/Collection/135688257620",
"metafields": {
"edges": [
{
"node": {
"id": "gid://shopify/Metafield/8257558773844",
"namespace": "test",
"key": "hello",
"value": "sdasd"
}
}
]
},
"metafield": null
}
},
"extensions": {
"cost": {
"requestedQueryCost": 14,
"actualQueryCost": 5,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 995,
"restoreRate": 50
}
}
}
}
I think it is a bug for collection, which I cant use namespace & key to find the metafield…