Setting inventory tracking for more than 1 variant on a product in a single graphql mutation!?

Setting inventory tracking for more than 1 variant on a product in a single graphql mutation!?

skuharmony
Shopify Partner
29 2 6

Is this really not possible!?

 

I read through the AMA, and it seems like the team responsible for the graphql mutation is aware that it's a huge PITA to migrate to graphql without the ability to set inventory levels in productSet.

 

That's great, but in the meantime, is our best option really to do this one by one via a call to the inventoryBulkToggleActivation mutation for every single variant/inventoryItemId?

 

Sort of a gut punch. Nice to have the ability to set all these new variants, but feels sort of like saying "hey, I bought you a house with 10x the storage space, but in order to move there you can only pack your stuff using jewelery boxes" 🙂 Shoot!

 

Wish I would have known this before investing several days into migrating off the rest API.

 

Now I'm wondering if I can hack around this by going the productCreate / productVariantBulkCreate route (in order to get inventory-tracked variants created in bulk), and following that up with a productSet where I create product options and update the variants with their option names. Anybody tried anything like that? I'm scared to invest more work and figure out it doesn't work.

Reply 1 (1)

skuharmony
Shopify Partner
29 2 6

Whoops, spoke too soon. The productCreate / productVariantBulkCreate strategy works to create tracked variants with inventories even without the productSet step. I thought I was unable to use productVariantBulkCreate with product options, but just tried it out in graphiql and it worked this time, so that seems like a pretty reasonable workaround for now. Woot.