Hi,
We are trying to get all metafields keys for the type PRODUCT.
There is GraphQL query for metafields with definitions:
query metafieldDefinitions {
metafieldDefinitions(first: 200, ownerType: PRODUCT, sortKey: NAME) {
edges {
node {
id
namespace
key
name
}
}
}
}
How can we retrieve the remaining metafield keys that have no definition without querying all products on the store?
Thanks for any help.
Not supported and likely never will be. Why are you trying to see dynamically pull all unstructured metafields?
Our export app supports the export of metafields.
The metafield keys are necessary to provide a selection of available metafields.
Thanks for the details! I’d encourage a focus on structured metafields instead.
We’ll think about export specifically, but wide grabs are not something we generally prioritize. Further, for unstructured there is no global meaning we can offer here b/c of the nature of them. They’re fundamentally instance-specific (e.g., product1.metafields.foo.bar => "hello, world", whereas product2.metafields.foo.bar => 42, and of course product3.metafields.foo.bar could exist but be empty, while on product4.metafields.foo.bar is invalid because it does not exist).