by spion · 3y ago · 0 comments
OSS: typed-graphql-builder https://typed-graphql-builder.spion.dev/ is a TypeScript based graphql query builder. No more writing untyped strings and running a watcher in the background - generate the builder from the server schema once then write any queries in TS with the help of the language server
It was inspired by tql (https://tql.dev/) but generates a much smaller client and has full, automatic type inference for query variables used in input objects.
(Side note: I feel bad about how similar it is to tql, but the code generation approach was so different (mainly inspired by graphql-zeus) that it felt like poor form to just send a PR changing everything.)
The only "downside" I can see is that all my projects are already set up to use graphql-codegen, and switching to this or tql would just not be worth the effort. This is because 1. it's really not that much of a hassle to run graphql-codegen on the side, since i'm already running other things on the side anyway 2. I'm also using graphql-codegen for other things, such as generating types for cache updates and such in urql.
I might give this a spin in a fresh project, though. But it probably won't let me drop the codegen dependency completely.