Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ae003d

Browse files
committed
Backport of #3943
1 parent 7b76ce6 commit 3ae003d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/graphql/execution/ExecutionStrategy.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,10 +635,13 @@ private FieldValueInfo completeField(GraphQLFieldDefinition fieldDef, ExecutionC
635635
);
636636

637637
FieldValueInfo fieldValueInfo = completeValue(executionContext, newParameters);
638-
639-
CompletableFuture<Object> executionResultFuture = fieldValueInfo.getFieldValueFuture();
640638
ctxCompleteField.onDispatched();
641-
executionResultFuture.whenComplete(ctxCompleteField::onCompleted);
639+
if (fieldValueInfo.isFutureValue()) {
640+
CompletableFuture<Object> executionResultFuture = fieldValueInfo.getFieldValueFuture();
641+
executionResultFuture.whenComplete(ctxCompleteField::onCompleted);
642+
} else {
643+
ctxCompleteField.onCompleted(fieldValueInfo.getFieldValueObject(), null);
644+
}
642645
return fieldValueInfo;
643646
}
644647

0 commit comments

Comments
 (0)