Duplicate Product and Update variant info with GraphQL

Duplicate Product and Update variant info with GraphQL

25 1 19
I need to be able to duplicate a product but update the price of the one and only variant that the product has.

Currently I have to make the duplicate product mutation, wait for the response, then make a second mutation to update the product variant using the ID that is returned in the response of the first mutation.

Is this the only way to do this, or is there a way to be able to batch the calls?

Reply 1 (1)

Shopify Staff
1134 84 234

Hey there, 


It sounds to me like you're doing this properly, I'm not aware of any way that you'd be able to perform both actions at the same time. You would need the product duplication to complete first so you could get the duplicate's ID to use with an update. 



Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog