Graph QL: create a new SHOP metafield

Solved
Highlighted
New Member
19 0 0

Hello guys! I'm trying to create a new metafield into the SHOP resource using GraphQP. I found this topic: https://help.shopify.com/en/api/guides/metafields/admin-api-metafields#creating-metafields, but it is creating into the product resource. 

 

I've been using the Shopify GraphiQL App to testing my GraphQL codes and learning more about it reading the documentation. Unfortunately, I can't find anything related to my doubt. 

 

In general, I'm trying to save some customized data through the private app and I'll use this data globally in my StoreFront.

 

Thank you! ;) 

0 Likes
Highlighted
Excursionist
33 4 4

This is an accepted solution.

As I understand it there is currently no GraphQL support for creating shop metafields, only on products. To make a store metafield you would need to utilize the API, documentation here https://help.shopify.com/en/api/reference/metafield#create-2019-10, and POST. Making storefront accessible metafields is a different beast with the documentation available here https://help.shopify.com/en/api/guides/metafields/storefront-api-metafields.

You are phoenix
3 Likes
Highlighted
New Member
19 0 0

Yes! As I imagined... Thank you so much! 

0 Likes
Highlighted
Shopify Partner
48 1 13

(Today still no GraphQL mutation for Shop metafields - August 2020. Use POST /admin/api/2020-07/metafields.json as detailed in https://shopify.dev/docs/admin-api/rest/reference/metafield).

Just trying to help out.

We are web app developers, SEO ethousiasts, and do all kinds of other cool internet things.
Check us out at https://public-apps.com
0 Likes
Highlighted
New Member
1 0 0

When do you think mutations for Shop metafields will be available for GraphQL?

0 Likes