@@ -133,7 +133,6 @@ public abstract class ExecutionStrategy {
133133 protected final DataFetcherExceptionHandler dataFetcherExceptionHandler ;
134134 private final ResolveType resolvedType = new ResolveType ();
135135
136- protected DataLoaderDispatchStrategy dataLoaderDispatcherStrategy = DataLoaderDispatchStrategy .NO_OP ;
137136
138137 /**
139138 * The default execution strategy constructor uses the {@link SimpleDataFetcherExceptionHandler}
@@ -155,12 +154,6 @@ protected ExecutionStrategy(DataFetcherExceptionHandler dataFetcherExceptionHand
155154 }
156155
157156
158- @ Internal
159- void setDataLoaderDispatcherStrategy (DataLoaderDispatchStrategy dataLoaderDispatcherStrategy ) {
160- this .dataLoaderDispatcherStrategy = dataLoaderDispatcherStrategy ;
161- }
162-
163-
164157
165158 @ Internal
166159 public static String mkNameForPath (Field currentField ) {
@@ -197,7 +190,7 @@ public static String mkNameForPath(List<Field> currentField) {
197190 * @throws NonNullableFieldWasNullException in the future if a non-null field resolves to a null value
198191 */
199192 protected CompletableFuture <Map <String , Object >> executeObject (ExecutionContext executionContext , ExecutionStrategyParameters parameters ) throws NonNullableFieldWasNullException {
200- dataLoaderDispatcherStrategy .executeObject (executionContext , parameters );
193+ executionContext . getDataLoaderDispatcherStrategy () .executeObject (executionContext , parameters );
201194 Instrumentation instrumentation = executionContext .getInstrumentation ();
202195 InstrumentationExecutionStrategyParameters instrumentationParameters = new InstrumentationExecutionStrategyParameters (executionContext , parameters );
203196
@@ -221,14 +214,14 @@ protected CompletableFuture<Map<String, Object>> executeObject(ExecutionContext
221214 for (FieldValueInfo completeValueInfo : completeValueInfos ) {
222215 resultFutures .add (completeValueInfo .getFieldValueFuture ());
223216 }
224- dataLoaderDispatcherStrategy .executeObject_onFieldValuesInfo (completeValueInfos , parameters );
217+ executionContext . getDataLoaderDispatcherStrategy () .executeObject_onFieldValuesInfo (completeValueInfos , parameters );
225218 resolveObjectCtx .onFieldValuesInfo (completeValueInfos );
226219 resultFutures .await ().whenComplete (handleResultsConsumer );
227220 }).exceptionally ((ex ) -> {
228221 // if there are any issues with combining/handling the field results,
229222 // complete the future at all costs and bubble up any thrown exception so
230223 // the execution does not hang.
231- dataLoaderDispatcherStrategy .executeObject_onFieldValuesException (ex , parameters );
224+ executionContext . getDataLoaderDispatcherStrategy () .executeObject_onFieldValuesException (ex , parameters );
232225 resolveObjectCtx .onFieldValuesException ();
233226 overallResult .completeExceptionally (ex );
234227 return null ;
@@ -383,10 +376,10 @@ protected CompletableFuture<FetchedValue> fetchField(ExecutionContext executionC
383376 executionContext .getInstrumentationState ())
384377 );
385378
386- dataFetcher = dataLoaderDispatcherStrategy .modifyDataFetcher (dataFetcher );
379+ dataFetcher = executionContext . getDataLoaderDispatcherStrategy () .modifyDataFetcher (dataFetcher );
387380 dataFetcher = instrumentation .instrumentDataFetcher (dataFetcher , instrumentationFieldFetchParams , executionContext .getInstrumentationState ());
388381 CompletableFuture <Object > fetchedValue = invokeDataFetcher (executionContext , parameters , fieldDef , dataFetchingEnvironment , dataFetcher );
389- dataLoaderDispatcherStrategy .fieldFetched (executionContext , parameters , dataFetcher , fetchedValue );
382+ executionContext . getDataLoaderDispatcherStrategy () .fieldFetched (executionContext , parameters , dataFetcher , fetchedValue );
390383 fetchCtx .onDispatched (fetchedValue );
391384 return fetchedValue
392385 .handle ((result , exception ) -> {
0 commit comments