Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I'm using the Shopify GraphiQL App to set up my mutations, and I'm using the GraphQL docs as a reference. The docs say that updating the sku using the productVariantUpdate mutation is deprecated and to use inventoryItem.sku instead, however InventoryItemInput does not have sku as an option and I get a type error when I try to use it in this mutation "InputObject 'InventoryItemInput' doesn't accept argument 'sku'".
Using the deprecated 'sku' value works like this,
mutation MyMutation {
productVariantUpdate(
input: {id: "gid://shopify/ProductVariant/49897690000000", price: "20.45", sku: "test5/20-51s"}
) {
productVariant {
id
sku
}
}
}
But the whole point of updating our application was to get away from deprecated REST API usage, and I can't seem to find a way to update a sku for a product variant using a GraphQL mutation that isn't deprecated as well.
Solved! Go to the solution
This is an accepted solution.
I had the same problem. Please try to use API version 2024-07. With the newest version you can pass sku in the inventoryItem.
This is an accepted solution.
I had the same problem. Please try to use API version 2024-07. With the newest version you can pass sku in the inventoryItem.
Thank you.
is it worked ??
Well, we have the same problem as we use SKUs for product identification in the warehouse. Now with the 2025-01 update can't find a way to save SKUs for new products. Is there any solution to update/add SKU for a product?
Not even the price is saved when productCreate GraphQL.
I'm also trying to update to 2025-01. Same issue, I have new products without variants that need to have SKUs. It looks like I need to create a variant and to do that I need to create a variantOption. All of our existing items still have SKUs without variants/variantOptions, it seems creating new varitant-less products with a SKU is impossible in 2025-01...
With the last version 2025-01 you need to create first the product
this create a variant option by default get id of this variant.
as a second step to add sku, price you need to update the variant by productVariantsBulkUpdate
```
```