@@ -211,7 +211,7 @@ protected CompletableFuture<Map<String, Object>> executeObject(ExecutionContext
211211 Async .CombinedBuilder <FieldValueInfo > resolvedFieldFutures = getAsyncFieldValueInfo (executionContext , parameters , deferredExecutionSupport );
212212
213213 CompletableFuture <Map <String , Object >> overallResult = new CompletableFuture <>();
214- resolveObjectCtx .onDispatched (overallResult );
214+ resolveObjectCtx .onDispatched ();
215215
216216 resolvedFieldFutures .await ().whenComplete ((completeValueInfos , throwable ) -> {
217217 List <String > fieldsExecutedOnInitialResult = deferredExecutionSupport .getNonDeferredFieldNames (fieldNames );
@@ -354,7 +354,7 @@ protected CompletableFuture<FieldValueInfo> resolveFieldWithInfo(ExecutionContex
354354
355355 CompletableFuture <Object > fieldValueFuture = result .thenCompose (FieldValueInfo ::getFieldValueFuture );
356356
357- fieldCtx .onDispatched (fieldValueFuture );
357+ fieldCtx .onDispatched ();
358358 fieldValueFuture .whenComplete (fieldCtx ::onCompleted );
359359 return result ;
360360 }
@@ -425,7 +425,7 @@ protected CompletableFuture<FetchedValue> fetchField(ExecutionContext executionC
425425 dataFetcher = executionContext .getDataLoaderDispatcherStrategy ().modifyDataFetcher (dataFetcher );
426426 CompletableFuture <Object > fetchedValue = invokeDataFetcher (executionContext , parameters , fieldDef , dataFetchingEnvironment , dataFetcher );
427427 executionContext .getDataLoaderDispatcherStrategy ().fieldFetched (executionContext , parameters , dataFetcher , fetchedValue );
428- fetchCtx .onDispatched (fetchedValue );
428+ fetchCtx .onDispatched ();
429429 return fetchedValue
430430 .handle ((result , exception ) -> {
431431 fetchCtx .onCompleted (result , exception );
@@ -475,18 +475,11 @@ protected FetchedValue unboxPossibleDataFetcherResult(ExecutionContext execution
475475 // if the field returns nothing then they get the context of their parent field
476476 localContext = parameters .getLocalContext ();
477477 }
478- return FetchedValue .newFetchedValue ()
479- .fetchedValue (executionContext .getValueUnboxer ().unbox (dataFetcherResult .getData ()))
480- .rawFetchedValue (dataFetcherResult .getData ())
481- .errors (dataFetcherResult .getErrors ())
482- .localContext (localContext )
483- .build ();
478+ Object unBoxedValue = executionContext .getValueUnboxer ().unbox (dataFetcherResult .getData ());
479+ return new FetchedValue (unBoxedValue , dataFetcherResult .getErrors (), localContext );
484480 } else {
485- return FetchedValue .newFetchedValue ()
486- .fetchedValue (executionContext .getValueUnboxer ().unbox (result ))
487- .rawFetchedValue (result )
488- .localContext (parameters .getLocalContext ())
489- .build ();
481+ Object unBoxedValue = executionContext .getValueUnboxer ().unbox (result );
482+ return new FetchedValue (unBoxedValue , ImmutableList .of (), parameters .getLocalContext ());
490483 }
491484 }
492485
@@ -575,7 +568,7 @@ protected FieldValueInfo completeField(ExecutionContext executionContext, Execut
575568 FieldValueInfo fieldValueInfo = completeValue (executionContext , newParameters );
576569
577570 CompletableFuture <Object > executionResultFuture = fieldValueInfo .getFieldValueFuture ();
578- ctxCompleteField .onDispatched (executionResultFuture );
571+ ctxCompleteField .onDispatched ();
579572 executionResultFuture .whenComplete (ctxCompleteField ::onCompleted );
580573 return fieldValueInfo ;
581574 }
@@ -608,10 +601,10 @@ protected FieldValueInfo completeValue(ExecutionContext executionContext, Execut
608601 return completeValueForList (executionContext , parameters , result );
609602 } else if (isScalar (fieldType )) {
610603 fieldValue = completeValueForScalar (executionContext , parameters , (GraphQLScalarType ) fieldType , result );
611- return FieldValueInfo . newFieldValueInfo (SCALAR ). fieldValue ( fieldValue ). build ( );
604+ return new FieldValueInfo (SCALAR , fieldValue );
612605 } else if (isEnum (fieldType )) {
613606 fieldValue = completeValueForEnum (executionContext , parameters , (GraphQLEnumType ) fieldType , result );
614- return FieldValueInfo . newFieldValueInfo (ENUM ). fieldValue ( fieldValue ). build ( );
607+ return new FieldValueInfo (ENUM , fieldValue );
615608 }
616609
617610 // when we are here, we have a complex type: Interface, Union or Object
@@ -628,7 +621,7 @@ protected FieldValueInfo completeValue(ExecutionContext executionContext, Execut
628621 // complete field as null, validating it is nullable
629622 return getFieldValueInfoForNull (parameters );
630623 }
631- return FieldValueInfo . newFieldValueInfo (OBJECT ). fieldValue ( fieldValue ). build ( );
624+ return new FieldValueInfo (OBJECT , fieldValue );
632625 }
633626
634627 private void handleUnresolvedTypeProblem (ExecutionContext context , ExecutionStrategyParameters parameters , UnresolvedTypeException e ) {
@@ -649,7 +642,7 @@ private void handleUnresolvedTypeProblem(ExecutionContext context, ExecutionStra
649642 */
650643 private FieldValueInfo getFieldValueInfoForNull (ExecutionStrategyParameters parameters ) {
651644 CompletableFuture <Object > fieldValue = completeValueForNull (parameters );
652- return FieldValueInfo . newFieldValueInfo (NULL ). fieldValue ( fieldValue ). build ( );
645+ return new FieldValueInfo (NULL , fieldValue );
653646 }
654647
655648 protected CompletableFuture <Object > completeValueForNull (ExecutionStrategyParameters parameters ) {
@@ -674,10 +667,10 @@ protected FieldValueInfo completeValueForList(ExecutionContext executionContext,
674667 try {
675668 resultIterable = parameters .getNonNullFieldValidator ().validate (parameters .getPath (), resultIterable );
676669 } catch (NonNullableFieldWasNullException e ) {
677- return FieldValueInfo . newFieldValueInfo (LIST ). fieldValue ( exceptionallyCompletedFuture (e )). build ( );
670+ return new FieldValueInfo (LIST , exceptionallyCompletedFuture (e ));
678671 }
679672 if (resultIterable == null ) {
680- return FieldValueInfo . newFieldValueInfo (LIST ). fieldValue ( completedFuture (null )). build ( );
673+ return new FieldValueInfo (LIST , completedFuture (null ));
681674 }
682675 return completeValueForList (executionContext , parameters , resultIterable );
683676 }
@@ -729,7 +722,7 @@ protected FieldValueInfo completeValueForList(ExecutionContext executionContext,
729722 CompletableFuture <List <Object >> resultsFuture = Async .each (fieldValueInfos , FieldValueInfo ::getFieldValueFuture );
730723
731724 CompletableFuture <Object > overallResult = new CompletableFuture <>();
732- completeListCtx .onDispatched (overallResult );
725+ completeListCtx .onDispatched ();
733726 overallResult .whenComplete (completeListCtx ::onCompleted );
734727
735728 resultsFuture .whenComplete ((results , exception ) -> {
@@ -742,10 +735,7 @@ protected FieldValueInfo completeValueForList(ExecutionContext executionContext,
742735 overallResult .complete (completedResults );
743736 });
744737
745- return FieldValueInfo .newFieldValueInfo (LIST )
746- .fieldValue (overallResult )
747- .fieldValueInfos (fieldValueInfos )
748- .build ();
738+ return new FieldValueInfo (LIST , overallResult , fieldValueInfos );
749739 }
750740
751741 protected <T > void handleValueException (CompletableFuture <T > overallResult , Throwable e , ExecutionContext executionContext ) {
0 commit comments