Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Use external library for type definitions #11

Open
pie6k opened this issue Apr 3, 2018 · 0 comments
Open

Use external library for type definitions #11

pie6k opened this issue Apr 3, 2018 · 0 comments

Comments

@pie6k
Copy link

pie6k commented Apr 3, 2018

GraphqlFieldConfig interface for defining types is glueing code definition with this very framework/boilerplate.

What do you think about using some external library like https://github.com/prismake/typegql

@ObjectType({ description: 'Simple product object type' })
class Product {
  @Field() name: string;

  @Field() price: number;

  @Field()
  isExpensive() {
    return this.price > 50;
  }
}

It allows you to define type in such way, but it still compiles to plain GraphQL object type that will work with every schema

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

No branches or pull requests

1 participant