Discuss all the new features introduced with the new product model in GraphQL.
Sending the following input:
{"bodyHtml":"body","title":"Title","tags":"","productOptions":[{"name":"Length","position":1,"values":[{"name":"12\"\/14\"\/16\" bundle deal"},{"name":"14\"\/16\"\/18\" bundle deal"},{"name":"16\"\/18\"\/20\" bundle deal"},{"name":"18\"\/20\"\/22\" bundle deal"},{"name":"20\"\/22\"\/24\" bundle deal"},{"name":"22\"\/24\"\/26\" bundle deal"}]}]}
Getting the following response. Note that only one value registered
{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7379926188141","options":[{"id":"gid://shopify/ProductOption/9449329688685","name":"Length","values":["12\"/14\"/16\" bundle deal"]}]},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":11,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1989,"restoreRate":100.0}}}}
Solved! Go to the solution
This is an accepted solution.
Figured it out. The values are registering. The sole option value in the "values" array is there, because of the single variant automatically created. To get the rest of the values, query product.options.optionValues in the response:
product {
id
options {
id
name
values
optionValues {
id
name
hasVariants
}
}
}
This is an accepted solution.
Figured it out. The values are registering. The sole option value in the "values" array is there, because of the single variant automatically created. To get the rest of the values, query product.options.optionValues in the response:
product {
id
options {
id
name
values
optionValues {
id
name
hasVariants
}
}
}