Discuss all the new features introduced with the new product model in GraphQL.
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.
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?
Solved! Go to the solution
This is an accepted solution.
I found out from the recent AMA about these new APIs that I should be doing the following:
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
This is an accepted solution.
I found out from the recent AMA about these new APIs that I should be doing the following:
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