Re: Trying to create a metafield definition for a namespace/key after metafields already exist

Trying to create a metafield definition for a namespace/key after metafields already exist

Shopify Partner
4 0 6

I'm trying to create a metafield definition on PRODUCT owner type using GraphQL API, but there are existing metafield values for the namespace/key I'm using.


When I use metafieldDefinitionCreate, I end up with the error "Namespace and key is already in use for a set of your metafields".


I know it can be done in the Shopify Admin UI by picking "Metafields without a definition" and then adding one, but is there any way to do it with the API?



Replies 9 (9)

Shopify Partner
1 0 1

Same Problem Here,

I can't understand why it is forbidden through the API but Permitted through the Admin Dashboard.
It should have the same behavior through both channels.

Could someone from Shopify Stuff inlight us with the purpose of the different behavior?

M. Gamal

1 0 0

I'm also having this problem. I have seen there's a forceCreate option that gets passed in the admin web UI, but it doesn't accept it from GraphQL.

Shopify Partner
2 0 1


Also have the same problem with metafieldDefinitionCreate mutation in Admin GraphQL API.

Shopify Partner
38 3 8

Any update on this ?

Shopify Partner
31 1 9

Is there any update about this?

We need a solution so if there are Metafields created, be able to create Metafield Definitions on top of that anyway. Otherwise we have existing Metafields on some shops that we can't reuse and display on the UI.

Shopify Partner
1 0 0

Any update on this

Shopify Partner
2 0 0


Yes, we have the same problem here.

Shopify Partner
20 0 7

Any update? Shopify is getting painful for the dev day by day..

Shopify Partner
31 1 9

Hi everyone!

This week we retried this behavior, and looks like now it's working as expected.

So, if you have metafields with some namespace/key, you can create a Metafield Definition afterward without any issue.

I hope this behavior now works as everyone expected. 💫