Discuss all the new features introduced with the new product model in GraphQL.
In 2024 07 API, there will be a product variant field cleanup.
sku: This field will continue to be returned on the Product Variant model, but is not directly editable. Rather the field will just proxy the sku field from the inventory item.
If the SKU is not directly editable, how can I call the productVariantCreate mutation with a custom SKU in the ProductVariantInput?
I want to create a new variant with a custom SKU. Where is the field moved to?
Solved! Go to the solution
This is an accepted solution.
Hi @jam_chan ,
productVariantCreate has an inventoryItem field that you can set these values in
https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/productvariantcreate
Also mentioned in 2024-04:
This is an accepted solution.
Hi @jam_chan ,
productVariantCreate has an inventoryItem field that you can set these values in
https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/productvariantcreate
Also mentioned in 2024-04:
Does that mean that in the API version 2024-04 there is not way to set variant SKU?
The inventoryItem field is in 2024-04 as well, you do not need to wait for 2024-07.
To learn more visit the Shopify Help Center or the Community Blog.
The inventoryItem field is in 2024-04 but the SKU field is not
https://shopify.dev/docs/api/admin-graphql/2024-04/input-objects/InventoryItemInput
https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/productvariantcreate
My mistake, I was looking at the wrong graphql object. You will need to use the deprecated sku field on ProductVariantInput for older versions.
To learn more visit the Shopify Help Center or the Community Blog.
Yeah as @jam_chan mentioned, it seems that the sku field has been forgotten from inventoryItem field in version 2024-04.