Bug on updating metafields?

Shopify Partner
78 2 21


I use the graphql productUpdate mutation to update a product as well as the product variants and metafields.

In general this works as expected, I can update metafield values as I want to. But I run into problems when I want to reset a metafield, i.e. when I set the metafield value to null.

If a metafield value before was e.g. "Apple" and I want to set it to null, nothing happens, the value is still "Apple". If I try to set it to '' or ' ' it does not work either. '-' works, but it is not a pretty solution.

I also tried not including the metafield in the metafield list, but the value of the metafield is still "Apple". 

So to me it seems to be a bug? 



Reply 1 (1)

Shopify Staff (Retired)
27 3 5

Hi Louise!

To delete a metafield you need to use a different mutation called metafieldDelete:


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