Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.
Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-TekLabs to discuss practical strategies for...
By JasonH Nov 13, 2024The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024