HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
MichalLytek
type-graphql
TypeScript2020–2020
MichalLytek / type-graphql

type-graphql

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

3Distinct people
3Mentions
0Explicit recommenders
8.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:03:16 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week3 dated mentions

Observed mentions: 2020-03-20 13:40:35 UTC to 2020-07-09 10:00:05 UTC. Weeks start Monday, UTC.

012020-03-16 00:00:00 UTC to 2020-03-23 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 162020-03-23 00:00:00 UTC to 2020-03-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-03-30 00:00:00 UTC to 2020-04-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-04-06 00:00:00 UTC to 2020-04-13 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-04-13 00:00:00 UTC to 2020-04-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-04-20 00:00:00 UTC to 2020-04-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-04-27 00:00:00 UTC to 2020-05-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-05-04 00:00:00 UTC to 2020-05-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-05-11 00:00:00 UTC to 2020-05-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsMay 112020-05-18 00:00:00 UTC to 2020-05-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-05-25 00:00:00 UTC to 2020-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-06-01 00:00:00 UTC to 2020-06-08 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-06-08 00:00:00 UTC to 2020-06-15 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-06-15 00:00:00 UTC to 2020-06-22 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-06-22 00:00:00 UTC to 2020-06-29 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-06-29 00:00:00 UTC to 2020-07-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-07-06 00:00:00 UTC to 2020-07-13 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJul 6

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Mar 162020-03-16 00:00:00 UTC2020-03-23 00:00:00 UTC101
Mar 232020-03-23 00:00:00 UTC2020-03-30 00:00:00 UTC000
Mar 302020-03-30 00:00:00 UTC2020-04-06 00:00:00 UTC000
Apr 62020-04-06 00:00:00 UTC2020-04-13 00:00:00 UTC101
Apr 132020-04-13 00:00:00 UTC2020-04-20 00:00:00 UTC000
Apr 202020-04-20 00:00:00 UTC2020-04-27 00:00:00 UTC000
Apr 272020-04-27 00:00:00 UTC2020-05-04 00:00:00 UTC000
May 42020-05-04 00:00:00 UTC2020-05-11 00:00:00 UTC000
May 112020-05-11 00:00:00 UTC2020-05-18 00:00:00 UTC000
May 182020-05-18 00:00:00 UTC2020-05-25 00:00:00 UTC000
May 252020-05-25 00:00:00 UTC2020-06-01 00:00:00 UTC000
Jun 12020-06-01 00:00:00 UTC2020-06-08 00:00:00 UTC000
Jun 82020-06-08 00:00:00 UTC2020-06-15 00:00:00 UTC000
Jun 152020-06-15 00:00:00 UTC2020-06-22 00:00:00 UTC000
Jun 222020-06-22 00:00:00 UTC2020-06-29 00:00:00 UTC000
Jun 292020-06-29 00:00:00 UTC2020-07-06 00:00:00 UTC000
Jul 62020-07-06 00:00:00 UTC2020-07-13 00:00:00 UTC101

What Hacker News says

3 sources
Hey haven't tried postgraphile, but have tried Prisma/Hasura which seem to be on the same SaaS-GraphQL space. They're all valid products, but my stack is 100% fully open source, and there's no PRO to buy for any of the options. I based it off the creator of TypeGraphQL GQL-Modules+TypeGraphQL v1 example: https://github.com/MichalLytek/type-graphql/tree/master/exam... And a LogRocket's blogpost about TypeORM+TypeGraphQL: https://blog.logrocket.com/how-build-graphql-api-typegraphql... I need to add typeorm/models to my template before sharing, but as an example here's a model which is also a type, using both @ObjectType() & @Field() (type-graphql and @BaseEntity() & @Column() (typeorm)class decorators. ```user.model.ts import { Field, ID, Int, ObjectType, } from 'type-graphql'; import { BaseEntity, Column,
Read the rest
Entity, PrimaryGeneratedColumn, } from 'typeorm'; @Entity() @ObjectType() export default class User extends BaseEntity { @Field(() => ID) @PrimaryGeneratedColumn() id?: typeof ID; @Field() @Column() name: string; @Field() @Column() email: string; @Field(type => Int) @Column() age: number; } ``` and this is what type-graphql auto-generates for a user schema. ```user.schema.ts # !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!! # !!! DO NOT MODIFY THIS FILE BY YOURSELF !!! type Document { author: User! authorId: ID! } type Notification { author: User! authorId: ID! } type Query { users: [User!]! } type User { age: Int! email: String! id: ID! name: String! } ```
In A REST View of GraphQL
I always hesitate to model an externally facing API to match the underlying database schema because you end up coupling consumers of the API to its internal implementation. Mind you, I'm coming from an enterprise background where systems live way longer than you expect them so, so you need that flexibility. If that's not a concern, and you want speed/ease of development, take a look at TypeGraphQL [1]. They have a couple of examples [2][3] of how nicely it plays with TypeORM. You can create one set of domain object classes, annotate them with decorators for both TypeGraphQL and TypeORM, and then expose a GraphQL schema that matches the underlying database with a minimal amount of code (you could probably even get clever with some generic fucntions to cut down the code you'd need to write for the resolvers). [1] https://typegraphql.com/ [2
Read the rest
In GraphQL Tooling, Today and Tomorrow [video]

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.