4 ms·
With tRPC and similar frameworks, you infer client types from server definitions without including actual server code into the client. As much as I like GraphQL
by jensneuse 3y ago
With tRPC and similar frameworks, you infer client types from server definitions without including actual server code into the client. As much as I like GraphQL, one thing that IDEs really suck at is recognizing when generated code changes. E.g. with Jetbrains IDEs it sometimes takes forever until a change to the generated code is actually picked up by intellisense. VSCode is a little bit better regarding this. When you infer types in tRPC style, this whole problem is gone. You can even jump between the client usage and the server implementation. That said, this is not without a cost. Large Typescript codebases can slow down the typescript autocompletion and this approach only works best when both client and server are written in typescript and ideally in the same codebase.
- c-hendricks 3y agoHm, yeah I don't think we had similar experiences with GraphQL then > you infer client types from server definitions without including actual server code into the client Our types are generated into their own package, so there's no chance of importing server code.