How to update product options in product variant in Shopify?

Highlighted
New Member
2 0 0

We are facing challenges while updating product options in product variants as options fields in GraphQL and Rest API are totally different. Below is the screen-shot:

GraphQL: enter image description here

REST APIs: enter image description here

We are using GraphQL to mutate product variant. So our challenge is, how can we send three different options (like, large, blue, paper) to product variant that make one variant as it takes only one [String!] value. Whereas in REST APIs, there are three different options (option1, option2, option3) along with Default Title.

 

Also, if possible can anyone share a dummy mutation request for this?

 

Below are the links that we are referring to:

Update Product Variant: https://shopify.dev/docs/admin-api/graphql/reference/mutation/productvariantupdate?api[version]=2020...

Update Product: https://shopify.dev/docs/admin-api/graphql/reference/mutation/productupdate?api[version]=2020-04

0 Likes