How to access metafield in namespace with reserved prefix in Liquid?

Topic summary

A developer is struggling to access a Shopify metafield with a reserved namespace prefix ($app:product_options) in Liquid within a theme app extension. The metafield is of type list.metaobject_reference.

Attempted Solutions:

  • Using various syntax forms: product['$app:product_options'].product_options.value
  • Expanding the namespace to app--<app_id>--namespace format
  • Setting both metafield and metaobject access controls to PUBLIC_READ and MERCHANT_READ
  • Accessing metaobjects directly from shop.metaobjects (works) vs. through product.metafields (doesn’t work)

Key Findings:

  • Other users confirm app-namespaced metafields work with MERCHANT_READ access using expanded namespace syntax
  • Cached values may take up to 90 minutes to become visible after configuration changes
  • When the developer removes the reserved prefix from the namespace, access works normally, suggesting the issue is specific to reserved prefixes
  • The MetafieldAccess API for access control is now stable (previously unstable)

Status: Unresolved. The specific combination of reserved namespace prefix and metaobject reference list type appears problematic, though standard app-namespaced metafields work for others.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

You can now use access control on Metafield definitions.

You can make the metafield’s storefront access as “PUBLIC_READ”. You can then access it in theme app extensions by expanding the namespace to - app--<app_id>

However, this is only available in the unstable version of Graphql API.

https://shopify.dev/docs/api/admin-graphql/unstable/objects/MetafieldAccess

2 Likes