How can i write a Mutation to ProductUpdate?

Topic summary

A developer is trying to write a GraphQL mutation to update SEO properties (title and description) for multiple products returned from a query.

Current Challenge:

  • Has a query returning an array of products
  • Struggling to construct the mutation syntax to update SEO fields for each product in the array
  • Provided incomplete/malformed mutation code attempt

Solution Provided:
Another user shared a working productUpdate mutation example that updates SEO fields:

  • Uses productUpdate mutation with product id (GID format)
  • Includes seo object with title and description fields
  • Returns updated product data including SEO properties

Status: The discussion appears to provide a working solution, though it addresses updating a single product rather than batch updating multiple products from an array.

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

I have a query that returns an array of products, I can’t work out how to right a mutation that updates the seo props of each product in the array.

(this is how far I could get…)

mutation productUpdate($input: ProductInput!) {
productUpdate(input: $input) {
product {
id {
seo {
description: “Testing update description”,
title: “Testing update title”
}
}
}
userErrors {
field
message
}
}
}

Hello @juleshaydn
You can use this query for product mutation of seo fileds

Query : -

mutation {
productUpdate(input: {id: “gid://shopify/Product/8124163522853”,
variants: {price: 300.00},
seo: {description: “testing description”,
title: “test123”}})
{product {
id
seo {
description
title
}
}
}
}