How can i write a Mutation to ProductUpdate?

How can i write a Mutation to ProductUpdate?

juleshaydn
New Member
4 0 0

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
}
}
}

Reply 1 (1)

oscprofessional
Shopify Partner
16374 2440 3189

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
}
}
}
}

 

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...