AsyncExecutionStrategy
and DataLoaderDispatcherInstrumentation
@PublicApi @Deprecated public class BatchedExecutionStrategy extends ExecutionStrategy
BatchedExecutionStrategy has been deprecated in favour ofExecution Strategy that minimizes calls to the data fetcher when used in conjunction withAsyncExecutionStrategy
andDataLoaderDispatcherInstrumentation
. BatchedExecutionStrategy does not properly implement the graphql runtime specification. Specifically it does not correctly handle non null fields and how they are to cascade up their parent fields. It has proven an intractable problem to make this code handle these cases. See http://facebook.github.io/graphql/October2016/#sec-Errors-and-Non-Nullability We will remove it once we are sure the alternative is as least good as the BatchedExecutionStrategy.
DataFetcher
s that have
DataFetcher.get(DataFetchingEnvironment)
methods annotated with Batched
. See the javadoc comment on
Batched
for a more detailed description of batched data fetchers.
The strategy runs a BFS over terms of the query and passes a list of all the relevant sources to the batched data fetcher.
Normal DataFetchers can be used, however they will not see benefits of batching as they expect a single source object at a time.dataFetcherExceptionHandler, fieldCollector, valuesResolver
Constructor and Description |
---|
BatchedExecutionStrategy()
Deprecated.
|
BatchedExecutionStrategy(DataFetcherExceptionHandler dataFetcherExceptionHandler)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<ExecutionResult> |
execute(ExecutionContext executionContext,
ExecutionStrategyParameters parameters)
Deprecated.
This is the entry point to an execution strategy.
|
assertNonNullFieldPrecondition, assertNonNullFieldPrecondition, completeField, completeValue, completeValueForEnum, completeValueForList, completeValueForList, completeValueForObject, completeValueForScalar, fetchField, fieldTypeInfo, getFieldDef, getFieldDef, handleNonNullException, resolveField, resolveFieldWithInfo, resolveType, resolveTypeForInterface, resolveTypeForUnion, toIterable, toIterable, unboxPossibleOptional
public BatchedExecutionStrategy()
public BatchedExecutionStrategy(DataFetcherExceptionHandler dataFetcherExceptionHandler)
public java.util.concurrent.CompletableFuture<ExecutionResult> execute(ExecutionContext executionContext, ExecutionStrategyParameters parameters)
ExecutionStrategy
execute
in class ExecutionStrategy
executionContext
- contains the top level execution parametersparameters
- contains the parameters holding the fields to be executed and source objectExecutionResult