Update Product Variant input as SKU in GraphQL

srilekha
Shopify Partner
3 0 0

Hi,

 

How to update product variant by providing "SKU" or "handle" under "input" instead of providing "id" as input using GraphQL

 

The below code is not working:

 

 

mutation {
  productVariantUpdate(
    input: {
      sku: "test123",
      handle: "summer-dress"
      price: "18.99"
  }
 )
 {
    productVariant {
      id
      price
      sku
    }
  }
}

 

 

 

 

Replies 2 (2)

hanvari
Shopify Partner
2 0 0

Hi,

 

I see this is a relatively old post with no response. Have you had any luck figuring out how to do this? 
I'm facing the same issue right now (using `productVariantUpdate` using SKU to identify the variant).


Thanks

shivam2238
Shopify Partner
1 0 0

Hi,
Did you figure out using SKU as a product input?