@@ -721,8 +721,8 @@ export class GraphQLObjectType<TSource = any, TContext = any> {
721
721
722
722
// prettier-ignore
723
723
// FIXME: blocked by https://github.com/prettier/prettier/issues/14625
724
- this . _fields = ( defineFieldMap < TSource , TContext > ) . bind ( undefined , config ) ;
725
- this . _interfaces = defineInterfaces . bind ( undefined , config ) ;
724
+ this . _fields = ( defineFieldMap < TSource , TContext > ) . bind ( undefined , config . fields ) ;
725
+ this . _interfaces = defineInterfaces . bind ( undefined , config . interfaces ) ;
726
726
}
727
727
728
728
get [ Symbol . toStringTag ] ( ) {
@@ -766,20 +766,15 @@ export class GraphQLObjectType<TSource = any, TContext = any> {
766
766
}
767
767
768
768
function defineInterfaces (
769
- config : Readonly <
770
- GraphQLObjectTypeConfig < any , any > | GraphQLInterfaceTypeConfig < any , any >
771
- > ,
769
+ interfaces : Maybe < ThunkReadonlyArray < GraphQLInterfaceType > > ,
772
770
) : ReadonlyArray < GraphQLInterfaceType > {
773
- return resolveReadonlyArrayThunk ( config . interfaces ?? [ ] ) ;
771
+ return resolveReadonlyArrayThunk ( interfaces ?? [ ] ) ;
774
772
}
775
773
776
774
function defineFieldMap < TSource , TContext > (
777
- config : Readonly <
778
- | GraphQLObjectTypeConfig < TSource , TContext >
779
- | GraphQLInterfaceTypeConfig < TSource , TContext >
780
- > ,
775
+ fields : ThunkObjMap < GraphQLFieldConfig < TSource , TContext > > ,
781
776
) : GraphQLFieldMap < TSource , TContext > {
782
- const fieldMap = resolveObjMapThunk ( config . fields ) ;
777
+ const fieldMap = resolveObjMapThunk ( fields ) ;
783
778
784
779
return mapValue ( fieldMap , ( fieldConfig , fieldName ) => {
785
780
const argsConfig = fieldConfig . args ?? { } ;
@@ -798,9 +793,9 @@ function defineFieldMap<TSource, TContext>(
798
793
}
799
794
800
795
export function defineArguments (
801
- config : GraphQLFieldConfigArgumentMap ,
796
+ args : GraphQLFieldConfigArgumentMap ,
802
797
) : ReadonlyArray < GraphQLArgument > {
803
- return Object . entries ( config ) . map ( ( [ argName , argConfig ] ) => ( {
798
+ return Object . entries ( args ) . map ( ( [ argName , argConfig ] ) => ( {
804
799
name : assertName ( argName ) ,
805
800
description : argConfig . description ,
806
801
type : argConfig . type ,
@@ -1041,8 +1036,8 @@ export class GraphQLInterfaceType {
1041
1036
this . astNode = config . astNode ;
1042
1037
this . extensionASTNodes = config . extensionASTNodes ?? [ ] ;
1043
1038
1044
- this . _fields = defineFieldMap . bind ( undefined , config ) ;
1045
- this . _interfaces = defineInterfaces . bind ( undefined , config ) ;
1039
+ this . _fields = defineFieldMap . bind ( undefined , config . fields ) ;
1040
+ this . _interfaces = defineInterfaces . bind ( undefined , config . interfaces ) ;
1046
1041
}
1047
1042
1048
1043
get [ Symbol . toStringTag ] ( ) {
@@ -1164,7 +1159,7 @@ export class GraphQLUnionType {
1164
1159
this . astNode = config . astNode ;
1165
1160
this . extensionASTNodes = config . extensionASTNodes ?? [ ] ;
1166
1161
1167
- this . _types = defineTypes . bind ( undefined , config ) ;
1162
+ this . _types = defineTypes . bind ( undefined , config . types ) ;
1168
1163
}
1169
1164
1170
1165
get [ Symbol . toStringTag ] ( ) {
@@ -1200,9 +1195,9 @@ export class GraphQLUnionType {
1200
1195
}
1201
1196
1202
1197
function defineTypes (
1203
- config : Readonly < GraphQLUnionTypeConfig < unknown , unknown > > ,
1198
+ types : ThunkReadonlyArray < GraphQLObjectType > ,
1204
1199
) : ReadonlyArray < GraphQLObjectType > {
1205
- return resolveReadonlyArrayThunk ( config . types ) ;
1200
+ return resolveReadonlyArrayThunk ( types ) ;
1206
1201
}
1207
1202
1208
1203
export interface GraphQLUnionTypeConfig < TSource , TContext > {
@@ -1503,7 +1498,7 @@ export class GraphQLInputObjectType {
1503
1498
this . astNode = config . astNode ;
1504
1499
this . extensionASTNodes = config . extensionASTNodes ?? [ ] ;
1505
1500
1506
- this . _fields = defineInputFieldMap . bind ( undefined , config ) ;
1501
+ this . _fields = defineInputFieldMap . bind ( undefined , config . fields ) ;
1507
1502
}
1508
1503
1509
1504
get [ Symbol . toStringTag ] ( ) {
@@ -1547,9 +1542,9 @@ export class GraphQLInputObjectType {
1547
1542
}
1548
1543
1549
1544
function defineInputFieldMap (
1550
- config : Readonly < GraphQLInputObjectTypeConfig > ,
1545
+ fields : ThunkObjMap < GraphQLInputFieldConfig > ,
1551
1546
) : GraphQLInputFieldMap {
1552
- const fieldMap = resolveObjMapThunk ( config . fields ) ;
1547
+ const fieldMap = resolveObjMapThunk ( fields ) ;
1553
1548
return mapValue ( fieldMap , ( fieldConfig , fieldName ) => ( {
1554
1549
name : assertName ( fieldName ) ,
1555
1550
description : fieldConfig . description ,
0 commit comments