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 Modifier and Type Class Description static class
IncrementalExecutionResultImpl.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IncrementalExecutionResultImpl.Builder
fromExecutionResult(ExecutionResult executionResult)
@Nullable java.util.List<IncrementalPayload>
getIncremental()
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>
getIncrementalItemPublisher()
This method will return aPublisher
of deferred results.boolean
hasNext()
Indicates whether there are pending incremental data.static IncrementalExecutionResultImpl.Builder
newIncrementalExecutionResult()
java.util.Map<java.lang.String,java.lang.Object>
toSpecification()
The graphql specification says that result of a call should be a map that follows certain rules on what items should be present.-
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, transform
-
-
-
-
Method Detail
-
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
@Nullable public @Nullable java.util.List<IncrementalPayload> 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
public org.reactivestreams.Publisher<DelayedIncrementalPartialResult> 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
public static IncrementalExecutionResultImpl.Builder newIncrementalExecutionResult()
- Returns:
- a
IncrementalExecutionResultImpl.Builder
that can be used to create an instance ofIncrementalExecutionResultImpl
-
fromExecutionResult
public static IncrementalExecutionResultImpl.Builder fromExecutionResult(ExecutionResult executionResult)
-
toSpecification
public java.util.Map<java.lang.String,java.lang.Object> 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 : https://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
-
-