File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ import { getVariableValues, getArgumentValues } from './values';
1818import {
1919 GraphQLScalarType ,
2020 GraphQLObjectType ,
21- GraphQLInterfaceType ,
22- GraphQLUnionType ,
2321 GraphQLEnumType ,
2422 GraphQLList ,
25- GraphQLNonNull
23+ GraphQLNonNull ,
24+ isAbstractType
2625} from '../type/definition' ;
2726import type {
2827 GraphQLFieldDefinition ,
29- GraphQLType
28+ GraphQLType ,
29+ GraphQLAbstractType
3030} from '../type/definition' ;
3131import type { GraphQLSchema } from '../type/schema' ;
3232import {
@@ -410,9 +410,8 @@ function doesFragmentConditionMatch(
410410 if ( conditionalType === type ) {
411411 return true ;
412412 }
413- if ( conditionalType instanceof GraphQLInterfaceType ||
414- conditionalType instanceof GraphQLUnionType ) {
415- return conditionalType . isPossibleType ( type ) ;
413+ if ( isAbstractType ( conditionalType ) ) {
414+ return ( ( conditionalType : any ) : GraphQLAbstractType ) . isPossibleType ( type ) ;
416415 }
417416 return false ;
418417}
@@ -622,8 +621,8 @@ function completeValue(
622621
623622 var objectType : ?GraphQLObjectType =
624623 fieldType instanceof GraphQLObjectType ? fieldType :
625- fieldType instanceof GraphQLInterfaceType ||
626- fieldType instanceof GraphQLUnionType ? fieldType . resolveType ( result ) :
624+ isAbstractType ( fieldType ) ?
625+ ( ( fieldType : any ) : GraphQLAbstractType ) . resolveType ( result ) :
627626 null ;
628627
629628 if ( ! objectType ) {
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ export class GraphQLInterfaceType {
459459
460460function getTypeOf (
461461 value : any ,
462- abstractType : GraphQLInterfaceType | GraphQLUnionType
462+ abstractType : GraphQLAbstractType
463463) : ?GraphQLObjectType {
464464 var possibleTypes = abstractType . getPossibleTypes ( ) ;
465465 for ( var i = 0 ; i < possibleTypes . length ; i ++ ) {
You can’t perform that action at this time.
0 commit comments