-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The entity __resolveReference resolver is currently placed directly on to GraphQL*Type objects. This breaks the API, as the expectation is to put things like this on to the `extensions` field of objects contained within a GraphQLSchema. This moves the resolver off of the object and into the extensions where it belongs. Fixes: #1131 Fixes: ardatan/graphql-tools#2687 Fixes: ardatan/graphql-tools#2857
- Loading branch information
1 parent
4fbf2ff
commit 4e3c161
Showing
5 changed files
with
100 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { GraphQLResolveInfo } from 'graphql'; | ||
|
||
type GraphQLReferenceResolver<TContext> = ( | ||
reference: object, | ||
context: TContext, | ||
info: GraphQLResolveInfo, | ||
) => any; | ||
|
||
interface ApolloSubgraphExtensions<TContext> { | ||
resolveReference?: GraphQLReferenceResolver<TContext>; | ||
} | ||
|
||
declare module 'graphql/type/definition' { | ||
interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> { | ||
apollo?: { | ||
subgraph?: ApolloSubgraphExtensions<_TContext>; | ||
} | ||
} | ||
|
||
interface GraphQLInterfaceTypeExtensions<_TSource = any, _TContext = any> { | ||
apollo?: { | ||
subgraph?: ApolloSubgraphExtensions<_TContext>; | ||
} | ||
} | ||
|
||
interface GraphQLUnionTypeExtensions<_TSource = any, _TContext = any> { | ||
apollo?: { | ||
subgraph?: ApolloSubgraphExtensions<_TContext>; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters