Package graphql.execution
Class AsyncExecutionStrategy
- java.lang.Object
-
- graphql.execution.ExecutionStrategy
-
- graphql.execution.AbstractAsyncExecutionStrategy
-
- graphql.execution.AsyncExecutionStrategy
-
@PublicApi public class AsyncExecutionStrategy extends AbstractAsyncExecutionStrategy
The standard graphql execution strategy that runs fields asynchronously non-blocking.
-
-
Field Summary
-
Fields inherited from class graphql.execution.ExecutionStrategy
dataFetcherExceptionHandler, executionStepInfoFactory, fieldCollector
-
-
Constructor Summary
Constructors Constructor Description AsyncExecutionStrategy()
The standard graphql execution strategy that runs fields asynchronouslyAsyncExecutionStrategy(DataFetcherExceptionHandler exceptionHandler)
Creates a execution strategy that uses the provided exception handler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<ExecutionResult>
execute(ExecutionContext executionContext, ExecutionStrategyParameters parameters)
This is the entry point to an execution strategy.java.lang.Object
executePolymorphic(ExecutionContext executionContext, ExecutionStrategyParameters parameters)
This is the re-entry point to an execution strategy.-
Methods inherited from class graphql.execution.AbstractAsyncExecutionStrategy
handleResults
-
Methods inherited from class graphql.execution.ExecutionStrategy
assertNonNullFieldPrecondition, assertNonNullFieldPrecondition, completeField, completeValue, completeValueForEnum, completeValueForList, completeValueForList, completeValueForNull, completeValueForObject, completeValueForScalar, createExecutionStepInfo, fetchField, getFieldDef, getFieldDef, getNormalizedField, handleFetchingException, handleNonNullException, mkNameForPath, mkNameForPath, mkNameForPath, resolveField, resolveFieldWithInfo, resolveType, toIterable, unboxPossibleDataFetcherResult
-
-
-
-
Constructor Detail
-
AsyncExecutionStrategy
public AsyncExecutionStrategy()
The standard graphql execution strategy that runs fields asynchronously
-
AsyncExecutionStrategy
public AsyncExecutionStrategy(DataFetcherExceptionHandler exceptionHandler)
Creates a execution strategy that uses the provided exception handler- Parameters:
exceptionHandler
- the exception handler to use
-
-
Method Detail
-
execute
public java.util.concurrent.CompletableFuture<ExecutionResult> execute(ExecutionContext executionContext, ExecutionStrategyParameters parameters) throws NonNullableFieldWasNullException
Description copied from class:ExecutionStrategy
This is the entry point to an execution strategy. It will be passed the fields to execute and get values for.- Specified by:
execute
in classExecutionStrategy
- Parameters:
executionContext
- contains the top level execution parametersparameters
- contains the parameters holding the fields to be executed and source object- Returns:
- a promise to an
ExecutionResult
- Throws:
NonNullableFieldWasNullException
- in the future if a non null field resolves to a null value
-
executePolymorphic
public java.lang.Object executePolymorphic(ExecutionContext executionContext, ExecutionStrategyParameters parameters) throws NonNullableFieldWasNullException
Description copied from class:ExecutionStrategy
This is the re-entry point to an execution strategy. If the engine needs to call bck to the execution strategy (say to complete an object) then it will call this method.This method can return
CompletableFuture<ExecutionResult>
or aExecutionResult
depending on whether the fields values are asynchronous or not- Overrides:
executePolymorphic
in classExecutionStrategy
- Parameters:
executionContext
- contains the top level execution parametersparameters
- contains the parameters holding the fields to be executed and source object- Returns:
- a promise to an
ExecutionResult
or just aExecutionResult
- Throws:
NonNullableFieldWasNullException
- in the future if a non-null field resolves to a null value
-
-