Skip to content
Discussion options

You must be logged in to vote

I think the main reason (or at least my main reason) for using the typescript-resolvers plugin is to automatically generate types for an Apollo like resolver. Here is an example I made a few weeks ago.

Without the plugin the typing of all your resolvers would be (any, any, any, any). This is not ideal in a TS project. However, if you use the plugin and type your root resolver correctly you get strongly typed resolvers.

 track?: Resolver<ResolversTypes['Track'], ParentType, ContextType, RequireFields<QueryTrackArgs, 'id'>>;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nimmolo
Comment options

Answer selected by nimmolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants