Order Metafields with Graphql Admin API

It looks like we can’t access the order metafields using the Graphql Admin API. It seems weird since we do have access to the draft order metafields. Can we add the capability of querying and mutating order metafields?

Thanks

1 Like

Hello,

It works like this:

{
  orders(first: 10) {
    edges {
      cursor
      node {
        legacyResourceId
        name
        metafields(first: 10) {
          edges {
            node {
              namespace
              value
              key
            }
          }
        }
      }
    }
    pageInfo {
      hasNextPage
    }
  }
}

Hi, I’m interested in using metafields on orders as well but while orders support them and those can be retrieved via the Graphql admin api, I can’t find anyway to update an order to add them in the first place via the Graphql admin api. Metafields don’t exist as input properties on the OrderUpdate mutation (https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/orderupdate#input-fields) and there is no MetafieldCreate mutation available either.

Am I missing something?