Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. GraphQL
  3. type-graphql

type-graphql

MITTypeScriptv2.0.0-rc.4

Create GraphQL schemas and resolvers with TypeScript using classes and decorators.

Visit WebsiteGitHubGitHub
8.1k stars674 forks0 contributors

What is type-graphql?

TypeGraphQL is a framework for building GraphQL APIs with TypeScript. It enables developers to define GraphQL schemas and resolvers using TypeScript classes and decorators, solving the problem of redundancy between schema definitions and data models. By providing a single source of truth, it improves developer experience and type safety.

Target Audience

Backend developers and teams building GraphQL APIs with TypeScript who want to reduce boilerplate, maintain type safety, and streamline schema development.

Value Proposition

Developers choose TypeGraphQL because it eliminates the need to manually sync GraphQL SDL with TypeScript interfaces, offers built-in features like dependency injection and authorization guards, and enhances productivity with full IDE support and compile-time error checking.

Overview

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

Use Cases

Best For

  • Building type-safe GraphQL APIs with TypeScript
  • Reducing boilerplate in GraphQL schema and resolver code
  • Integrating GraphQL with ORMs like TypeORM or Prisma
  • Adding authentication and authorization to GraphQL endpoints
  • Leveraging dependency injection in GraphQL resolvers
  • Ensuring schema and data models stay in sync automatically

Not Ideal For

  • Projects not using TypeScript or teams preferring JavaScript-only GraphQL setups
  • Developers who favor writing GraphQL schemas in SDL files for better integration with existing tooling
  • Simple or prototype APIs where the overhead of decorators and class-based setup isn't justified
  • Environments with strict performance constraints that avoid runtime reflection and decorator processing

Pros & Cons

Pros

Eliminates Schema Redundancy

Uses TypeScript classes as a single source of truth, automatically syncing GraphQL schema with data models to reduce boilerplate and prevent mismatches.

Full TypeScript Integration

Provides compile-time type checking and IDE features like rename refactoring, catching errors early and boosting developer productivity.

Built-in Advanced Features

Includes dependency injection for resolvers and authorization guards via decorators, simplifying common tasks like authentication and service management.

Decorator-Based Syntax

Offers a clean, declarative way to define types and resolvers using decorators, making code more readable and maintainable compared to manual SDL.

Cons

TypeScript and Decorator Dependency

Requires TypeScript and experimental decorators, limiting use in plain JavaScript projects or teams averse to decorator syntax.

Learning Curve and Setup

Involves understanding decorators and TypeGraphQL-specific patterns, which can be more complex than using simpler libraries like Apollo Server directly.

Limited Ecosystem and Tooling

Some GraphQL tooling and community plugins may not integrate seamlessly with TypeGraphQL's class-based approach compared to SDL-first methods.

Frequently Asked Questions

Quick Stats

Stars8,088
Forks674
Contributors0
Open Issues98
Last commit21 days ago
CreatedSince 2018

Tags

#controllers#gql#api#api-framework#graphql#dependency-injection#decorators#type-safety#schema-definition#schema#graphql-js#resolvers#nodejs#typescript#graphql-schema#backend

Built With

T
TypeScript
N
Node.js

Links & Resources

Website

Included in

GraphQL15.0k
Auto-fetched 1 day ago

Related Projects

graphql-code-generatorgraphql-code-generator

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.

Stars11,237
Forks1,389
Last commit2 days ago
graphql-nexusgraphql-nexus

Code-First, Type-Safe, GraphQL Schema Construction

Stars3,427
Forks277
Last commit2 years ago
gql.tadagql.tada

🪄 Magical GraphQL query engine for TypeScript

Stars2,926
Forks57
Last commit23 days ago
pothospothos

Pothos GraphQL is library for creating GraphQL schemas in typescript using a strongly typed code first approach

Stars2,586
Forks181
Last commit9 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub