Skip to content

Commit b349a69

Browse files
committed
Add GraphQLTypeResolveFn
1 parent 57d71e1 commit b349a69

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/type/definition.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ type GraphQLInterfacesThunk = () => Array<GraphQLInterfaceType>;
467467

468468
type GraphQLFieldConfigMapThunk = () => GraphQLFieldConfigMap;
469469

470+
export type GraphQLTypeResolveFn = (
471+
value: mixed,
472+
info?: GraphQLResolveInfo
473+
) => ?GraphQLObjectType
474+
470475
export type GraphQLFieldResolveFn = (
471476
source: mixed,
472477
args: {[argName: string]: mixed},
@@ -550,7 +555,7 @@ export type GraphQLFieldDefinitionMap = {
550555
export class GraphQLInterfaceType {
551556
name: string;
552557
description: ?string;
553-
resolveType: ?(value: mixed, info?: GraphQLResolveInfo) => ?GraphQLObjectType;
558+
resolveType: ?GraphQLTypeResolveFn;
554559

555560
_typeConfig: GraphQLInterfaceTypeConfig;
556561
_fields: GraphQLFieldDefinitionMap;
@@ -621,7 +626,7 @@ export type GraphQLInterfaceTypeConfig = {
621626
* the default implementation will call `isTypeOf` on each implementing
622627
* Object type.
623628
*/
624-
resolveType?: (value: mixed, info?: GraphQLResolveInfo) => ?GraphQLObjectType,
629+
resolveType?: GraphQLTypeResolveFn,
625630
description?: ?string
626631
};
627632

@@ -653,7 +658,7 @@ export type GraphQLInterfaceTypeConfig = {
653658
export class GraphQLUnionType {
654659
name: string;
655660
description: ?string;
656-
resolveType: ?(value: mixed, info?: GraphQLResolveInfo) => ?GraphQLObjectType;
661+
resolveType: ?GraphQLTypeResolveFn;
657662

658663
_typeConfig: GraphQLUnionTypeConfig;
659664
_types: Array<GraphQLObjectType>;
@@ -728,7 +733,7 @@ export type GraphQLUnionTypeConfig = {
728733
* the default implementation will call `isTypeOf` on each implementing
729734
* Object type.
730735
*/
731-
resolveType?: (value: mixed, info?: GraphQLResolveInfo) => ?GraphQLObjectType;
736+
resolveType?: GraphQLTypeResolveFn;
732737
description?: ?string;
733738
};
734739

0 commit comments

Comments
 (0)