8

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.

1 Answer 1

8

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.