Query metaobject by field in UI extension

Query metaobject by field in UI extension

AH63935
Shopify Partner
24 1 24

How can I query metaobjects (filtering by field) in Storefront API in checkout UI extensions? I hvae a metaobject with 200 entries, but I only want to get the ones with the charge code of "10". Or how would I use graphQL query in the UI extension? 

Reply 1 (1)

Liam
Community Manager
3108 340 871
Hi
 
Checkout UI Extensions all receive as part of their standard API the query method, so it should be possible to query metaobjects in checkout UI extensions using the storefront API.
query
The method used to query the Storefront GraphQL API with a prefetched token.
Refer to Storefront API access examples for more information.

 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog