Skip to content

Commit 89f5780

Browse files
committed
Use name repeatable instead of isRepeatable in all places except introspection
1 parent 1a07bd9 commit 89f5780

16 files changed

Lines changed: 21 additions & 22 deletions

src/language/__tests__/schema-parser-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ input Hello {
833833
},
834834
},
835835
arguments: [],
836-
isRepeatable: false,
836+
repeatable: false,
837837
locations: [
838838
{
839839
kind: 'Name',
@@ -884,7 +884,7 @@ input Hello {
884884
},
885885
},
886886
arguments: [],
887-
isRepeatable: true,
887+
repeatable: true,
888888
locations: [
889889
{
890890
kind: 'Name',

src/language/ast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ export type DirectiveDefinitionNode = {
508508
+description?: StringValueNode,
509509
+name: NameNode,
510510
+arguments?: $ReadOnlyArray<InputValueDefinitionNode>,
511-
+isRepeatable: boolean,
511+
+repeatable: boolean,
512512
+locations: $ReadOnlyArray<NameNode>,
513513
};
514514

src/language/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ function parseDirectiveDefinition(lexer: Lexer<*>): DirectiveDefinitionNode {
13681368
description,
13691369
name,
13701370
arguments: args,
1371-
isRepeatable: repeatable,
1371+
repeatable,
13721372
locations,
13731373
loc: loc(lexer, start),
13741374
};

src/language/printer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ const printDocASTReducer = {
181181
),
182182

183183
DirectiveDefinition: addDescription(
184-
({ name, arguments: args, locations, isRepeatable }) =>
184+
({ name, arguments: args, locations, repeatable }) =>
185185
'directive @' +
186186
name +
187187
(hasMultilineItems(args)
188188
? wrap('(\n', indent(join(args, '\n')), '\n)')
189189
: wrap('(', join(args, ', '), ')')) +
190-
(isRepeatable ? ' repeatable' : '') +
190+
(repeatable ? ' repeatable' : '') +
191191
' on ' +
192192
join(locations, ' | '),
193193
),

src/type/directives.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ export class GraphQLDirective {
4444
locations: Array<DirectiveLocationEnum>;
4545
args: Array<GraphQLArgument>;
4646
astNode: ?DirectiveDefinitionNode;
47-
isRepeatable: boolean;
47+
repeatable: boolean;
4848

4949
constructor(config: GraphQLDirectiveConfig): void {
5050
this.name = config.name;
5151
this.description = config.description;
5252
this.locations = config.locations;
5353
this.astNode = config.astNode;
54-
this.isRepeatable =
55-
config.isRepeatable == null ? false : config.isRepeatable;
54+
this.repeatable = config.repeatable == null ? false : config.repeatable;
5655

5756
invariant(config.name, 'Directive must be named.');
5857
invariant(
@@ -96,7 +95,7 @@ export type GraphQLDirectiveConfig = {|
9695
locations: Array<DirectiveLocationEnum>,
9796
args?: ?GraphQLFieldConfigArgumentMap,
9897
astNode?: ?DirectiveDefinitionNode,
99-
isRepeatable?: ?boolean,
98+
repeatable?: ?boolean,
10099
|};
101100

102101
/**

src/type/introspection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const __Directive = new GraphQLObjectType({
102102
type: GraphQLNonNull(GraphQLBoolean),
103103
description:
104104
'Permits using the directive multiple times at the same location.',
105-
resolve: directive => directive.isRepeatable,
105+
resolve: directive => directive.repeatable,
106106
},
107107
}),
108108
});

src/utilities/__tests__/buildASTSchema-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('Schema Builder', () => {
104104
expect(output).to.equal(body);
105105

106106
const schema = buildASTSchema(parse(body));
107-
expect(schema.getDirective('foo').isRepeatable).to.equal(true);
107+
expect(schema.getDirective('foo').repeatable).to.equal(true);
108108
});
109109

110110
it('Supports descriptions', () => {

src/utilities/__tests__/buildClientSchema-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ describe('Type System: build schema from introspection', () => {
596596
new GraphQLDirective({
597597
name: 'customRepeatableDirective',
598598
description: 'This is a custom repeatable directive',
599-
isRepeatable: true,
599+
repeatable: true,
600600
locations: ['FIELD'],
601601
}),
602602
],

src/utilities/__tests__/extendSchema-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const RepeatableDirective = new GraphQLDirective({
120120
args: {
121121
input: { type: SomeInputType },
122122
},
123-
isRepeatable: true,
123+
repeatable: true,
124124
locations: [DirectiveLocation.OBJECT, DirectiveLocation.INTERFACE],
125125
});
126126

src/utilities/buildASTSchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export class ASTDefinitionBuilder {
282282
args:
283283
directiveNode.arguments &&
284284
this._makeInputValues(directiveNode.arguments),
285-
isRepeatable: directiveNode.isRepeatable,
285+
repeatable: directiveNode.repeatable,
286286
astNode: directiveNode,
287287
});
288288
}

0 commit comments

Comments
 (0)