isaac_way
createCaller Dependency Injection in Middleware ctx ?
createCaller
makes it really easy to inject dependencies via anything that's created during the createContext
function:
However, some times it makes sense to add dependencies in middlewares that are only used by a subset of the procedures. For example if I had a twilioClient
that is only used by my authorizationRouter
, it could make sense to supply that dependency via middleware instead of the createContext
function.
Is there anyway to inject dependencies into a middleware versus just the root createContext
?1 replies
Is it normal to separate resolvers from routers?
Wondering if it's common and/or whether it's a good idea to attempt to separate procedures from the routers... I know there' a lot of extra explicit typing required with separation and wasn't sure what other people are doing
5 replies