Skip to content

Commit

Permalink
Follow up to #328
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Mar 24, 2016
1 parent 8ba02b2 commit 1983079
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/execution/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -813,10 +814,6 @@ function completeAbstractValue(
);
}

if (!runtimeType) {
return null;
}

return completeObjectValue(
exeContext,
runtimeType,
Expand Down

0 comments on commit 1983079

Please sign in to comment.