dgs-framework icon indicating copy to clipboard operation
dgs-framework copied to clipboard

documentation/question/feature: multiple mutations

Open xenoterracide opened this issue 3 years ago • 2 comments

What are you missing in the docs

multiple mutations in a single transaction. Support for this seems to be all over the place in my google search for various frameworks. I mean doing something like this.

mutation first {
  someMutation {
     id: 123
  }
}
mutation second {
   someMutation {
      id: 456
   }
}

What would happen? can it be made to be a single transaction?

I know this is phrased as a question, but I always have the opinion, most questions, if not all can be answered by documentation ;). How to in the mutation would be nice. At the very least there should be some documentation of what happens.

xenoterracide avatar Aug 23 '22 17:08 xenoterracide

Is there any update on this? Can multiple mutations be executed in a single transaction?

xmac11 avatar May 10 '24 11:05 xmac11

Hi - you can do multiple fields in one query or operation. If they have the same name, you will need to alias it as shown below.

query {
  A: hello
  B: hello(name:"wdqw")
}

If you want multiple query blocks in the same request, you will have to specify the operation name to execute in this transaction.

srinivasankavitha avatar May 10 '24 19:05 srinivasankavitha