Define and build GraphQL schemas using TypeScript classes with decorators (static v0.3.0, last release Sep 2020). Uses `@Type`, `@Field`, `@Mutation`, `@Nullable`, and `@Input` decorators to generate a full GraphQL schema via `makeSchema()`. Unlike type-graphql or nestjs/graphql, it is minimal with no dependency injection, no resolvers file, and no runtime reflection beyond decorator metadata. Requires `graphql@^0.13.2` (not v15+) and TypeScript with `experimentalDecorators` and `emitDecoratorMetadata`. Unmaintained since 2020 – incompatible with modern GraphQL versions.
npm install graphql-typescriptNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic schema generation: a Query type with a single field, then prints the resulting GraphQL schema.
Downgrade graphql to ^0.13.2 or migrate to type-graphql / graphql-compose.
Consider using type-graphql or nestjs/graphql for active development.
Set "experimentalDecorators": true and "emitDecoratorMetadata": true in compilerOptions.
Add @Nullable decorator above @Field for nullable fields.
Initialize every @Field property with a default value (e.g., hello: string = 'world').
Install graphql@0.13.2: npm install graphql@0.13.2
Add "experimentalDecorators": true to tsconfig.json compilerOptions.
Ensure all object types are decorated with @Type.