How to create privateMetafield in admin graphql

Solved
kiranupadhyak
New Member
4 0 0

You have given example for retrieving a private metafield by its ID in https://shopify.dev/api/admin-graphql/2022-01/queries/privateMetafield#section-examples. What should I need to pass for data to create privateMetafield?Can you please give an example for this(using Node.js)?

Accepted Solution (1)

Accepted Solutions
lastiri
Shopify Staff
Shopify Staff
5 3 2

This is an accepted solution.

Hello Kiranupadhyak,

 

You can find examples to create a private metafield on the privateMetafieldUpsert mutation.

If you are looking particularly for Node.js, you can find these on the right hand side Javascript tab.

 

The input fields for the privateMetafieldUpsert mutation can be found on the PrivateMetafieldInput entity.

 

Once you create the private metafield you'll be able to access it with the examples you provided.

 

 

Rafa L | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Reply 1 (1)
lastiri
Shopify Staff
Shopify Staff
5 3 2

This is an accepted solution.

Hello Kiranupadhyak,

 

You can find examples to create a private metafield on the privateMetafieldUpsert mutation.

If you are looking particularly for Node.js, you can find these on the right hand side Javascript tab.

 

The input fields for the privateMetafieldUpsert mutation can be found on the PrivateMetafieldInput entity.

 

Once you create the private metafield you'll be able to access it with the examples you provided.

 

 

Rafa L | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog