Admin-graphql - Create private metafield on shopify

How do I create a private metafield on Shopify using Admin-graphql? In their docs, they have given example for retrieving a private metafield by its ID(ref: https://shopify.dev/api/admin-graphql/2022-01/queries/privateMetafield#section-examples), do you have any example for creating private metafield using Node.js?

Hello Minahil_malik,

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.