Skip to content

Commit 11f90a2

Browse files
committed
fix(federation): add reference resolver type to resolver map
Fixes #2205 by adding a type definition for `__resolveReference` to the existing `GraphQLResolverMap` interface.
1 parent ba3175e commit 11f90a2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

subgraph-js/src/schema-helper/resolverMap.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { GraphQLFieldResolver, GraphQLScalarType, DocumentNode } from 'graphql';
2+
import type { GraphQLReferenceResolver } from '../schemaExtensions';
23

34
export interface GraphQLSchemaModule {
45
typeDefs: DocumentNode;
@@ -8,15 +9,17 @@ export interface GraphQLSchemaModule {
89
// eslint-disable-next-line @typescript-eslint/ban-types
910
export interface GraphQLResolverMap<TContext = {}> {
1011
[typeName: string]:
11-
| {
12+
| ({
1213
[fieldName: string]:
1314
| GraphQLFieldResolver<any, TContext>
1415
| {
1516
requires?: string;
1617
resolve?: GraphQLFieldResolver<any, TContext>;
1718
subscribe?: GraphQLFieldResolver<any, TContext>;
1819
};
19-
}
20+
} & {
21+
__resolveReference: GraphQLReferenceResolver<TContext>;
22+
})
2023
| GraphQLScalarType
2124
| {
2225
[enumValue: string]: string | number;

0 commit comments

Comments
 (0)