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) fromIncrementalExecutionResult(IncrementalExecutionResult 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 aPublisherof deferred results.booleanhasNext()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 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface graphql.ExecutionResult
getData, getErrors, getExtensions, isDataPresent
-
Method Details
-
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
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
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
- Returns:
- a
IncrementalExecutionResultImpl.Builderthat can be used to create an instance ofIncrementalExecutionResultImpl
-
fromExecutionResult
public static IncrementalExecutionResultImpl.Builder fromExecutionResult(ExecutionResult executionResult) -
fromIncrementalExecutionResult
public static IncrementalExecutionResultImpl.Builder fromIncrementalExecutionResult(IncrementalExecutionResult executionResult) -
transform
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
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
-