@PublicApi public interface ExecutionResult
Modifier and Type | Interface and Description |
---|---|
static interface |
ExecutionResult.Builder<B extends ExecutionResult.Builder<B>> |
Modifier and Type | Method and Description |
---|---|
<T> T |
getData() |
java.util.List<GraphQLError> |
getErrors() |
java.util.Map<java.lang.Object,java.lang.Object> |
getExtensions() |
boolean |
isDataPresent()
The graphql specification specifies:
"If an error was encountered before execution begins, the data entry should not be present in the result.
|
static ExecutionResult.Builder<?> |
newExecutionResult() |
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.
|
default ExecutionResult |
transform(java.util.function.Consumer<ExecutionResult.Builder<?>> builderConsumer)
This helps you transform the current
ExecutionResult object into another one by starting a builder with all
the current values and allows you to transform it how you want. |
java.util.List<GraphQLError> getErrors()
<T> T getData()
T
- allows type coercionboolean isDataPresent()
getData()
returns null.
See : https://graphql.github.io/graphql-spec/June2018/#sec-Datatrue
if the entry "data" should be present in the result
false
otherwisejava.util.Map<java.lang.Object,java.lang.Object> getExtensions()
java.util.Map<java.lang.String,java.lang.Object> toSpecification()
ExecutionResult
to spec, so this method
is provided to produce a map that strictly follows the specification.
See : https://spec.graphql.org/October2021/#sec-Response-Formatdefault ExecutionResult transform(java.util.function.Consumer<ExecutionResult.Builder<?>> builderConsumer)
ExecutionResult
object into another one by starting a builder with all
the current values and allows you to transform it how you want.builderConsumer
- the consumer code that will be given a builder to transformExecutionResult
object based on calling build on that builderstatic ExecutionResult.Builder<?> newExecutionResult()