Grats
Implementation-First GraphQL for TypeScript
README
Grats
Grats is still experimental. Feel free to try it out and give feedback, but the api is still in flux
Grats: Implementation-First GraphQL for TypeScript
What if building a GraphQL server were as simple as just writing functions?
When you write your GraphQL server in TypeScript, your fields and resolvers are alreadyannotated with type information. Grats leverages your existing type annotations to automatically extract an executable GraphQL schema from your
generic TypeScript resolver code.
By making your TypeScript implementation the source of truth, you never have to worry about validating that your implementation matches your schema. Your
implementation isyour schema!
Read the docs: https://grats.capt.dev/
Contributing
See CONTRIBUTING.md in the repo root for details on how to make changes to this project.
Acknowledgements
@mofeiZ and @alunyov for their Relay hack-week project exploring a similar idea.
@josephsavona for input on the design of Relay Resolvers which inspired this project.
@bradzacher for tips on how to handle TypeScript ASTs.
Everyone who worked on Meta's Hack GraphQL server, the developer experince of which inspired this project.
A number of other projects which seem to have explored similar ideas in the past:
ts2gql
ts2graphql
typegraphql-reflection-poc
探客时代
