@@ -1017,34 +1017,36 @@ export interface GraphQLInterfaceTypeExtensions {
1017
1017
* });
1018
1018
* ```
1019
1019
*/
1020
- export class GraphQLInterfaceType {
1020
+ export class GraphQLInterfaceType < TSource = any , TContext = any > {
1021
1021
name : string ;
1022
1022
description : Maybe < string > ;
1023
- resolveType : Maybe < GraphQLTypeResolver < any , any > > ;
1023
+ resolveType : Maybe < GraphQLTypeResolver < TSource , TContext > > ;
1024
1024
extensions : Readonly < GraphQLInterfaceTypeExtensions > ;
1025
1025
astNode : Maybe < InterfaceTypeDefinitionNode > ;
1026
1026
extensionASTNodes : ReadonlyArray < InterfaceTypeExtensionNode > ;
1027
1027
1028
- private _fields : ThunkObjMap < GraphQLField < any , any > > ;
1028
+ private _fields : ThunkObjMap < GraphQLField < TSource , TContext > > ;
1029
1029
private _interfaces : ThunkReadonlyArray < GraphQLInterfaceType > ;
1030
1030
1031
- constructor ( config : Readonly < GraphQLInterfaceTypeConfig < any , any > > ) {
1031
+ constructor ( config : Readonly < GraphQLInterfaceTypeConfig < TSource , TContext > > ) {
1032
1032
this . name = assertName ( config . name ) ;
1033
1033
this . description = config . description ;
1034
1034
this . resolveType = config . resolveType ;
1035
1035
this . extensions = toObjMap ( config . extensions ) ;
1036
1036
this . astNode = config . astNode ;
1037
1037
this . extensionASTNodes = config . extensionASTNodes ?? [ ] ;
1038
1038
1039
- this . _fields = defineFieldMap . bind ( undefined , config . fields ) ;
1039
+ // prettier-ignore
1040
+ // FIXME: blocked by https://github.com/prettier/prettier/issues/14625
1041
+ this . _fields = ( defineFieldMap < TSource , TContext > ) . bind ( undefined , config . fields ) ;
1040
1042
this . _interfaces = defineInterfaces . bind ( undefined , config . interfaces ) ;
1041
1043
}
1042
1044
1043
1045
get [ Symbol . toStringTag ] ( ) {
1044
1046
return 'GraphQLInterfaceType' ;
1045
1047
}
1046
1048
1047
- getFields ( ) : GraphQLFieldMap < any , any > {
1049
+ getFields ( ) : GraphQLFieldMap < TSource , TContext > {
1048
1050
if ( typeof this . _fields === 'function' ) {
1049
1051
this . _fields = this . _fields ( ) ;
1050
1052
}
@@ -1058,7 +1060,7 @@ export class GraphQLInterfaceType {
1058
1060
return this . _interfaces ;
1059
1061
}
1060
1062
1061
- toConfig ( ) : GraphQLInterfaceTypeNormalizedConfig {
1063
+ toConfig ( ) : GraphQLInterfaceTypeNormalizedConfig < TSource , TContext > {
1062
1064
return {
1063
1065
name : this . name ,
1064
1066
description : this . description ,
@@ -1096,10 +1098,10 @@ export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
1096
1098
extensionASTNodes ?: Maybe < ReadonlyArray < InterfaceTypeExtensionNode > > ;
1097
1099
}
1098
1100
1099
- export interface GraphQLInterfaceTypeNormalizedConfig
1101
+ export interface GraphQLInterfaceTypeNormalizedConfig < TSource , TContext >
1100
1102
extends GraphQLInterfaceTypeConfig < any , any > {
1101
1103
interfaces : ReadonlyArray < GraphQLInterfaceType > ;
1102
- fields : GraphQLFieldConfigMap < any , any > ;
1104
+ fields : GraphQLFieldConfigMap < TSource , TContext > ;
1103
1105
extensions : Readonly < GraphQLInterfaceTypeExtensions > ;
1104
1106
extensionASTNodes : ReadonlyArray < InterfaceTypeExtensionNode > ;
1105
1107
}
0 commit comments