Array value for GraphQL "productUpdate" request doesn't work

I want to automate the Product MetaField update.

  • I have a Product meta field definition which is “Single line text (List)”
  • I have some values added

My request for two provided values passes perfectly, but I don’t see changes on Shopify Product.

I was following documentation: https://shopify.dev/docs/apps/custom-data/metafields/manage-metafields

Step 3: Update a meta field; the example was with STRING only.

The first question is - Does this endpoint support arrays?

Second question - Even if the string is provided exactly as in the example (single value) - it passes, but also no changes are visible on the product. Is it possible to update the meta field which is “Single line text (List)” with this method?

mutation {
  productUpdate(
  input : {
    id: "gid://shopify/Product/xxxxxxxx",
    metafields: [
      {
        id: "gid://shopify/Metafield/xxxxxxxxxx",
        value: "[\"Rich\", \"Tan\"]"
      }
    ]
  }) {
    product {
      metafields(first: 99) {
        edges {
          node {
            namespace
            key
            value
          }
        }
      }
    }
  }
}

For future generations - In case someone will face the problem.

This one worked for me https://shopify.dev/docs/api/admin-rest/2024-04/resources/metafield#put-blogs-blog-id-metafields-metafield-id

Requesting: https://{{shopID}}.myshopify.com/admin/api/2024-04/products/{{productID}}/metafields/{{metafieldID}}.json

P.S. Metafield ID taken simply for Metafield URL “/settings/custom_data/product/metafields/67845521674” was different than in returned list through this endpoint https://shopify.dev/docs/api/admin-rest/2024-04/resources/metafield#get-blogs-blog-id-metafields

{
  "metafield": {
    "value": "[\"Brand1\",\"Brand2\"]",
    "type": "list.single_line_text_field"
  }
}