Query list of metafields without a definition

Shopify Partner
154 2 46

Is it possible to query a list of all metafields that don't have a definition with the API?

Replies 4 (4)

Shopify Staff
14 2 10

We do not expose this in the API directly but if you are using graphql unstable, the Metafield node returned by the metafields connection does have a nullable definition field. If you are able to share, what is your use case for getting metafields without definitions?

To learn more visit the Shopify Help Center or the Community Blog.

Shopify Partner
9 1 6

So whats the situation with this one guys. Currently when we navigate to the Settings -> Metafields. If for some reason we have a bugged metafield how can we use grapqhl or rest api to delete those & how do we get the whole metafield list so we can create scripts or apps that will delete those we do not need. We cannot delete the metafields guys until definition is made. This is really bad. Please advise. This metafield functionality seems seriously broken. Where is the pagination why cant we see whole list of metafields without definitions paginated and etc. Expecting a fast answer here metafield documentation get request returns only store metafields and product ones which definition is made and those fully work. I need a list of all the metafields without definition and delete endpoint.

Shopify Expert
4850 60 557

For some time, an API key can only see Metafields it made. So if you wanted to know which Metafields you made with that API key, that are without definition, that makes some sense. But it makes no sense to ask for all the Metafields that have no definition, as that could contain many that were not made with your API key, hence off limits.

If you have a buggy Metafield in Settings, that is on Shopify, not some miracle you work with an API key. But it is true, Shopify is now expecting us to clean-up the mess made by introducing the new Metafields, without the ability to do that, save for working with the Metafields we made with our API keys. I can see this being a problem as there are a slew of old Metafield Apps that have yet to modernize, and may never modernize to this. So for merchants needing a quick fix, it is hard to do!

Unintended consequences!

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Shopify Partner
9 1 6

@HunkyBill ofc we need only metafields with no definition for the api key / oauth of private app, etc for our own store only. It's not gonna be in thousands it's gonna be what is defined if correctly exposed by shopify team. What if POS solution accidentally added a bugged metafield. Outside providers should not be the ones to keep track of Shopify's best practices or bugs. This is a big issue now for our Shopify plus client i don't know how we will resolve except recreating the store, reimporting everything specifying to the POS to exclude Metafields and buying a third party plugin for metafields again or create them in our own app.

We need a mechanism which will allow us for our own stores to get the metafields that do not have the definition from their new functionality and a mechanism grapqhl, rest endpoint to manage those so we can do crud on them. This is beyond inconvenience this is pure negligence of Shopify team. Shopify is a multibillion company. For company like that to allow themselves to produce such a half working solution and letting it out is super super irresponsible. I would rather announce the feature and when its ready or at least minimum requirements are ready like pagination, multiple pages, search; then and only then would i release it. Someone has to be responsible for this and accountable and it needs to be fixed or improved asap. Good thing we caught this in the early stages of our projects so we can work around it but.....

Additionally where is the conditioning where is filtering. Like why do all the products need to have mpty multifields with definition in the admin ui of products confusing the clients. Where are the multifield groups or creating a mechanism to apply certain metafields to certain products who is developing this feature? Do you guys from Shopify know basics of ecommerce features?

@HunkyBill this is not unintended consequence this is bad feature architecture that went wrong and due to marketing they tossed it out just to follow through what they promised.