How can I resolve an inventory update issue with my app's GraphQL query?

I have created an app to update product inventory from the uploaded csv file, I am facing problem in the GraphQL update query, I am using the following mutation: -

data: {
query: mutation { productUpdate(input: { id: "${prod}", variants: { inventoryQuantity: ${product.inventory} } }) { product { id } } }
}

I am facing error: -

Inventory Update Fail Error: InputObject ‘ProductVariantInput’ doesn’t accept argument ‘inventoryQuantity’

The newer version of the Shopify Graphql API does not have a inventoryQuantity field in the ProductVariantInput object.

try inventoryQuantities

https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/productvariantinput#field-productvariantinput-inventoryquantities

data: {
query: mutation { productUpdate(input: { id: "${prod}", variants: [ { inventoryQuantities: [ { availableQuantity: ${product.inventory}, locationId: "YOUR_LOCATION_ID_HERE" // Replace this with your actual location ID } ] } ] }) { product { id variants(first: 3) { edges { node { inventoryQuantities { availableQuantity locationId } } } } } userErrors { field message } } }
}