Skip to content

Commit

Permalink
Fix IDirectiveResolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Mar 4, 2019
1 parent ad87548 commit bba039a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/plugins/typescript-resolvers/src/root.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export type IResolvers<TContext = {{{ getContext }}}> = {
{{/each}}
} & { [typeName: string] : { [ fieldName: string ]: ( Resolver<any, any, TContext, any> | SubscriptionResolver<any, any, TContext, any> ) } };

export type IDirectiveResolvers<Result> = {
export type IDirectiveResolvers<Result, TContext = {{{ getContext }}> = {
{{#each definedDirectives}}
{{ name }}{{#unless @root.config.strict}}?{{/unless}}: {{ convert name 'typeNames'}}DirectiveResolver<Result>;
{{/each}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ describe('Resolvers', () => {
`);

expect(content).toBeSimilarStringTo(`
export type IDirectiveResolvers<Result> = {
export type IDirectiveResolvers<Result, TContext = {}> = {
modify?: ModifyDirectiveResolver<Result>;
skip?: SkipDirectiveResolver<Result>;
include?: IncludeDirectiveResolver<Result>;
Expand Down

0 comments on commit bba039a

Please sign in to comment.