I've this kind of mutation:
mutation updateProducts($input1 : ProductInput!, $id1: ID!, $input2 : ProductInput!, $id2: ID!){
p1: updateProduct(productInput: $input1, id: $id1){
product{
id
showcaseOrder
}
}
enter code here
p2: updateProduct(productInput: $input2, id: $id2){
product{
id
showcaseOrder
}
}
}
I am setting this variables:
{
"input1": {
"showcaseOrder": 2
},
"id1": "363",
"input2": {
"showcaseOrder": 1
},
"id2": "364"
}
I would like to pass an array with all information to the query instead of pass one by one.
You could define an input type for the mutation which takes all the values. Please take a look at this cheat sheet.
Or for example this post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With