On the admin-graphql API the Product Variant graphql object has a field selectedoptions ProductVariant - GraphQL Admin
this field returns an array.
Is the array sorted by the option positions? Product - GraphQL Admin
I.e. if the product has options Size, Color,
will selectedoptions on Product Variant always return an array with Size first, then Color?
AMaL
November 20, 2024, 7:19am
2
Hi @sengming
The selectedoptions
field returns an array sorted according to the product option’s position. The order of the selectedoptions
matches the position set for each option
1 Like
Thanks @AMaL do you have any references for this? I can’t seem to find it on the documentation.
AMaL
November 20, 2024, 5:27pm
4
I have also not seen a reference document. I confirmed this by changing the order of the product options in the query and running it.
1 Like