Package graphql.incremental
Class IncrementalExecutionResultImpl
java.lang.Object
graphql.ExecutionResultImpl
graphql.incremental.IncrementalExecutionResultImpl
- All Implemented Interfaces:
ExecutionResult
,IncrementalExecutionResult
@ExperimentalApi
public class IncrementalExecutionResultImpl
extends ExecutionResultImpl
implements IncrementalExecutionResult
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfromExecutionResult
(ExecutionResult executionResult) @Nullable List
<IncrementalPayload> Returns a list of defer and/or stream payloads that the execution engine decided (for whatever reason) to resolve at the same time as the initial payload.org.reactivestreams.Publisher
<DelayedIncrementalPartialResult> This method will return aPublisher
of deferred results.boolean
hasNext()
Indicates whether there are pending incremental data.The graphql specification says that result of a call should be a map that follows certain rules on what items should be present.transform
(Consumer<ExecutionResult.Builder<?>> builderConsumer) This helps you transform the currentExecutionResult
object into another one by starting a builder with all the current values and allows you to transform it how you want.Methods inherited from class graphql.ExecutionResultImpl
getData, getErrors, getExtensions, isDataPresent, newExecutionResult, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface graphql.ExecutionResult
getData, getErrors, getExtensions, isDataPresent
-
Method Details
-
hasNext
public boolean hasNext()Description copied from interface:IncrementalExecutionResult
Indicates whether there are pending incremental data.- Specified by:
hasNext
in interfaceIncrementalExecutionResult
- Returns:
- "true" if there are incremental data, "false" otherwise.
-
getIncremental
Description copied from interface:IncrementalExecutionResult
Returns a list of defer and/or stream payloads that the execution engine decided (for whatever reason) to resolve at the same time as the initial payload.(...)this field may appear on both the initial and subsequent values.
- Specified by:
getIncremental
in interfaceIncrementalExecutionResult
- Returns:
- a list of Stream and/or Defer payloads that were resolved at the same time as the initial payload.
-
getIncrementalItemPublisher
Description copied from interface:IncrementalExecutionResult
This method will return aPublisher
of deferred results. No field processing will be done until aSubscriber
is attached to this publisher.Once a
Subscriber
is attached the deferred field result processing will be started and published as a series of events.- Specified by:
getIncrementalItemPublisher
in interfaceIncrementalExecutionResult
- Returns:
- a
Publisher
that clients can subscribe to receive incremental payloads.
-
newIncrementalExecutionResult
- Returns:
- a
IncrementalExecutionResultImpl.Builder
that can be used to create an instance ofIncrementalExecutionResultImpl
-
fromExecutionResult
public static IncrementalExecutionResultImpl.Builder fromExecutionResult(ExecutionResult executionResult) -
transform
Description copied from interface:ExecutionResult
This helps you transform the currentExecutionResult
object into another one by starting a builder with all the current values and allows you to transform it how you want.- Specified by:
transform
in interfaceExecutionResult
- Parameters:
builderConsumer
- the consumer code that will be given a builder to transform- Returns:
- a new
ExecutionResult
object based on calling build on that builder
-
toSpecification
Description copied from interface:ExecutionResult
The graphql specification says that result of a call should be a map that follows certain rules on what items should be present. Certain JSON serializers may or may interpretExecutionResult
to spec, so this method is provided to produce a map that strictly follows the specification. See : http://spec.graphql.org/October2021/#sec-Response-Format- Specified by:
toSpecification
in interfaceExecutionResult
- Overrides:
toSpecification
in classExecutionResultImpl
- Returns:
- a map of the result that strictly follows the spec
-