isaac_way
isaac_way16mo ago

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
2 Replies
Nick
Nick16mo ago
Move stuff around until it feels right I tend to use services which encapsulate tasks, and do no more than tie things together in procedures, so keeping them grouped in routers seems okay
isaac_way
isaac_way16mo ago
that's basically what i do, I usually just have use functions grouped into modules and then string those together in the resolver. I like the approach a lot. I'm more asking because we're about to start a new project at work where we separate resolvers and was wondering if there's any glaring issue with the approach. Mainly wondering about whether it's most common to define the callback passed to query() or mutation() somewhere other than in the router itself. PERSONALLY i love inference too much to explicitly type out resolvers 😆