Matt Lim
1 min readSep 29, 2020

--

I looked into this a bit more, and am not sure about this point: "the additional fields or methods doesn't pollute the type signature". Even if you define a field resolver outside of the class (i.e. not inline), it looks like you still need to declare the property in the class. For example, the Recipe class (https://github.com/MichalLytek/type-graphql/blob/master/examples/simple-usage/recipe-type.ts) has a ratingsCount field, and the resolver is defined here https://github.com/MichalLytek/type-graphql/blob/master/examples/simple-usage/recipe-resolver.ts.

--

--

Matt Lim
Matt Lim

Written by Matt Lim

Software Engineer. Tweeting @pencilflip. Mediocre boulderer, amateur tennis player, terrible at Avalon. https://www.mattlim.me/

Responses (1)