I’m a little bit stuck on this and I’ll really appreciate your help.
I try to create an option with multiple values, using the mutation productOptionsCreate.
Whatever I do, it only creates one option (the first one : Yellow). When I check the specs, values is indeed an array. https://shopify.dev/docs/api/admin-graphql/latest/mutations/productoptionscreate
Thanks a lot for your very fast reply ! I tried this on GraphiQL and I think it’s not working because values expects an OptionValueCreateInput datatype.
Did you tried that by yourself on GraphiQL. Thx again :-).
If you’re open to trying an app instead of working with the code, you can check out Easify Product Options. It lets you create product options with multiple values easily—no coding needed. Might save you some time. Here’s an example of a product that has a lot of options:
Thanks a lot for the info, but that’s not applicable in my case, as I develop a full nodejs app. I’ll try with productOptionUpdate (optionValuesToAdd). Apparently there is a bug with productOptionsCreate.
I am developing an app that creates products using mutations in Shopify. I have successfully created the product creation and media creation APIs, but I am currently encountering errors while creating the variants.
When I attempt to create variants, I receive an error saying “no options exist.” And, when I try to add options before creating variants, it only generates the first option.
I didn’t tried yet, but my next try will be a call to the mutation ProductSet. Apparently with that mutation, you can create the product, images, variants, options, etc.. in 1 (asynchronous) call. No need to call one mutation for the product, one for the variant, one for the options, etc… Give it a try and tell me if it works.