@@ -553,7 +553,7 @@ export class GraphQLScalarType {
553
553
astNode : ?ScalarTypeDefinitionNode ;
554
554
extensionASTNodes : ?$ReadOnlyArray < ScalarTypeExtensionNode > ;
555
555
556
- constructor ( config : GraphQLScalarTypeConfig < mixed , mixed > ) : void {
556
+ constructor ( config : $ReadOnly < GraphQLScalarTypeConfig < mixed , mixed > >) : void {
557
557
const parseValue = config . parseValue || identityFunc ;
558
558
this . name = config . name ;
559
559
this . description = config . description ;
@@ -678,7 +678,7 @@ export class GraphQLObjectType {
678
678
_fields: Thunk<GraphQLFieldMap<any, any>>;
679
679
_interfaces: Thunk<Array<GraphQLInterfaceType>>;
680
680
681
- constructor(config: GraphQLObjectTypeConfig<any, any>): void {
681
+ constructor(config: $ReadOnly< GraphQLObjectTypeConfig<any, any> >): void {
682
682
this.name = config.name;
683
683
this.description = config.description;
684
684
this.isTypeOf = config.isTypeOf;
@@ -739,9 +739,10 @@ defineToStringTag(GraphQLObjectType);
739
739
defineToJSON ( GraphQLObjectType ) ;
740
740
741
741
function defineInterfaces (
742
- config :
742
+ config : $ReadOnly <
743
743
| GraphQLObjectTypeConfig < mixed , mixed >
744
744
| GraphQLInterfaceTypeConfig < mixed , mixed > ,
745
+ > ,
745
746
) : Array < GraphQLInterfaceType > {
746
747
const interfaces = resolveThunk ( config . interfaces ) || [ ] ;
747
748
devAssert (
@@ -752,9 +753,10 @@ function defineInterfaces(
752
753
}
753
754
754
755
function defineFieldMap < TSource , TContext > (
755
- config :
756
+ config : $ReadOnly <
756
757
| GraphQLObjectTypeConfig < TSource , TContext >
757
758
| GraphQLInterfaceTypeConfig < TSource , TContext > ,
759
+ > ,
758
760
) : GraphQLFieldMap < TSource , TContext > {
759
761
const fieldMap = resolveThunk ( config . fields ) || { } ;
760
762
devAssert (
@@ -983,7 +985,7 @@ export class GraphQLInterfaceType {
983
985
_fields : Thunk < GraphQLFieldMap < any , any > > ;
984
986
_interfaces : Thunk < Array < GraphQLInterfaceType >> ;
985
987
986
- constructor ( config : GraphQLInterfaceTypeConfig < any , any > ) : void {
988
+ constructor ( config : $ReadOnly < GraphQLInterfaceTypeConfig < any , any > >) : void {
987
989
this. name = config . name ;
988
990
this . description = config . description ;
989
991
this . resolveType = config . resolveType ;
@@ -1092,7 +1094,7 @@ export class GraphQLUnionType {
1092
1094
1093
1095
_types : Thunk < Array < GraphQLObjectType > > ;
1094
1096
1095
- constructor ( config : GraphQLUnionTypeConfig < any , any > ) : void {
1097
+ constructor ( config : $ReadOnly < GraphQLUnionTypeConfig < any , any > >) : void {
1096
1098
this. name = config . name ;
1097
1099
this . description = config . description ;
1098
1100
this . resolveType = config . resolveType ;
@@ -1143,7 +1145,7 @@ defineToStringTag(GraphQLUnionType);
1143
1145
defineToJSON ( GraphQLUnionType ) ;
1144
1146
1145
1147
function defineTypes (
1146
- config : GraphQLUnionTypeConfig < mixed , mixed > ,
1148
+ config : $ReadOnly < GraphQLUnionTypeConfig < mixed , mixed > >,
1147
1149
) : Array < GraphQLObjectType > {
1148
1150
const types = resolveThunk ( config . types ) || [ ] ;
1149
1151
devAssert (
@@ -1200,7 +1202,7 @@ export class GraphQLEnumType /* <T> */ {
1200
1202
_valueLookup : Map < any /* T */ , GraphQLEnumValue > ;
1201
1203
_nameLookup : ObjMap < GraphQLEnumValue > ;
1202
1204
1203
- constructor ( config : GraphQLEnumTypeConfig /* <T> */ ) : void {
1205
+ constructor ( config : $ReadOnly < GraphQLEnumTypeConfig /* <T> */ > ) : void {
1204
1206
this. name = config . name ;
1205
1207
this . description = config . description ;
1206
1208
this . extensions = config . extensions && toObjMap ( config . extensions ) ;
@@ -1374,7 +1376,7 @@ export class GraphQLInputObjectType {
1374
1376
1375
1377
_fields : Thunk < GraphQLInputFieldMap > ;
1376
1378
1377
- constructor ( config : GraphQLInputObjectTypeConfig ) : void {
1379
+ constructor ( config : $ReadOnly < GraphQLInputObjectTypeConfig > ) : void {
1378
1380
this. name = config . name ;
1379
1381
this . description = config . description ;
1380
1382
this . extensions = config . extensions && toObjMap ( config . extensions ) ;
@@ -1426,7 +1428,7 @@ defineToStringTag(GraphQLInputObjectType);
1426
1428
defineToJSON ( GraphQLInputObjectType ) ;
1427
1429
1428
1430
function defineInputFieldMap (
1429
- config : GraphQLInputObjectTypeConfig ,
1431
+ config : $ReadOnly < GraphQLInputObjectTypeConfig > ,
1430
1432
) : GraphQLInputFieldMap {
1431
1433
const fieldMap = resolveThunk ( config . fields ) || { } ;
1432
1434
devAssert (
0 commit comments