Package graphql.execution
Class SubscriptionExecutionStrategy
- java.lang.Object
-
- graphql.execution.ExecutionStrategy
-
- graphql.execution.SubscriptionExecutionStrategy
-
@PublicApi public class SubscriptionExecutionStrategy extends ExecutionStrategy
An execution strategy that implements graphql subscriptions by using reactive-streams as the output result of the subscription query.Afterwards each object delivered on that stream will be mapped via running the original selection set over that object and hence producing an ExecutionResult just like a normal graphql query.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
KEEP_SUBSCRIPTION_EVENTS_ORDERED
If a boolean value is placed into theGraphQLContext
with this key then the order of the subscription events can be controlled.-
Fields inherited from class graphql.execution.ExecutionStrategy
dataFetcherExceptionHandler, executionStepInfoFactory, fieldCollector
-
-
Constructor Summary
Constructors Constructor Description SubscriptionExecutionStrategy()
SubscriptionExecutionStrategy(DataFetcherExceptionHandler dataFetcherExceptionHandler)
-
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.-
Methods inherited from class graphql.execution.ExecutionStrategy
assertNonNullFieldPrecondition, assertNonNullFieldPrecondition, completeField, completeValue, completeValueForEnum, completeValueForList, completeValueForList, completeValueForNull, completeValueForObject, completeValueForScalar, createExecutionStepInfo, executeObject, fetchField, getFieldDef, getFieldDef, getNormalizedField, handleFetchingException, handleNonNullException, handleValueException, mkNameForPath, mkNameForPath, mkNameForPath, resolveField, resolveFieldWithInfo, resolveType, toIterable, unboxPossibleDataFetcherResult
-
-
-
-
Field Detail
-
KEEP_SUBSCRIPTION_EVENTS_ORDERED
public static final java.lang.String KEEP_SUBSCRIPTION_EVENTS_ORDERED
If a boolean value is placed into theGraphQLContext
with this key then the order of the subscription events can be controlled. By default, subscription events are published as the graphql subselection calls complete, and not in the order they originally arrived from the source publisher. But this can be changed toBoolean.TRUE
to keep them in order.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SubscriptionExecutionStrategy
public SubscriptionExecutionStrategy()
-
SubscriptionExecutionStrategy
public SubscriptionExecutionStrategy(DataFetcherExceptionHandler dataFetcherExceptionHandler)
-
-
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
-
-