15
15
package graphql .annotations .strategies ;
16
16
17
17
import graphql .ExecutionResult ;
18
+ import graphql .ExecutionResultImpl ;
18
19
import graphql .execution .*;
19
20
import graphql .language .*;
20
21
import graphql .schema .GraphQLEnumType ;
@@ -30,7 +31,8 @@ public class EnhancedExecutionStrategy extends AsyncSerialExecutionStrategy {
30
31
private static final String CLIENT_MUTATION_ID = "clientMutationId" ;
31
32
32
33
@ Override
33
- protected CompletableFuture <ExecutionResult > resolveField (ExecutionContext executionContext , ExecutionStrategyParameters parameters ) {
34
+ protected Object /* CompletableFuture<Object> | Object */ resolveField (ExecutionContext executionContext ,
35
+ ExecutionStrategyParameters parameters ) {
34
36
GraphQLObjectType parentType = (GraphQLObjectType ) parameters .getExecutionStepInfo ().getUnwrappedNonNullType ();
35
37
GraphQLFieldDefinition fieldDef = getFieldDef (executionContext .getGraphQLSchema (), parentType , parameters .getField ().getSingleField ());
36
38
if (fieldDef == null ) return null ;
@@ -60,8 +62,10 @@ protected CompletableFuture<ExecutionResult> resolveField(ExecutionContext execu
60
62
.source (clientMutationId )
61
63
.build ();
62
64
63
-
64
- return completeValue (executionContext , newParameters ).getFieldValue ();
65
+ // TODO: The return type of this function changed completely, previously this has only returned
66
+ // completeable future, now it might also return the raw object, no clue how this impacts the
67
+ // the rest of the annotations framework
68
+ return completeValue (executionContext , newParameters ).getFieldValueFuture ().thenApply (fv -> ExecutionResultImpl .newExecutionResult ().data (fv ).build ());
65
69
} else {
66
70
return super .resolveField (executionContext , parameters );
67
71
}
0 commit comments