Discuss all the new features introduced with the new product model in GraphQL.
Hi,
I want to create my variants using ProductSet new API but there is no way of marking the variants as "tracked".
ProductVariantInput has an inventoryItem object where you can mark the tracked option as true.
ProductVariantSetInput doesn't have this option. It only allows for inventoryPolicy, but not for inventoryItem tracked.
It would be super helpful to have the ability to mark a variant a tracked by using the ProductSet API. If not, then you will always need multiple GraphQL mutations to achieve this and the new Product model goal won't be achieve.
Solved! Go to the solution
This is an accepted solution.
Hi @adearriba
Our thinking is that If you want to create a product with tracking quantity, then you probably also want to be able to set quantities.
This means you will need to do inventory updates anyways. For those we currently support via
https://shopify.dev/docs/api/admin-graphql/unstable/mutations/inventoryItemUpdate
or
https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productVariantsBulkUpdate
This is an accepted solution.
Hi @adearriba
Our thinking is that If you want to create a product with tracking quantity, then you probably also want to be able to set quantities.
This means you will need to do inventory updates anyways. For those we currently support via
https://shopify.dev/docs/api/admin-graphql/unstable/mutations/inventoryItemUpdate
or
https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productVariantsBulkUpdate
Thanks, @AsafGitai.
My thinking is: I would like to have an API that lets me configure my product and all it's variants in one shot. I will then have a separate process to update inventory quantities per location as that is a many to many relationship which requires more resources.
The inventory tracking flag is at the inventoryItem level as others properties which are available like harmonizedSystemCode or weight and weight unit. The inventory quantity is at inventoryLevel level.
Being consistent with the property level, I think it would be best to have the tracking flag added too. Not sure if this can be suggested to the team for a future release.
I don't see how you can consider this as the accepted solution, as you mentioned this not resolve the main Problem.
Your thoughts are not clear to me! The inventory Update mutation allows you to modify the tracked property, but not the quantity, while the "productVariantsBulkUpdate" mutation does not allow you to modify the quantities of already existing variants (absurd!). So what would be the solution to both change quantities and enable inventory tracking in a single call?
Hi @AsafGitai
I don't see how this will solve the problem that @adearriba mentioned.
using of productSet mutation meaning that I follow the Database sync workflow, usually from my local ERP system, und logically I will use the bulk operations.
so I don't see why I will use productVariantsBulkUpdate to manage my inventory!! this mutation give me the ability to update the quantity for all variants which belong to the same Product.
so for example if I have 1K Product ( and I have a lot more) with 4-5 variants for every products, then I must call the inventoryItemUpdate mutation 4-5K time to track the quantity for every variant/inventoryItem, Or productVariantsBulkUpdate mutation 1k time.
so I can't see that as a solution for Database sync workflow, for this workflow I will use :
https://shopify.dev/docs/api/admin-graphql/unstable/mutations/inventorySetQuantities
to set the quantity from my ERP to multiple variants without thinking of grouping them pro product, but to do this I must track the inventoryItem , and this take use to @adearriba question , why you remove the inventoryItem Object form ProductVariantSetInput in the first place, when the goal of using productSet mutation is to make the ERP Data sync faster ??!!!
and as another point, you didn't give us the ability to add the product media in productSet mutation as it in productCreate, and in the same time the productCreateMedia is not available in bulk operations, that mean if I want to create 100 new product using productSet /bulk operations, then I must send 100 request afterword to create the media for every product I created.
so I thought that I can use the following logic for my Database sync workflow :
NOTE: I know that there are a productVariantsBulkCreate mutation but I must send a request for every product so this is not really a solution for this workflow.
so at the end I use it like this :
I think this is a lot of work for some one use the Database sync workflow.
I hope that your team consider the following point:
1- in ProductSet mutation add the inventoryItem object and the publications object and the ability to add the media ( if adding the media is not possible then can you add the productCreateMedia to the bulk operation ) so man can use this mutation for one shot update in Database sync workflow
2- if this is not possible so can you add the productVariantCreate or even better productVariantsBulkCreate to the bulk operation.
Regards
Hi @AsafGitai
What about other attributes like weight? It's not in `ProductVariantSetInput`, so we'll need to use `inventoryItemUpdate` in addition to `productSet` for weight as well?
Hi @AsafGitai
Shopify provides the productSet mutation as a solution for database sync workflows, such as syncing data from an ERP system. Logically, in this case, I would use the bulk operation.
In such a workflow, I can't see how using the inventoryItemUpdate or productVariantsBulkUpdate mutations would be a viable solution for managing inventory or solving the inventory item tracking issue.
Let's consider we have 5K products with 4-5 variants for each product. If I were to use productVariantsBulkUpdate, I would need 5K requests, and with inventoryItemUpdate, I would need 20-25K requests to track the inventory items.
For database sync workflows, I would use inventorySetQuantities, which allows me to update multiple variant quantities without grouping them at the product level.
This brings us to @adearriba question: why did you remove the inventoryItem object in the first place?
On the other hand, we can't send media using productSet as we do with the productCreate mutation. To complicate matters, productCreateMedia is not available in bulk operations.
So, if I want to use productSet to create 100 new products with 4-5 variants each, I would need to send 100 requests to productVariantsBulkUpdate to track the inventory items, or 400-500 requests using inventoryItemUpdate. Then, I must send another 100 requests to create the media using productCreateMedia, and another 100 requests to publish the products using publishablePublish because the publications object is also removed from productSet.
This is a lot of work for a database sync workflow. In this workflow, I expected that productSet would sync the data in one shot.
As a workaround, I thought to use the following steps:
So, I changed the plan to:
But this is still a lot of work for a database sync workflow.
I hope that your team considers the following points:
Regards,
Can you please reconsider? As others have mentioned there's other fields on InventoryItemInput now, such as weight and HS code, and there's no way to update that with productSet. This is a critical issue honestly.