For my current project, it is handled by GraphQL. Using a combination of type-graphql and code generation, I have fully round trip static types on both client and server, by only defining my model once. Even my graphql queries are checked.
It is a bit of a pain to setup, but once it is done, I've found that it works pretty well.
It is a bit of a pain to setup, but once it is done, I've found that it works pretty well.
[1] https://github.com/MichalLytek/type-graphql/
[2] https://graphql-code-generator.com/