We are using GraphQL 2025-07, has anyone had success following this Shopify article on Metafield-linked product options to create products with variants that has linkedMetafieldValues?
We’ve tried the following:
metaobjectCreate
+productSet
per the help article - we get error“Option ‘Color’ must specify at least one option value.”
See code blocks below. (We also had to fix the error that Shopify variant positions now start with 1 instead of 0)productCreate
+productVariantsBulkCreate
- we verified that the linkedMetafieldValues exist on product options, but productVariantsBulkCreate raisesid or name must be specified
productCreate
+productOptionUpdate
+productVariantsBulkCreate
- we getid or name must be specified
Here are the steps for #1
1. Verify metaobject exists:
query ($id: ID!) {
metaobject(id: $id) {
id
type
displayName
handle
fields {
key
value
}
}
}
Results:
{“id”=>“gid://shopify/Metaobject/52316602535”, “type”=>“shopify–color-pattern”, “displayName”=>“Gold”, “handle”=>“gold”, “fields”=>[{“key”=>“label”, “value”=>“Gold”}, {“key”=>“color”, “value”=>“#D49A06”}, {“key”=>“image”, “value”=>nil}, {“key”=>“color_taxonomy_reference”, “value”=>“["gid://shopify/TaxonomyValue/4"]”}, {“key”=>“pattern_taxonomy_reference”, “value”=>“gid://shopify/TaxonomyValue/2874”}]}
{"id"=>"gid://shopify/Metaobject/52316569767", "type"=>"shopify--color-pattern", "displayName"=>"Bronze", "handle"=>"bronze", "fields"=>[{"key"=>"label", "value"=>"Bronze"}, {"key"=>"color", "value"=>"#CD7F32"}, {"key"=>"image", "value"=>nil}, {"key"=>"color_taxonomy_reference", "value"=>"[\"gid://shopify/TaxonomyValue/657\"]"}, {"key"=>"pattern_taxonomy_reference", "value"=>"gid://shopify/TaxonomyValue/2874"}]}
2. productSet
with parameters
{
title: "product name set",
vendor: "Product Test",
status: "ACTIVE",
productType: "Bracelet",
productOptions: [
{
name: "Color",
linkedMetafield: {
namespace: "shopify",
key: "color-pattern"
}
}
],
variants: [
{
optionValues: [{ optionName: "Color", linkedMetafieldValue: "gid://shopify/Metaobject/52316602535"}],
sku: "PT-322353-1",
},
{
optionValues: [{ optionName: "Color", linkedMetafieldValue: "gid://shopify/Metaobject/52316569767"}],
sku: "PT-322353-2",
}
]
}
Error raised:
‘Color’ must specify at least one option value.