Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using TypeGrahql to generate schemas instead of using gpq #25

Open
hatim-heffoudhi opened this issue Jul 6, 2020 · 0 comments
Open

Comments

@hatim-heffoudhi
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant