{"id":14529286,"url":"https://github.com/captbaritone/grats","last_synced_at":"2025-04-04T20:09:48.293Z","repository":{"id":149643501,"uuid":"611587268","full_name":"captbaritone/grats","owner":"captbaritone","description":"Implementation-First GraphQL for TypeScript","archived":false,"fork":false,"pushed_at":"2024-12-16T06:18:23.000Z","size":3235,"stargazers_count":312,"open_issues_count":31,"forks_count":17,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-10T23:32:08.339Z","etag":null,"topics":["code-first","graphql","graphql-server","typescript"],"latest_commit_sha":null,"homepage":"https://grats.capt.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/captbaritone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T06:00:44.000Z","updated_at":"2024-12-19T20:33:49.000Z","dependencies_parsed_at":"2023-04-26T05:01:25.304Z","dependency_job_id":"31e35b8d-a5b7-47e9-9e95-3fd0a470d592","html_url":"https://github.com/captbaritone/grats","commit_stats":{"total_commits":540,"total_committers":10,"mean_commits":54.0,"dds":0.03518518518518521,"last_synced_commit":"d8846a46117503c095be728ce1b13a62795c03fd"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captbaritone%2Fgrats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captbaritone%2Fgrats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captbaritone%2Fgrats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captbaritone%2Fgrats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/captbaritone","download_url":"https://codeload.github.com/captbaritone/grats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-first","graphql","graphql-server","typescript"],"created_at":"2024-09-05T00:00:58.414Z","updated_at":"2025-04-04T20:09:48.277Z","avatar_url":"https://github.com/captbaritone.png","language":"TypeScript","readme":"# Grats: Implementation-First GraphQL for TypeScript\n\n**The simplest way to build a GraphQL server in TypeScript**\n\nWhen you write your GraphQL server in TypeScript, your fields and resolvers\nare _already_ annotated with type information. _Grats leverages your existing\ntype annotations to automatically extract an executable GraphQL schema from your\ngeneric TypeScript resolver code._\n\nBy making your TypeScript implementation the source of truth, you never have to\nworry about validating that your implementation matches your schema. Your\nimplementation _is_ your schema!\n\nRead the [blog post](https://jordaneldredge.com/blog/grats).\n\n## Example\n\nHere's what it looks like to define a User type with a greeting field using Grats:\n\n```ts\n/** @gqlType */\nclass User {\n  /** @gqlField */\n  name: string;\n\n  /** @gqlField */\n  greet(args: { greeting: string }): string {\n    return `${args.greeting}, ${this.name}`;\n  }\n}\n```\n\nAfter running `npx grats`, you'll find a `schema.ts` module that exports an executable schema, and a `schema.graphql` file contains your GraphQL schema definition:\n\n```graphql\ntype User {\n  name: String\n  greet(greeting: String!): String\n}\n```\n\nThat's just the beginning! To learn more, **Read the docs: https://grats.capt.dev/**\n\n[![Join our Discord!](https://img.shields.io/discord/1089650710796320868?logo=discord)](https://capt.dev/grats-chat)\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](./CONTRIBUTING.md) in the repo root for details on how to make changes to this project.\n\n# Acknowledgements\n\n- [@mofeiZ](https://github.com/mofeiZ) and [@alunyov](https://github/alunyov) for their Relay hack-week project exploring a similar idea.\n- [@josephsavona](https://github.com/josephsavona) for input on the design of [Relay Resolvers](https://relay.dev/docs/guides/relay-resolvers/) which inspired this project.\n- [@bradzacher](https://github.com/bradzacher) for tips on how to handle TypeScript ASTs.\n- Everyone who worked on Meta's Hack GraphQL server, the developer experience of which inspired this project.\n- A number of other projects which seem to have explored similar ideas in the past:\n  - [ts2gql](https://github.com/convoyinc/ts2gql)\n  - [ts2graphql](https://github.com/cevek/ts2graphql)\n  - [typegraphql-reflection-poc](https://github.com/MichalLytek/typegraphql-reflection-poc)\n\n## License\n\nGrats is [MIT licensed](./LICENSE).\n","funding_links":[],"categories":["JavaScript","**1. Libraries**"],"sub_categories":["GraphQL"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptbaritone%2Fgrats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaptbaritone%2Fgrats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptbaritone%2Fgrats/lists"}