Skip to content

Instantly share code, notes, and snippets.

@riivanov
riivanov / todo.entity.ts
Created February 1, 2023 16:36
Todo entity that is both an ORM entity, and part of a GQL schema definition
import { Field, ID, InputType, ObjectType } from "type-graphql";
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
@ObjectType()
@Entity()
export class Todo {
@Field()
@PrimaryGeneratedColumn()
id: number;