1

I'm working on Transaction per mutation with EF core. I tried an implementation by adding my transaction logic into the Request pipeline UseRequest and it's quite good. But the problem with this implementation is that the transaction logic will be executed each time we have an incoming request Query or Mutation. I think that the Hot Chocolate middlewares can do the work by adding a middleware on all incoming mutations, but the only doc I found is about adding middlewares to fields https://github.com/ChilliCream/graphql-workshop/blob/master/docs/5-understanding-middleware.md. Is there a way to add middlewares on all mutations? thanks.

othman.Da
  • 621
  • 4
  • 16
  • Your feature request has been heared and here is the pull request, that will deliver the requested functionality: https://github.com/ChilliCream/hotchocolate/pull/2913 It will be merged as soon as docs and testing are done. Until then you could habe a look at the code of the PR to see how it was done. – FredericBirke Jan 24 '21 at 20:02
  • 1
    Thanks, I'll take a loot at the PR code. waiting for the release to use this new feature :D – othman.Da Jan 25 '21 at 09:51

0 Answers0