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,
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!
}
```