Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How do I update metafield on product via GraphQL API?

Solved

How do I update metafield on product via GraphQL API?

Louise_Elmose_H
Shopify Partner
78 2 21

Hi,

How are you supposed to update a metafield on a product via the GraphQL API?
There's only a mutation for deleting a metafield, not for creating.
If I delete the metafield and do a product update afterwards with the metafield, the metafield is not created.


Thanks,

-Louise

Accepted Solution (1)

Louise_Elmose_H
Shopify Partner
78 2 21

This is an accepted solution.

Never mind, rookie mistake, forgot to check userErrors on the productUpdate mutation - DO'H!

View solution in original post

Reply 1 (1)

Louise_Elmose_H
Shopify Partner
78 2 21

This is an accepted solution.

Never mind, rookie mistake, forgot to check userErrors on the productUpdate mutation - DO'H!