{"id":13588814,"url":"https://github.com/prisma-labs/graphqlgen","last_synced_at":"2025-10-02T08:30:49.162Z","repository":{"id":45574676,"uuid":"143879766","full_name":"prisma-labs/graphqlgen","owner":"prisma-labs","description":"⚙️ Generate type-safe resolvers based upon your GraphQL Schema","archived":true,"fork":false,"pushed_at":"2021-12-07T19:40:38.000Z","size":2584,"stargazers_count":818,"open_issues_count":67,"forks_count":54,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-01-17T07:11:26.960Z","etag":null,"topics":["code-generation","codegen","flow","graphql","graphql-server","schema-first","typescript"],"latest_commit_sha":null,"homepage":"","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/prisma-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-07T13:48:31.000Z","updated_at":"2024-10-07T09:17:16.000Z","dependencies_parsed_at":"2022-09-02T10:01:13.713Z","dependency_job_id":null,"html_url":"https://github.com/prisma-labs/graphqlgen","commit_stats":null,"previous_names":["prisma/graphqlgen","prismagraphql/graphql-resolver-codegen"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-labs%2Fgraphqlgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-labs%2Fgraphqlgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-labs%2Fgraphqlgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-labs%2Fgraphqlgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prisma-labs","download_url":"https://codeload.github.com/prisma-labs/graphqlgen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234957766,"owners_count":18913345,"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-generation","codegen","flow","graphql","graphql-server","schema-first","typescript"],"created_at":"2024-08-01T15:06:57.202Z","updated_at":"2025-10-02T08:30:43.792Z","avatar_url":"https://github.com/prisma-labs.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://imgur.com/c6Y4tGw.png\" width=\"150\" /\u003e\u003c/p\u003e\n\n# graphqlgen \u003c!-- omit in toc --\u003e\n\n[![CircleCI](https://circleci.com/gh/prisma/graphqlgen.svg?style=shield)](https://circleci.com/gh/prisma/graphqlgen) [![npm version](https://badge.fury.io/js/graphqlgen.svg)](https://badge.fury.io/js/graphqlgen)\n\nGenerate \u0026 scaffold type-safe resolvers based on your GraphQL Schema in TypeScript, Flow \u0026 Reason\n\n## Deprecation note\n\n`graphqlgen` has been officially deprecated in favor of the [The Guild](http://the-guild.dev)'s project [GraphQL Code Generator](https://graphql-code-generator.com/). Learn more about the collaboration of Prisma and the Guild in [this]( https://www.prisma.io/blog/the-guild-takes-over-oss-libraries-vvluy2i4uevs) blog post.\n\n---\n\n- [About](#about)\n  - [Highlights](#highlights)\n  - [Motivation](#motivation)\n  - [Supported languages](#supported-languages)\n- [Getting started](#getting-started)\n  - [Try out a project initializer](#try-out-a-project-initializer)\n  - [Add to existing project](#add-to-existing-project)\n  - [Documentation](#documentation)\n- [Addendum](#addendum)\n  - [Community](#community)\n  - [Project Status](#project-status)\n  - [Prior Art](#prior-art)\n\n## About\n\n### Highlights\n\n- **Schema-first** Design in SDL to derive ideal types\n- **Type-safety** Resolvers with precise signatures including `parent`, `args` and return type\n- **DX** Precise resolver types puts your editor intellisense to work\n- **Ecosystem Interop** codegen suitable for Yoga 1 or Apollo Server and supports [prettier](https://github.com/prettier/prettier) and [graphql-import](https://github.com/prisma/graphql-import) out of the box\n\n### Motivation\n\nProgramming in type-safe environments can contribute toward great confidence in your code's integrity. `graphqlgen` aims to leverage the GraphQL type system to make your resolvers completely type-safe. This is important because resolvers are the heart of any graphql service and yet the hardest to statically type due to their dynaminism.\n\n### Supported languages\n\n- `TypeScript`\n- `Flow`\n\nOthers under discussion:\n\n- [`reason`](https://github.com/prisma/graphqlgen/issues/253)\n\n## Getting started\n\n### Try out a project initializer\n\n1. Run initializer\n\n   ```bash\n   yarn create graphqlgen my-app # npm init graphqlgen my-app\n   cd my-app\n   yarn start # npm run start\n   ```\n\n2. Edit `./my-app/src/schema.graphql` to your heart's content.\n\n3. Generate types:\n\n   ```\n   yarn graphqlgen\n   ```\n\n### Add to existing project\n\n```bash\nyarn add --dev graphqlgen # npm install --save-dev graphqlgen\n```\n\nThen you will have access to the cli (`gg` or `graphqlgen`):\n\n```bash\nyarn -s gg --help # npm run gg --help\n```\n\n```\nUsage: graphqlgen or gg\n\nOptions:\n  -i, --init     Initialize a graphqlgen.yml file\n  -v, --version  Show version number                                   [boolean]\n  -h, --help     Show help                                             [boolean]\n```\n\n`gg` depends on the presence of a `graphqlgen.yml` config **located in the directory where `gg` is invoked**. Here is an example:\n\n```yml\nlanguage: typescript\nschema: ./src/schema.graphql\ncontext: ./src/context.ts:Context\noutput: ./src/generated/graphqlgen.ts\nmodels:\n  files:\n    - ./src/generated/prisma-client/index.ts\n```\n\n### Documentation\n\nhttps://oss.prisma.io/graphqlgen\n\n## Addendum\n\n### Community\n\nJoin us at `#graphqlgen` in our [Slack group](https://slack.prisma.io) and if you have more fleshed out ideas, bug reports etc. create a Github issue:\n\n- [feature request](https://github.com/prisma/graphqlgen/issues/new?template=feature_request.md\u0026labels=enhancement)\n- [bug report](https://github.com/prisma/graphqlgen/issues/new?template=bug_report.md\u0026labels=bug)\n\n### Project Status\n\n`graphqlgen` is still in early stage development where breaking changes and tool design are a fluid matter. Feedback is deeply appreciated. You may feel comfortable giving it a try on production systems since there is no runtime aspect and hence quite safe to do so (save for a few optional default resolvers).\n\n### Prior Art\n\n- [**gqlgen**](https://github.com/99designs/gqlgen) is the Golang equivalent of `graphqlgen` and served as a source of inspiration\n- [**graphql-code-generator**](https://github.com/dotansimha/graphql-code-generator) is a similar tool based on templates support both frontend \u0026 backend\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://oss.prisma.io\"\u003e\u003cimg src=\"https://imgur.com/IMU2ERq.png\" alt=\"Prisma\" height=\"170px\"\u003e\u003c/a\u003e\u003c/p\u003e\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-labs%2Fgraphqlgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprisma-labs%2Fgraphqlgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-labs%2Fgraphqlgen/lists"}