productSet mutation is a huge step back

Solved

productSet mutation is a huge step back

tolgapaksoy
Shopify Partner
111 8 71

Where I first could create a product for a fulfillment service in a single mutation, with inventory at the fulfillment service location with their inventories, I now need to fire many many mutations just to create a single product with their variants correctly.

 

  1. Create a product with their variants using `productSet`
  2. This creates the product at the default location of the store (which is not what I want)
  3. I then need to fire off `inventoryItemUpdate` mutation for each variant to set `tracked: true`
  4. I then fire a `inventoryActivate` mutation for each variant to activate them for the Fulfillment service location
  5. But then, all the variants are still activated for the default location of the store, WHICH IS NOT WHAT I WANT
  6. So then I need to figure out the default location ID, and deactivate each variant for the default location

I saw another community member having the same issues: https://community.shopify.com/c/new-graphql-product-apis/troubles-with-fulfillment-service-location/...

 

This is an awful flow. How does anyone cope with these changes? I am 100% sure that with 2024-07 I will be fighting with API rate limits constantly.

 

Does anyone have any suggestions to clean up the flow I went with?

Accepted Solution (1)

tolgapaksoy
Shopify Partner
111 8 71

This is an accepted solution.

I found out from the recent AMA about these new APIs that I should be doing the following:

 

https://community.shopify.com/c/community-amas-ask-me-anything/shopify-community-ama-with-shopify-de...

 

I should be using productCreate without passing any variants. And then using productVariantsBulkCreate with strategy: REMOVE_STANDALONE_VARIANT. This allows me to create the product with correct options and optionValues in 1 mutation, and then add its variants in a single followup mutation that also provides the fulfillment service location ID, and their starting quantities. That way I only need to fire 2 mutations per product.

 

Basically my suggestion: do not use productSet if you care about which location your variants are stocked

View solution in original post

Reply 1 (1)

tolgapaksoy
Shopify Partner
111 8 71

This is an accepted solution.

I found out from the recent AMA about these new APIs that I should be doing the following:

 

https://community.shopify.com/c/community-amas-ask-me-anything/shopify-community-ama-with-shopify-de...

 

I should be using productCreate without passing any variants. And then using productVariantsBulkCreate with strategy: REMOVE_STANDALONE_VARIANT. This allows me to create the product with correct options and optionValues in 1 mutation, and then add its variants in a single followup mutation that also provides the fulfillment service location ID, and their starting quantities. That way I only need to fire 2 mutations per product.

 

Basically my suggestion: do not use productSet if you care about which location your variants are stocked