example-todo
example-todo copied to clipboard
Using TypeGrahql to generate schemas instead of using gpq
Hello, It' will be a nice feature, if we can create a common model or just the model (input and types) in typescript class adding some decorators to generate schema, by using the library typegraphql
@ObjectType()
class Recipe {
@Field(type => ID)
id: string;
@Field()
title: string;
@Field({ nullable: true })
description?: string;
@Field()
creationDate: Date;
@Field(type => [String])
ingredients: string[];
}
with this, we can avoid boilerplate code and some duplicates...