Post multiple Metafields with one call into Shop

Highlighted
Excursionist
14 2 0

Hello, everybody,
I need a little help, for an app I want to keep data in the Metafields Shop, how can I create several Metafields with one post, like for example with products?

Thanks a lot

0 Likes
Highlighted
Shopify Partner
530 38 109

I see where we can query the shop metafields, like this. But not where there's any mutation to add/modify them?

{
  shop {
    id
    metafields(first: 5) {
      edges {
        node {
          id
          namespace
          key
          value
          valueType
        }
      }
    }
  }
}
0 Likes
Highlighted
Excursionist
14 2 0

Hello Greg_Quawa,
reading the metafields is no problem with this query. The question is how I can create several at once.

0 Likes
Highlighted
Shopify Partner
530 38 109

I don't see any way to create a single Metafield value in the Shop endpoint, much less a series of them. If you look at the Shopify GraphQL API documentation the Shop endpoint isn't listed as having mutations available. So, unless a Shopify staffer can comment differently, I don't think you can.

0 Likes