Class PerLevelDataLoaderDispatchStrategyWithDeferAlwaysDispatch
- java.lang.Object
-
- graphql.execution.instrumentation.dataloader.PerLevelDataLoaderDispatchStrategyWithDeferAlwaysDispatch
-
- All Implemented Interfaces:
DataLoaderDispatchStrategy
public class PerLevelDataLoaderDispatchStrategyWithDeferAlwaysDispatch extends java.lang.Object implements DataLoaderDispatchStrategy
The execution of a query can be divided into 2 phases: first, the non-deferred fields are executed and only once they are completely resolved, we start to execute the deferred fields. The behavior of this Data Loader strategy is quite different during those 2 phases. During the execution of the deferred fields the Data Loader will not attempt to dispatch in a optimal way. It will essentially dispatch for every field fetched, which is quite ineffective. This is the first iteration of the Data Loader strategy with support for @defer, and it will be improved in the future.
-
-
Field Summary
-
Fields inherited from interface graphql.execution.DataLoaderDispatchStrategy
NO_OP
-
-
Constructor Summary
Constructors Constructor Description PerLevelDataLoaderDispatchStrategyWithDeferAlwaysDispatch(ExecutionContext executionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
executeDeferredOnFieldValueInfo(FieldValueInfo fieldValueInfo, ExecutionStrategyParameters executionStrategyParameters)
void
executeObject(ExecutionContext executionContext, ExecutionStrategyParameters parameters)
void
executeObjectOnFieldValuesException(java.lang.Throwable t, ExecutionStrategyParameters parameters)
void
executeObjectOnFieldValuesInfo(java.util.List<FieldValueInfo> fieldValueInfoList, ExecutionStrategyParameters parameters)
void
executionStrategy(ExecutionContext executionContext, ExecutionStrategyParameters parameters)
void
executionStrategyOnFieldValuesException(java.lang.Throwable t)
void
executionStrategyOnFieldValuesInfo(java.util.List<FieldValueInfo> fieldValueInfoList)
void
fieldFetched(ExecutionContext executionContext, ExecutionStrategyParameters parameters, DataFetcher<?> dataFetcher, java.lang.Object fetchedValue)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface graphql.execution.DataLoaderDispatchStrategy
executionSerialStrategy, modifyDataFetcher
-
-
-
-
Constructor Detail
-
PerLevelDataLoaderDispatchStrategyWithDeferAlwaysDispatch
public PerLevelDataLoaderDispatchStrategyWithDeferAlwaysDispatch(ExecutionContext executionContext)
-
-
Method Detail
-
executeDeferredOnFieldValueInfo
public void executeDeferredOnFieldValueInfo(FieldValueInfo fieldValueInfo, ExecutionStrategyParameters executionStrategyParameters)
- Specified by:
executeDeferredOnFieldValueInfo
in interfaceDataLoaderDispatchStrategy
-
executionStrategy
public void executionStrategy(ExecutionContext executionContext, ExecutionStrategyParameters parameters)
- Specified by:
executionStrategy
in interfaceDataLoaderDispatchStrategy
-
executeObject
public void executeObject(ExecutionContext executionContext, ExecutionStrategyParameters parameters)
- Specified by:
executeObject
in interfaceDataLoaderDispatchStrategy
-
executionStrategyOnFieldValuesInfo
public void executionStrategyOnFieldValuesInfo(java.util.List<FieldValueInfo> fieldValueInfoList)
- Specified by:
executionStrategyOnFieldValuesInfo
in interfaceDataLoaderDispatchStrategy
-
executionStrategyOnFieldValuesException
public void executionStrategyOnFieldValuesException(java.lang.Throwable t)
- Specified by:
executionStrategyOnFieldValuesException
in interfaceDataLoaderDispatchStrategy
-
executeObjectOnFieldValuesInfo
public void executeObjectOnFieldValuesInfo(java.util.List<FieldValueInfo> fieldValueInfoList, ExecutionStrategyParameters parameters)
- Specified by:
executeObjectOnFieldValuesInfo
in interfaceDataLoaderDispatchStrategy
-
executeObjectOnFieldValuesException
public void executeObjectOnFieldValuesException(java.lang.Throwable t, ExecutionStrategyParameters parameters)
- Specified by:
executeObjectOnFieldValuesException
in interfaceDataLoaderDispatchStrategy
-
fieldFetched
public void fieldFetched(ExecutionContext executionContext, ExecutionStrategyParameters parameters, DataFetcher<?> dataFetcher, java.lang.Object fetchedValue)
- Specified by:
fieldFetched
in interfaceDataLoaderDispatchStrategy
-
-