@@ -35,7 +35,6 @@ import type {
35
35
OperationDefinitionNode ,
36
36
FieldNode ,
37
37
FragmentDefinitionNode ,
38
- DirectiveNode ,
39
38
ValueNode ,
40
39
} from '../language/ast' ;
41
40
import type { GraphQLSchema } from './schema' ;
@@ -542,8 +541,6 @@ export class GraphQLScalarType {
542
541
astNode : ?ScalarTypeDefinitionNode ;
543
542
extensionASTNodes : ?$ReadOnlyArray < ScalarTypeExtensionNode > ;
544
543
545
- _directives : ?$ReadOnlyArray < DirectiveNode > ;
546
-
547
544
constructor ( config : GraphQLScalarTypeConfig < * , * > ) : void {
548
545
this . name = config . name ;
549
546
this . description = config . description ;
@@ -569,28 +566,6 @@ export class GraphQLScalarType {
569
566
}
570
567
}
571
568
572
- getDirectives ( ) : $ReadOnlyArray < DirectiveNode > {
573
- if ( this . _directives ) {
574
- return this . _directives ;
575
- }
576
-
577
- const directives = [ ] ;
578
- if ( this . astNode && this . astNode . directives ) {
579
- directives . push ( ...this . astNode . directives ) ;
580
- }
581
- const extensionASTNodes = this . extensionASTNodes ;
582
- if ( extensionASTNodes ) {
583
- for ( let i = 0 ; i < extensionASTNodes . length ; i ++ ) {
584
- const extensionNode = extensionASTNodes [ i ] ;
585
- if ( extensionNode . directives ) {
586
- directives . push ( ...extensionNode . directives ) ;
587
- }
588
- }
589
- }
590
- this . _directives = directives ;
591
- return directives ;
592
- }
593
-
594
569
toString ( ) : string {
595
570
return this . name ;
596
571
}
@@ -666,7 +641,6 @@ export class GraphQLObjectType {
666
641
667
642
_fields : Thunk < GraphQLFieldMap < * , * > > ;
668
643
_interfaces : Thunk < Array < GraphQLInterfaceType > > ;
669
- _directives : ?$ReadOnlyArray < DirectiveNode > ;
670
644
671
645
constructor ( config : GraphQLObjectTypeConfig < * , * > ) : void {
672
646
this . name = config . name ;
@@ -685,28 +659,6 @@ export class GraphQLObjectType {
685
659
}
686
660
}
687
661
688
- getDirectives ( ) : $ReadOnlyArray < DirectiveNode > {
689
- if ( this . _directives ) {
690
- return this . _directives ;
691
- }
692
-
693
- const directives = [ ] ;
694
- if ( this . astNode && this . astNode . directives ) {
695
- directives . push ( ...this . astNode . directives ) ;
696
- }
697
- const extensionASTNodes = this . extensionASTNodes ;
698
- if ( extensionASTNodes ) {
699
- for ( let i = 0 ; i < extensionASTNodes . length ; i ++ ) {
700
- const extensionNode = extensionASTNodes [ i ] ;
701
- if ( extensionNode . directives ) {
702
- directives . push ( ...extensionNode . directives ) ;
703
- }
704
- }
705
- }
706
- this . _directives = directives ;
707
- return directives ;
708
- }
709
-
710
662
getFields ( ) : GraphQLFieldMap < * , * > {
711
663
if ( typeof this . _fields === 'function' ) {
712
664
this . _fields = this . _fields ( ) ;
@@ -942,7 +894,6 @@ export class GraphQLInterfaceType {
942
894
resolveType : ?GraphQLTypeResolver < * , * > ;
943
895
944
896
_fields : Thunk < GraphQLFieldMap < * , * > > ;
945
- _directives : ?$ReadOnlyArray < DirectiveNode > ;
946
897
947
898
constructor ( config : GraphQLInterfaceTypeConfig < * , * > ) : void {
948
899
this . name = config . name ;
@@ -960,28 +911,6 @@ export class GraphQLInterfaceType {
960
911
}
961
912
}
962
913
963
- getDirectives ( ) : $ReadOnlyArray < DirectiveNode > {
964
- if ( this . _directives ) {
965
- return this . _directives ;
966
- }
967
-
968
- const directives = [ ] ;
969
- if ( this . astNode && this . astNode . directives ) {
970
- directives . push ( ...this . astNode . directives ) ;
971
- }
972
- const extensionASTNodes = this . extensionASTNodes ;
973
- if ( extensionASTNodes ) {
974
- for ( let i = 0 ; i < extensionASTNodes . length ; i ++ ) {
975
- const extensionNode = extensionASTNodes [ i ] ;
976
- if ( extensionNode . directives ) {
977
- directives . push ( ...extensionNode . directives ) ;
978
- }
979
- }
980
- }
981
- this . _directives = directives ;
982
- return directives ;
983
- }
984
-
985
914
getFields ( ) : GraphQLFieldMap < * , * > {
986
915
if ( typeof this . _fields === 'function' ) {
987
916
this . _fields = this . _fields ( ) ;
@@ -1043,7 +972,6 @@ export class GraphQLUnionType {
1043
972
resolveType : ?GraphQLTypeResolver < * , * > ;
1044
973
1045
974
_types : Thunk < Array < GraphQLObjectType > > ;
1046
- _directives : ?$ReadOnlyArray < DirectiveNode > ;
1047
975
1048
976
constructor ( config : GraphQLUnionTypeConfig < * , * > ) : void {
1049
977
this . name = config . name ;
@@ -1061,28 +989,6 @@ export class GraphQLUnionType {
1061
989
}
1062
990
}
1063
991
1064
- getDirectives ( ) : $ReadOnlyArray < DirectiveNode > {
1065
- if ( this . _directives ) {
1066
- return this . _directives ;
1067
- }
1068
-
1069
- const directives = [ ] ;
1070
- if ( this . astNode && this . astNode . directives ) {
1071
- directives . push ( ...this . astNode . directives ) ;
1072
- }
1073
- const extensionASTNodes = this . extensionASTNodes ;
1074
- if ( extensionASTNodes ) {
1075
- for ( let i = 0 ; i < extensionASTNodes . length ; i ++ ) {
1076
- const extensionNode = extensionASTNodes [ i ] ;
1077
- if ( extensionNode . directives ) {
1078
- directives . push ( ...extensionNode . directives ) ;
1079
- }
1080
- }
1081
- }
1082
- this . _directives = directives ;
1083
- return directives ;
1084
- }
1085
-
1086
992
getTypes ( ) : Array < GraphQLObjectType > {
1087
993
if ( typeof this . _types === 'function' ) {
1088
994
this . _types = this . _types ( ) ;
@@ -1152,7 +1058,6 @@ export class GraphQLEnumType /* <T> */ {
1152
1058
astNode : ?EnumTypeDefinitionNode ;
1153
1059
extensionASTNodes : ?$ReadOnlyArray < EnumTypeExtensionNode > ;
1154
1060
1155
- _directives : ?$ReadOnlyArray < DirectiveNode > ;
1156
1061
_values : Array < GraphQLEnumValue /* <T> */ > ;
1157
1062
_valueLookup : Map < any /* T */ , GraphQLEnumValue > ;
1158
1063
_nameLookup : ObjMap < GraphQLEnumValue > ;
@@ -1171,28 +1076,6 @@ export class GraphQLEnumType /* <T> */ {
1171
1076
invariant ( typeof config . name === 'string' , 'Must provide name.' ) ;
1172
1077
}
1173
1078
1174
- getDirectives ( ) : $ReadOnlyArray < DirectiveNode > {
1175
- if ( this . _directives ) {
1176
- return this . _directives ;
1177
- }
1178
-
1179
- const directives = [ ] ;
1180
- if ( this . astNode && this . astNode . directives ) {
1181
- directives . push ( ...this . astNode . directives ) ;
1182
- }
1183
- const extensionASTNodes = this . extensionASTNodes ;
1184
- if ( extensionASTNodes ) {
1185
- for ( let i = 0 ; i < extensionASTNodes . length ; i ++ ) {
1186
- const extensionNode = extensionASTNodes [ i ] ;
1187
- if ( extensionNode . directives ) {
1188
- directives . push ( ...extensionNode . directives ) ;
1189
- }
1190
- }
1191
- }
1192
- this . _directives = directives ;
1193
- return directives ;
1194
- }
1195
-
1196
1079
getValues ( ) : Array < GraphQLEnumValue /* <T> */ > {
1197
1080
return this . _values ;
1198
1081
}
@@ -1321,7 +1204,6 @@ export class GraphQLInputObjectType {
1321
1204
astNode : ?InputObjectTypeDefinitionNode ;
1322
1205
extensionASTNodes : ?$ReadOnlyArray < InputObjectTypeExtensionNode > ;
1323
1206
1324
- _directives : ?$ReadOnlyArray < DirectiveNode > ;
1325
1207
_fields : Thunk < GraphQLInputFieldMap > ;
1326
1208
1327
1209
constructor ( config : GraphQLInputObjectTypeConfig ) : void {
@@ -1333,28 +1215,6 @@ export class GraphQLInputObjectType {
1333
1215
invariant ( typeof config . name === 'string' , 'Must provide name.' ) ;
1334
1216
}
1335
1217
1336
- getDirectives ( ) : $ReadOnlyArray < DirectiveNode > {
1337
- if ( this . _directives ) {
1338
- return this . _directives ;
1339
- }
1340
-
1341
- const directives = [ ] ;
1342
- if ( this . astNode && this . astNode . directives ) {
1343
- directives . push ( ...this . astNode . directives ) ;
1344
- }
1345
- const extensionASTNodes = this . extensionASTNodes ;
1346
- if ( extensionASTNodes ) {
1347
- for ( let i = 0 ; i < extensionASTNodes . length ; i ++ ) {
1348
- const extensionNode = extensionASTNodes [ i ] ;
1349
- if ( extensionNode . directives ) {
1350
- directives . push ( ...extensionNode . directives ) ;
1351
- }
1352
- }
1353
- }
1354
- this . _directives = directives ;
1355
- return directives ;
1356
- }
1357
-
1358
1218
getFields ( ) : GraphQLInputFieldMap {
1359
1219
if ( typeof this . _fields === 'function' ) {
1360
1220
this . _fields = this . _fields ( ) ;
0 commit comments