# MichalLytek/type-graphql

Create GraphQL schema and resolvers with TypeScript, using classes and decorators!

Repository: https://github.com/MichalLytek/type-graphql
Canonical: https://ross.abutalabs.com/products/type-graphql
Homepage: https://typegraphql.com
Language: TypeScript
License: MIT
License Family: permissive
Topics: graphql, typescript, decorators, api, controllers, schema, gql, resolvers, graphql-js, graphql-schema, hacktoberfest
Last push: 2026-07-16T07:50:15+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 92, release rhythm 72, longevity 100
- inputs: {"age_days": 3158, "days_push": 48, "days_rel": 188, "gap_med": 17, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8091, forks 673 (observed 2026-08-28T04:10:12.646477+00:00)

## What it is
TypeGraphQL is a TypeScript framework for building GraphQL APIs using classes and decorators instead of SDL files, generating the schema from decorated object types and resolver classes. It includes built-in support for validation, authorization guards, dependency injection, middleware, and SDL emission.

## Use cases
- build a GraphQL API in Node.js with TypeScript
- define GraphQL schema from TypeScript classes instead of SDL
- add auth guards and validation to GraphQL resolvers
- avoid type duplication between ORM entities and GraphQL types
- generate schema.graphql file for client tooling
- use dependency injection in GraphQL resolvers
- integrate GraphQL with TypeORM or MikroORM

## When to choose
- you want a single source of truth between TypeScript types and GraphQL schema
- you prefer code-first schema definition with decorators
- you need built-in authorization, validation, and DI in resolvers
- your stack is Node.js with TypeScript and Apollo or graphql-js

## When to avoid
- you prefer SDL-first schema design
- your project is JavaScript without TypeScript
- you need a stable 2.0 release - it is still in release candidate
- you use a non-Node.js backend language

## Facets
- artifact type: framework
- maturity: active
- function: graphql, api-framework, web-framework, auth, middleware, form-handling
- domain: web-development, backend, apis, developer-tools
- platform: -
- tags: code-first-graphql, decorators, schema-first-alternative, dependency-injection, resolvers, sdl-generation, nodejs, typescript, web-server

## Member repositories
- MichalLytek/type-graphql (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:12.646477+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:30:47.524317+00:00, confidence not recorded.
  - readme: https://github.com/MichalLytek/type-graphql (fetched 2026-08-28T04:10:12.646477+00:00, sha 7e60eca7da18)
  - homepage: https://typegraphql.com (fetched 2026-08-29T08:29:13.412097+00:00, sha 3440db912cef)
  - site_page: https://typegraphql.com/docs/introduction.html (fetched 2026-08-29T08:29:13.422362+00:00, sha cbe327d67448)
  - site_page: https://typegraphql.com/docs/examples.html (fetched 2026-08-29T08:29:13.424858+00:00, sha 5da56351150d)
  - site_page: https://typegraphql.com/docs/faq.html (fetched 2026-08-29T08:29:13.426868+00:00, sha 6c5087041220)
  - site_page: https://typegraphql.com/docs/getting-started.html (fetched 2026-08-29T08:29:13.429014+00:00, sha 6cd6f3d85049)
  - site_page: https://typegraphql.com/docs/scalars.html (fetched 2026-08-29T08:29:13.431231+00:00, sha 896c72234579)
  - site_page: https://typegraphql.com/docs/dependency-injection.html (fetched 2026-08-29T08:29:13.434049+00:00, sha e23106f51267)
  - site_page: https://typegraphql.com/docs/emit-schema.html (fetched 2026-08-29T08:29:13.436465+00:00, sha 4cad14dc3772)
  - registry_npm: https://registry.npmjs.org/type-graphql (fetched 2026-08-29T08:29:13.438600+00:00, sha b5818d1df3dd)
- Data as of 2026-08-30T08:39:29.467469+00:00.
