Skip to content

Commit

Permalink
Added support for repeatable directives in extendSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIlyenko committed Oct 4, 2018
1 parent 20deb26 commit 1180d92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utilities/__tests__/extendSchema-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ const FooDirective = new GraphQLDirective({
],
});

const RepeatableDirective = new GraphQLDirective({
name: 'repeatableDirective',
args: {
input: { type: SomeInputType },
},
repeatable: true,
locations: [DirectiveLocation.OBJECT, DirectiveLocation.INTERFACE],
});

const testSchema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
Expand All @@ -134,7 +143,7 @@ const testSchema = new GraphQLSchema({
}),
}),
types: [FooType, BarType],
directives: specifiedDirectives.concat([FooDirective]),
directives: specifiedDirectives.concat([FooDirective, RepeatableDirective]),
});

function extendTestSchema(sdl, options) {
Expand Down
1 change: 1 addition & 0 deletions src/utilities/extendSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ export function extendSchema(
locations: directive.locations,
args: extendArgs(directive.args),
astNode: directive.astNode,
repeatable: directive.repeatable,
});
}

Expand Down

0 comments on commit 1180d92

Please sign in to comment.