diff --git a/src/execution/execute.js b/src/execution/execute.js index 065a6e3a64d..f229cb66c92 100644 --- a/src/execution/execute.js +++ b/src/execution/execute.js @@ -798,11 +798,12 @@ function completeAbstractValue( info: GraphQLResolveInfo, result: mixed ): mixed { - let runtimeType: ?GraphQLObjectType; - if (returnType.resolveType) { - runtimeType = returnType.resolveType(result, info); - } else { - runtimeType = defaultResolveTypeFn(result, info, returnType); + const runtimeType = returnType.resolveType ? + returnType.resolver(result, info) : + defaultResolveTypeFn(result, info, returnType); + + if (!runtimeType) { + return null; } if (runtimeType && !returnType.isPossibleType(runtimeType)) { @@ -813,10 +814,6 @@ function completeAbstractValue( ); } - if (!runtimeType) { - return null; - } - return completeObjectValue( exeContext, runtimeType,