问题
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.
来源:https://stackoverflow.com/questions/65808043/add-middlewares-on-all-mutations-using-hot-chocolate-v11