I am having some trouble creation productOptions with the admin graphql api.
It seems to me that the implementation is incorrect. Or perhaps I am misunderstanding it?
When creating a new product as seen here..
I have stated the option for size and an array of values which I presume are variants ? as when there is only one stated it creates a variant. Though the issue is that an array of of value names also only creates one variant ?
The example above creates the following variants
Am I misunderstanding this api ?
Hi @NicklasSmit
When you try to call the product api, you will find that options have been created, but options without variant will not be displayed in shopify admin. You can see hasVariables in the figure below. When the value is true, it will be viewed in shopify admin.
2 Likes
Thank you for the speedy and helpful response @Kyle_liu .
Would it make more sense in my custom app to separate product and variant creation into separate functions. Since we still need to create variants after making option values. Perhaps it is easier to simply just use productVariantsBulkCreate when my user is making the list of variants that a product has.