Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hey all, as you may know, we can access metafield data through a quick query like this:
https://{{yourStore}}.myshopify.com/admin/products/{{prodId}}/metafields/{{metafieldId}}.json
In the case where a metafield is a reference to a metaobject it will return the following JSON:
{"metafield":{"id":XXXXX,"namespace":"custom","key":"ring_info","value":"gid:\/\/shopify\/Metaobject\/2593325140","value_type":"string","description":null,"owner_id":xxxxxx,"created_at":"2023-04-24T11:48:30-04:00","updated_at":"2023-04-24T11:48:30-04:00","owner_resource":"product","type":"metaobject_reference","admin_graphql_api_id":"gid:\/\/shopify\/Metafield\/20172247859284"}}
However, I don't know what endpoint to use to get the values for the specific metaobject.
I've seen some stuff about this using graphql, which I'm willing to try, but it's not intuitive IMO.
This is for a custom javascript action in Zapier. Many thanks!
Apparently there is no metaobjects rest api endpoint (I've searched long and hard for it).
You are going to have to use graphql for this one.
Cheers,
Gary
I wish Shopify would enable access to the Meta Objects via the Ajax API, or the REST Admin API, If you fetch product with either of these meta data is not available. Its incredibly hard to make use of the meta fields and objects.
Currently having to fetch the product with ajax api to get the id, fetch a server side route with the id which performs a fetch to the Rest metafield endpoint which returns a meta object id, now it appears we will have to fetch the meta object from the graphql api, before getting the simple piece of data we need, a case count to modify the order with.