Graph QL: create a new SHOP metafield

Solved

Graph QL: create a new SHOP metafield

gfagnani
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! 😉 

Accepted Solution (1)

jenn11
Excursionist
33 4 6

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

View solution in original post

Replies 4 (4)

jenn11
Excursionist
33 4 6

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
gfagnani
New Member
19 0 0

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

PublicApps
Shopify Partner
146 5 35

(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).

Public Apps | Theme customization & App development
 - Was my reply useful? Like it to let me know!
 - Did I answer your question? Please mark as Accepted Solution.
 - Need more help? Contact us.

wernerd
Visitor
1 0 0

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