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

jne
Shopify Partner
3 0 5

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 8 (8)
M-Gamal
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
SterlingHirsh
Visitor
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.

Vlad_BWT
Shopify Partner
2 0 1

Hello!

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

dgtlmonk
Shopify Partner
38 3 7

Any update on this ?

CharlyTalavera
Shopify Partner
24 0 8

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.

murphy-anker
Shopify Partner
1 0 0

Any update on this

BCSE
Shopify Partner
2 0 0

Hi,

Yes, we have the same problem here.

PlusApps
Shopify Partner
20 0 7

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