Instantly share code, notes, and snippets.
⚛️
Mid React Developer
hylickipiotr
/ author.entity.ts
Created
November 8, 2020 23:41
— forked from umutyerebakmaz/author.entity.ts
TypeORM many to many lazy relation jointable custom table name TypeGraphQL Example (with bi-directional conect GraphQL Approach)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, ManyToMany } from 'typeorm'; | |
import { ObjectType, Field, ID, InputType, ArgsType, Int } from 'type-graphql'; | |
import { Book } from '../book/book.entity'; | |
@Entity() | |
@ObjectType() | |
export class Author extends BaseEntity { | |
@PrimaryGeneratedColumn("uuid") | |
@Field(type => ID) |
hylickipiotr
/ author.entity.ts
Created
November 8, 2020 23:41
— forked from umutyerebakmaz/author.entity.ts
TypeORM many to many lazy relation jointable custom table name TypeGraphQL Example (with bi-directional conect GraphQL Approach)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, ManyToMany } from 'typeorm'; | |
import { ObjectType, Field, ID, InputType, ArgsType, Int } from 'type-graphql'; | |
import { Book } from '../book/book.entity'; | |
@Entity() | |
@ObjectType() | |
export class Author extends BaseEntity { | |
@PrimaryGeneratedColumn("uuid") | |
@Field(type => ID) |