How to call admin rest api and graphql to get and post metafields?

Topic summary

Getting and posting Shopify metafields via the Admin REST API or GraphQL in a Node environment was the main issue.

Current guidance provided:

  • Use a Node library for Shopify API access, which can handle the Metafields resource through the Admin API.
  • For GraphQL, the recommended references are the Metafield API documentation and a tutorial showing how to manage metafields with the GraphQL Admin API.
  • For REST, the Metafield endpoint documentation was shared as the primary reference.

Key technical context:

  • Metafields are custom data fields attached to Shopify resources.
  • GraphQL is Shopify’s query language-based API, while REST uses resource-based HTTP endpoints.

Outcome:

  • No code example was posted directly in the discussion.
  • The thread received a documentation-based answer rather than a full implementation walkthrough, so the question is only partially resolved and may still need concrete Node examples.
Summarized with AI on March 7. AI used: gpt-5.4.

Hello,

How can we use the rest api and graph ql to get and post metafields. We are using node. Can any one share some examples?

Thanks!

Hey @opencartcity

There’s a Node Library here available that would allow you to access the Metafields resource on Shopify’s Admin API.

You might like to check out the GraphQL Metafield documentation here. Additionally there’s a great run through regarding the GraphQL Metafields here.

The REST API documentation for Metafields is here. Hope that helps!