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.
Hi folks,
We have added support for inventory in productSet in 2024-10
https://shopify.dev/changelog/new-inventory-input-fields-in-productset-mutation-in-version-2024-10
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
In the new API version 2024-10, inventoryQuantities has been added, which now makes it possible to directly activate a product at a desired location. This way, an inventoryItem is created for the respective product at the correct location.
However, it is still not possible to update the inventoryItem directly, which means the property tracked is set to false. We now have to create an additional bulk task to update all inventoryItems to tracked=true.
We are being forced to update the entire flow for 2025, but this still works incompletely. Could we please get an indication of whether this feature will be added, and when? If it's not available in time, we will have to implement a suboptimal flow.
Does anyone know more about this, or perhaps another interesting implementation?
This is an accepted solution.
Hi folks,
We have added support for inventory in productSet in 2024-10
https://shopify.dev/changelog/new-inventory-input-fields-in-productset-mutation-in-version-2024-10
Thank you @AsafGitai , will a variant be automatically marked as tracked: true if you pass in inventoryQuantities while creating it?
I am currently using it and it does not appear to set the tracked:true. Prolly we still need to run the other mutation
Hmm, In my case I don't mind that productSet can't do it all, I also checked out the FAQ on it and it makes sense. But I think all other use-cases that are tied with products should also be bulkable. The list is short and it's a bit odd to build a pipeline that's meant for bulk, and then at the end have to send lots of requests for each product to do little fixes such as marking it `tracked`.
If we can have inventoryItem so we can set the cost of the product, productSet would be perfect (to us)