Error on update quantity of a variant with productVariantUpdate mutation (Shopify)

Error on update quantity of a variant with productVariantUpdate mutation (Shopify)


0

I am trying to run this mutation to update the quantities of a product variant on shopify via graphql . (https://shopify.dev/docs/api/admin-graphql/2023-07/mutations/productvariantupdate)

    productVariantUpdate(input: $input) {
            productVariant {
                id
                sku
                product {
                    id
                    title
                }
                inventoryQuantity
            }
            userErrors {
                field
                message
            }
        }
}


$input = [
            'id' => "gid://shopify/ProductVariant/123456",
            'inventoryQuantities' => [
                "availableQuantity" => 123,
                "locationId"        => "gid://shopify/Location/123456789"
            ]
        ];

In the answer I am told that it was successful but then when I go to the dashboard I see that the product quantities have not updated .

Any idea why?

Share
Improve this question


Load 3 more related questions


Show fewer related questions

0

Reset to default



Leave a Reply

Your email address will not be published. Required fields are marked *