Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
I have a sales channel and I want to read the metafield definitions or the metafield values of product listings.
I tried to send the following GraphQl request:
{"query":"query ($owner: MetafieldOwnerType!) { metafieldDefinitions( ownerType: $owner, first:1) { edges { node { id key name description validations { name type value} type { name} } } } }","variables":{"owner":"PRODUCT"}}
that fails with a 500:
{ "errors": [ { "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 121144ea-3934-4978-ae66-9b31fb10d467-1715066226 (include this in support requests).", "extensions": { "code": "INTERNAL_SERVER_ERROR", "requestId": "121144ea-3934-4978-ae66-9b31fb10d467-1715066226" } } ] }
Doing some research I found it can be a permission issue. note that the app has the permission read_product_listings.
By querying the REST API product_listings, we do not get the meta field values
How can I get the product's metafields from my sales channel?
Thank you
I am still interested in this feature. We found a workaround to list all metafields from prodcut_listing bunt it requires a lot of API calls to Shopify.