Skip to content

Commit 56fee7d

Browse files
committed
Rename repeatableisRepeatable
1 parent ae9e7f9 commit 56fee7d

19 files changed

Lines changed: 34 additions & 33 deletions

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ input Hello {
823823
},
824824
},
825825
arguments: [],
826-
repeatable: false,
826+
isRepeatable: false,
827827
locations: [
828828
{
829829
kind: 'Name',
@@ -874,7 +874,7 @@ input Hello {
874874
},
875875
},
876876
arguments: [],
877-
repeatable: true,
877+
isRepeatable: true,
878878
locations: [
879879
{
880880
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-
+repeatable: boolean,
511+
+isRepeatable: 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
@@ -1395,7 +1395,7 @@ function parseDirectiveDefinition(lexer: Lexer<*>): DirectiveDefinitionNode {
13951395
description,
13961396
name,
13971397
arguments: args,
1398-
repeatable,
1398+
isRepeatable: repeatable,
13991399
locations,
14001400
loc: loc(lexer, start),
14011401
};

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, repeatable }) =>
184+
({ name, arguments: args, locations, isRepeatable }) =>
185185
'directive @' +
186186
name +
187187
(args.every(arg => arg.indexOf('\n') === -1)
188188
? wrap('(', join(args, ', '), ')')
189189
: wrap('(\n', indent(join(args, '\n')), '\n)')) +
190-
(repeatable ? ' repeatable' : '') +
190+
(isRepeatable ? ' repeatable' : '') +
191191
' on ' +
192192
join(locations, ' | '),
193193
),

src/type/__tests__/introspection-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ describe('Introspection', () => {
704704
args: [],
705705
deprecationReason: null,
706706
isDeprecated: false,
707-
name: 'repeatable',
707+
name: 'isRepeatable',
708708
type: {
709709
kind: 'NON_NULL',
710710
name: null,
@@ -921,7 +921,7 @@ describe('Introspection', () => {
921921
defaultValue: null,
922922
},
923923
],
924-
repeatable: false,
924+
isRepeatable: false,
925925
},
926926
{
927927
name: 'skip',
@@ -941,7 +941,7 @@ describe('Introspection', () => {
941941
defaultValue: null,
942942
},
943943
],
944-
repeatable: false,
944+
isRepeatable: false,
945945
},
946946
{
947947
name: 'deprecated',
@@ -957,7 +957,7 @@ describe('Introspection', () => {
957957
defaultValue: '"No longer supported"',
958958
},
959959
],
960-
repeatable: false,
960+
isRepeatable: false,
961961
},
962962
]);
963963
});

src/type/directives.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ export class GraphQLDirective {
4444
locations: Array<DirectiveLocationEnum>;
4545
args: Array<GraphQLArgument>;
4646
astNode: ?DirectiveDefinitionNode;
47-
repeatable: boolean;
47+
isRepeatable: 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.repeatable = config.repeatable == null ? false : config.repeatable;
54+
this.isRepeatable =
55+
config.isRepeatable == null ? false : config.isRepeatable;
5556

5657
invariant(config.name, 'Directive must be named.');
5758
invariant(
@@ -95,7 +96,7 @@ export type GraphQLDirectiveConfig = {|
9596
locations: Array<DirectiveLocationEnum>,
9697
args?: ?GraphQLFieldConfigArgumentMap,
9798
astNode?: ?DirectiveDefinitionNode,
98-
repeatable?: ?boolean,
99+
isRepeatable?: ?boolean,
99100
|};
100101

101102
/**

src/type/introspection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ export const __Directive = new GraphQLObjectType({
9898
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))),
9999
resolve: directive => directive.args || [],
100100
},
101-
repeatable: {
101+
isRepeatable: {
102102
type: GraphQLNonNull(GraphQLBoolean),
103103
description:
104104
'Permits using the directive multiple times at the same location.',
105-
resolve: directive => directive.repeatable,
105+
resolve: directive => directive.isRepeatable,
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').repeatable).to.equal(true);
107+
expect(schema.getDirective('foo').isRepeatable).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-
repeatable: true,
599+
isRepeatable: 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-
repeatable: true,
123+
isRepeatable: true,
124124
locations: [DirectiveLocation.OBJECT, DirectiveLocation.INTERFACE],
125125
});
126126

0 commit comments

Comments
 (0)