File tree Expand file tree Collapse file tree
src/main/java/graphql/execution Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535import java .util .Map ;
3636import java .util .concurrent .CompletableFuture ;
3737import java .util .concurrent .CompletionException ;
38+ import java .util .concurrent .CompletionStage ;
3839
3940import static graphql .execution .ExecutionTypeInfo .newTypeInfo ;
4041import static graphql .execution .FieldCollectorParameters .newParameters ;
@@ -208,8 +209,8 @@ protected CompletableFuture<Object> fetchField(ExecutionContext executionContext
208209 dataFetcher = instrumentation .instrumentDataFetcher (dataFetcher , instrumentationFieldFetchParams );
209210 try {
210211 Object fetchedValueRaw = dataFetcher .get (environment );
211- if (fetchedValueRaw instanceof CompletableFuture ) {
212- fetchedValue = (CompletableFuture <?> ) fetchedValueRaw ;
212+ if (fetchedValueRaw instanceof CompletionStage ) {
213+ fetchedValue = (( CompletionStage ) fetchedValueRaw ). toCompletableFuture () ;
213214 } else {
214215 fetchedValue = CompletableFuture .completedFuture (fetchedValueRaw );
215216 }
You can’t perform that action at this time.
0 commit comments