Skip to content

Commit b468758

Browse files
authored
Merge pull request #3962 from graphql-java/24.x-avoid-wrapping-backport
24.x Backport of avoid wrapping materialised value
2 parents 7b76ce6 + 3ae003d commit b468758

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)