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
16116 2410 3126

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

 

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free