Are Storefront Metafield Queries supported by the Mobile Buy SDK iOS/Android?

Colin_smith740
New Member
2 1 1

Hi, I'm having a little trouble getting values from metafields my StorefrontQuery. I am using building the query as shown here attempting to access reviews_count and reviews_average in the metafields. However when I attempt to access these values when the response comes back, they are nil. This is only observed in the application. When using the GraphiQL app I can see the data as expected. Are there any known issues with the SDK? WebWebResponse in AppResponse in AppQuery in appQuery in app

Reply 1 (1)
hates
Tourist
4 0 1

Hello Colin,

By default, the Storefront API can't read metafields. To expose specific metafields to the Storefront API, you need to use the GraphQL Admin API. For each metafield that you want to expose, you need to create a MetafieldStorefrontVisibility record.

metafields-51f0ff360eabec368a0fb5f7ce16f56911eb48cc1010e4a3df9850ee96e46041

Details are here: https://shopify.dev/custom-storefronts/products/metafields#expose-metafields

Best Regards