I am trying to get the value of a custom metafield through the storefront API. The metafield will return ‘null’ unless I use the Admin API in which case it responds correctly.
I have made sure the storefront access option for the metafield definition is on ‘Read’.
Is this an intended response?
{
shop {
name
}
products(first: 10) {
edges {
node {
title
metafield(key: "custom.sold_count") {
value
}
}
}
}
}
# Response
{
"data": {
"shop": {
"name": "Shop name"
},
"products": {
"edges": [
{
"node": {
"title": "Product name",
"metafield": null
}
}
]
}
}
}