Add middlewares on all mutations using Hot Chocolate v11

孤者浪人 提交于 2021-01-28 21:28:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!