Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
}
}
]
}
}
}
Hi there!
I’m facing the same issue here. I already have a bunch of old fields working correctly when querying from the Storefront API, but new fields are only returning from the Admin API. I’m still using ACF Metafields, but like I said, the fields created previously are working fine.
I’ll keep investigating, and if I find anything, I’ll post it here.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025