I’m building an app feature that requires app-owned metaobjects linked to products via a list.metaobject_reference metafield. Both are declared in shopify.app.toml with access.storefront = "public_read".
Setup:
[metaobjects.app.my_custom_type]
name = "My Custom Type"
access.storefront = "public_read"
[product.metafields.app.my_reference]
name = "My Reference"
type = "list.metaobject_reference<$app:my_custom_type>"
access.storefront = "public_read"
Our app can read the data fine via Storefront API using our own storefront access token — the metafield value and referenced metaobject entries resolve correctly.
Our requirement: Our architecture depends on third-party apps and partners being able to access these app-owned metafields and metaobjects via the Storefront API. The public_read access setting implies this should be possible, and we’ve confirmed it works using the resolved namespace.
The problem: When a third-party app or partner queries the same product via the Storefront API using their own storefront access token, the metafield references come back as null:
{
"data": {
"product": {
"metafield": {
"references": null
}
}
}
}
What worked: When third-party apps and partners query our metafields using the $app namespace, the references return null. However, when they use the resolved namespace app–<APP_ID>, both the metafield value and the referenced metaobject entries resolve correctly.
query {
product(id: "gid://shopify/Product/<<PRODUCT_ID>>") {
customBadge: metafield(namespace: "app-<<APP_ID>>", key: "custom_badge") {
namespace
key
type
value
}
}
}
Our question: Before we commit to this architecture, we want to confirm—is using the resolved namespace app–<APP_ID> the expected and supported approach for third-party apps and partners to access app-owned metafields and metaobject references via the Storefront API? Can this be relied on as a stable pattern going forward?
Since the changelog says otherwise.
https://shopify.dev/changelog/public-access-for-app-owned-metafields-and-metaobjects-is-now-disabled
We are still able to create app owned metaobject/metafield definitions through TOML and the GraphQL admin API with PUBLIC_READ storefront access.
Could someone help me with this.