Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

GraphQL productUpdate mutation does not create new metafields

GraphQL productUpdate mutation does not create new metafields

Kim25
Visitor
2 0 3

Hi,

 

I have a productUpdate Mutation that used to work to create metafields in a product. It is currently not working when I set more than one metafield, however, when there is only one metafield it creates the metafield in. the product.

 

Is there any explanation? 

Click to expand...

mutation {
   productUpdate (input: { id: "gid://shopify/Product/xxxxx", metafields: [
     { namespace: "somespace",
       key: "somekey",
       value: "469",
      type: "single_line_text_field",
     description: "" },
   { namespace: "somespace",
     key: "somenewkey",
     value: "469",
     type: "single_line_text_field",
     description: "" }
] }) { product {
                          metafields(first: 100) {edges { node { id namespace key value description type }} } }}
}



 

 

thanks,

Replies 0 (0)