Possible Bug: productSet Mutation Doesn't Allow list.single_line_text_field in Metafield Definitions

Hi,

I encountered an issue when using the productSet mutation in Shopify’s GraphQL Admin API to create a custom product metafield of type list.single_line_text_field. The mutation succeeds, but when I go in the unstructured fields section and try to add it to my definitions, it allows me to select single_line_text_field but it doesn’t recognize it as a list even if my value is a JSON array, making it unusable for storefront filtering.

Is there a reason why this wouldn’t work?

I am using the latest api 2025-01.

Here is my sample mutation.

mutation createProductAsynchronous($productSet: ProductSetInput!, $synchronous: Boolean!) {
  productSet(synchronous: $synchronous, input: $productSet) {
    product {
      id
    }
    productSetOperation {
      id
      status
      userErrors {
        code
        field
        message
      }
    }
    userErrors {
      code
      field
      message
    }
  }
}
{
  "synchronous": true,
  "productSet": {
    "status": "DRAFT",
    "title": "test K",
    "metafields": [
        {
            "key": "test",
            "namespace": "custom",
            "type": "list.single_line_text_field",
            "value": "[\"Interior\", \"Exterior\"]"
        }
    ]
  }
}

If I manually create the metafield definition and then run this mutation, it will work fine.

Any help is appreciated.

Hi Kheang,

I’ve connected with the relevant team on this and I’ll let you know what I hear back.

1 Like

Hi again Kheang,

The product team have confirmed this is an undocumented limitation right now that they’re looking to address. I don’t have an ETA when if will be possible to do this - but in the meantime I’ve connected with our team to ensure this limitation is documented.

1 Like

Thank you for the follow-up!