Trying to create new product with options. Get an error!
Tried different variations of “options”, still same error
Here is my mutation query:
{
“query” : “mutation productCreate($input: ProductInput!) { productCreate(input: $input) { product { metafields(first: 5) { edges { node { id namespace key value } } } id title description options(first: 25) { name values } variants(first: 25) { nodes { id sku price compareAtPrice selectedOptions { name optionValue { id name } } sku price taxable taxCode barcode weight weightUnit requiresShipping inventoryItem { harmonizedSystemCode } inventoryPolicy metafields(first: 5) { edges { node { id namespace key value } } } } } } } }”,
“variables” : {
“synchronous” : true,
“input” : {
“title” : “MOLLY Product 5.3”,
“options” : [
{
“name” : “Size”,
“values” : [“EACH”]
}
],
“variants” : [
{
“barcode” : “4447771111333-EACH”,
“sku” : “444888”,
“price” : 9.01,
“compareAtPrice” : 10.50,
“taxCode” : “MMM9966”
}
],
“metafields” : [
{
“namespace” : “custom”,
“key” : “ns_internalid”,
“value” : “731”,
“type” : “number_integer”
}
]
}
}
}
Error:
{“errors”:[{“message”:"Variable $input of type ProductInput! was provided invalid value for options.0 (Could not coerce value {name:"Size",values:["EACH"]}
“problems”:[{“path”:[“options”,0],“explanation”:“Could not coerce value {name:"Size",values:["EACH"]} to String”}]}}]