Here $options take the form [“Red”, “Left Side”], I have tried several other combinations like [{“orientation”: “Left Side”},{“color”: “Red”}] and several others but I cannot get it to work how I want.
If anyone has a sample graphql query that shows how to make product variants/options correctly please let me know.
There is no tag productOptions for the ProductInput.
“errors”: “message”: “Variable $input of type ProductInput! was provided invalid value for productOptions (Field is not defined on ProductInput)”,
It was still error if I changed the tag productOptions to options
“problems”: “Could not coerce value {name:"Color",values:[{name:"Red"},{name:"Green"}]} to String”
Create product with mutation createProductWithOptions . In this mutation, you will provide all possible options under productOptions. You will get variant id also with productid.
Once Product is created, you can use productVariantsBulkUpdate or productVariantsBulkCreate mutation to give all variants details. To update variant detail of variant created while product creation, use productVariantsBulkUpdate or you are creating new variant useproductVariantsBulkCreate