alphamikle / nest_transact

Simplest transactions support for Nestjs with Typeorm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QUESTION: Can I use this lib the same way with GrapqhQL resolvers instead of REST controllers?

Gleb-Gaiduk opened this issue · comments

QUESTION: Can I use this lib the same way with GrapqhQL resolvers instead of REST controllers?

@Gleb-Gaiduk, to be honest - I don't use it with resolvers, but all which you need to use - the connection class and TransactionFor<T> service, which will run in a transaction. If your resolver is like a controller and you can inject the connection in its constructor, there is no one reason why you can't use this library.