Merge pull request #3935 from graphql-java/skip-builder-on-esp · graphql-java/graphql-java@b67424d
@@ -317,8 +317,7 @@ DeferredExecutionSupport createDeferredExecutionSupport(ExecutionContext executi
317317MergedField currentField = fields.getSubField(fieldName);
318318319319ResultPath fieldPath = parameters.getPath().segment(mkNameForPath(currentField));
320-ExecutionStrategyParameters newParameters = parameters
321- .transform(builder -> builder.field(currentField).path(fieldPath).parent(parameters));
320+ExecutionStrategyParameters newParameters = parameters.transform(currentField, fieldPath, parameters);
322321323322if (!deferredExecutionSupport.isDeferredField(currentField)) {
324323Object fieldValueInfo = resolveFieldWithInfo(executionContext, newParameters);
@@ -615,12 +614,10 @@ private FieldValueInfo completeField(GraphQLFieldDefinition fieldDef, ExecutionC
615614616615NonNullableFieldValidator nonNullableFieldValidator = new NonNullableFieldValidator(executionContext, executionStepInfo);
617616618-ExecutionStrategyParameters newParameters = parameters.transform(builder ->
619-builder.executionStepInfo(executionStepInfo)
620- .source(fetchedValue.getFetchedValue())
621- .localContext(fetchedValue.getLocalContext())
622- .nonNullFieldValidator(nonNullableFieldValidator)
623- );
617+ExecutionStrategyParameters newParameters = parameters.transform(executionStepInfo,
618+nonNullableFieldValidator,
619+fetchedValue.getLocalContext(),
620+fetchedValue.getFetchedValue());
624621625622FieldValueInfo fieldValueInfo = completeValue(executionContext, newParameters);
626623ctxCompleteField.onDispatched();
@@ -781,13 +778,10 @@ protected FieldValueInfo completeValueForList(ExecutionContext executionContext,
781778782779FetchedValue value = unboxPossibleDataFetcherResult(executionContext, parameters, item);
783780784-ExecutionStrategyParameters newParameters = parameters.transform(builder ->
785-builder.executionStepInfo(stepInfoForListElement)
786- .nonNullFieldValidator(nonNullableFieldValidator)
787- .localContext(value.getLocalContext())
788- .path(indexedPath)
789- .source(value.getFetchedValue())
790- );
781+ExecutionStrategyParameters newParameters = parameters.transform(stepInfoForListElement,
782+nonNullableFieldValidator, indexedPath,
783+value.getLocalContext(), value.getFetchedValue());
784+791785fieldValueInfos.add(completeValue(executionContext, newParameters));
792786index++;
793787 }
@@ -927,12 +921,10 @@ protected Object completeValueForObject(ExecutionContext executionContext, Execu
927921ExecutionStepInfo newExecutionStepInfo = executionStepInfo.changeTypeWithPreservedNonNull(resolvedObjectType);
928922NonNullableFieldValidator nonNullableFieldValidator = new NonNullableFieldValidator(executionContext, newExecutionStepInfo);
929923930-ExecutionStrategyParameters newParameters = parameters.transform(builder ->
931-builder.executionStepInfo(newExecutionStepInfo)
932- .fields(subFields)
933- .nonNullFieldValidator(nonNullableFieldValidator)
934- .source(result)
935- );
924+ExecutionStrategyParameters newParameters = parameters.transform(newExecutionStepInfo,
925+nonNullableFieldValidator,
926+subFields,
927+result);
936928937929// Calling this from the executionContext to ensure we shift back from mutation strategy to the query strategy.
938930return executionContext.getQueryStrategy().executeObject(executionContext, newParameters);