Update Product Variant input as SKU in GraphQL

Topic summary

Core Issue:
Developers are attempting to update Shopify product variants using GraphQL by providing SKU or handle as identifiers, rather than the variant ID. The standard productVariantUpdate mutation requires an ID, which is causing difficulties.

Current Status:

  • Multiple users have encountered this same limitation over time
  • One user (haydenl) shared a partial workaround using API version 2024-07 that passes SKU through the inventoryItem field
  • However, this solution still requires passing the variant ID in the input

Key Challenge:
The proposed solution doesn’t fully address the original question—it still relies on the variant ID rather than using SKU alone as the identifier for updates.

Resolution Status:
Remains unresolved. No working method has been confirmed for updating variants using only SKU/handle without the variant ID.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Hi,

How to update product variant by providing “SKU” or “handle” under “input” instead of providing “id” as input using GraphQL

The below code is not working:

mutation {
  productVariantUpdate(
    input: {
      sku: "test123",
      handle: "summer-dress"
      price: "18.99"
  }
 )
 {
    productVariant {
      id
      price
      sku
    }
  }
}

Hi,

I see this is a relatively old post with no response. Have you had any luck figuring out how to do this?
I’m facing the same issue right now (using productVariantUpdate using SKU to identify the variant).

Thanks

Hi,
Did you figure out using SKU as a product input?

Hi,

I have managed to do this using version 2024-07 and passing the sku through inventoryItem.

mutation UpdateProductVariant($input: ProductVariantInput!) {
    productVariantUpdate(input: $input) {
        productVariant {
            id
        }
        userErrors {
            field
            message
        }
    }
}

{
    "input": {
        "id": "gid://shopify/ProductVariant/45499072184555",
        "price": 4.99,
        "inventoryItem": {
            "sku": "SKU001"
        }
    }
}

You’re passing the “id”! The question was how do you update it with just the sku.