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 classIncrementalExecutionResultImpl.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IncrementalExecutionResultImpl.BuilderfromExecutionResult(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 aPublisherof deferred results.booleanhasNext()Indicates whether there are pending incremental data.static IncrementalExecutionResultImpl.BuildernewIncrementalExecutionResult()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.IncrementalExecutionResulttransform(java.util.function.Consumer<ExecutionResult.Builder<?>> builderConsumer)This helps you transform the currentExecutionResultobject 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 Detail
-
hasNext
public boolean hasNext()
Description copied from interface:IncrementalExecutionResultIndicates whether there are pending incremental data.- Specified by:
hasNextin interfaceIncrementalExecutionResult- Returns:
- "true" if there are incremental data, "false" otherwise.
-
getIncremental
public @Nullable java.util.List<IncrementalPayload> getIncremental()
Description copied from interface:IncrementalExecutionResultReturns 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:
getIncrementalin 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:IncrementalExecutionResultThis method will return aPublisherof deferred results. No field processing will be done until aSubscriberis attached to this publisher.Once a
Subscriberis attached the deferred field result processing will be started and published as a series of events.- Specified by:
getIncrementalItemPublisherin interfaceIncrementalExecutionResult- Returns:
- a
Publisherthat clients can subscribe to receive incremental payloads.
-
newIncrementalExecutionResult
public static IncrementalExecutionResultImpl.Builder newIncrementalExecutionResult()
- Returns:
- a
IncrementalExecutionResultImpl.Builderthat can be used to create an instance ofIncrementalExecutionResultImpl
-
fromExecutionResult
public static IncrementalExecutionResultImpl.Builder fromExecutionResult(ExecutionResult executionResult)
-
transform
public IncrementalExecutionResult transform(java.util.function.Consumer<ExecutionResult.Builder<?>> builderConsumer)
Description copied from interface:ExecutionResultThis helps you transform the currentExecutionResultobject into another one by starting a builder with all the current values and allows you to transform it how you want.- Specified by:
transformin interfaceExecutionResult- Parameters:
builderConsumer- the consumer code that will be given a builder to transform- Returns:
- a new
ExecutionResultobject based on calling build on that builder
-
toSpecification
public java.util.Map<java.lang.String,java.lang.Object> toSpecification()
Description copied from interface:ExecutionResultThe 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 interpretExecutionResultto 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:
toSpecificationin interfaceExecutionResult- Overrides:
toSpecificationin classExecutionResultImpl- Returns:
- a map of the result that strictly follows the spec
-
-