The GraphQL schema was generated by my OPT generator.
It is easy to generate code in any programming language. I just don’t want to spend time on other languages if there is no interest in them.
Since my main project uses Dart, I reused the GraphQL generator and generated models for the same blood pressure OPT. Compare the results:
GraphQL:
Dart:
The generator currently outputs Dart code (its syntax is almost the same as Java and JavaScript). Dart tools can compile it to JavaScript (dart2js, dartdevc). It remains almost readable even after compiling. But the readability is not important. The important part is that the code can be run on Node.js or be called from other JavaScript code.
Here is the generator code for GraphQL and Dart. Almost the same. It takes only these few methods and the generator can output code in TypeScript, C#, Kotlin,…
GraphQL:
Dart: