Package graphql
Class ExecutionResultImpl
java.lang.Object
graphql.ExecutionResultImpl
- All Implemented Interfaces:
ExecutionResult
- Direct Known Subclasses:
IncrementalExecutionResultImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionExecutionResultImpl(ExecutionResultImpl.Builder<T> builder) ExecutionResultImpl(GraphQLError error) ExecutionResultImpl(Object data, List<? extends GraphQLError> errors) ExecutionResultImpl(Object data, List<? extends GraphQLError> errors, Map<Object, Object> extensions) ExecutionResultImpl(List<? extends GraphQLError> errors) -
Method Summary
Modifier and TypeMethodDescription<T> TgetData()booleanThe graphql specification specifies: "If an error was encountered before execution begins, the data entry should not be present in the result.static <T extends ExecutionResultImpl.Builder<T>>
ExecutionResultImpl.Builder<T> The graphql specification says that result of a call should be a map that follows certain rules on what items should be present.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface graphql.ExecutionResult
transform
-
Constructor Details
-
ExecutionResultImpl
-
ExecutionResultImpl
-
ExecutionResultImpl
-
ExecutionResultImpl
-
ExecutionResultImpl
-
ExecutionResultImpl
-
-
Method Details
-
isDataPresent
public boolean isDataPresent()Description copied from interface:ExecutionResultThe graphql specification specifies: "If an error was encountered before execution begins, the data entry should not be present in the result. If an error was encountered during the execution that prevented a valid response, the data entry in the response should be null." This allows to distinguish between the cases whereExecutionResult.getData()returns null. See : https://graphql.github.io/graphql-spec/June2018/#sec-Data- Specified by:
isDataPresentin interfaceExecutionResult- Returns:
trueif the entry "data" should be present in the resultfalseotherwise
-
getErrors
- Specified by:
getErrorsin interfaceExecutionResult- Returns:
- the errors that occurred during execution or empty list if there is none
-
getData
public <T> T getData()- Specified by:
getDatain interfaceExecutionResult- Type Parameters:
T- allows type coercion- Returns:
- the data in the result or null if there is none
-
getExtensions
- Specified by:
getExtensionsin interfaceExecutionResult- Returns:
- a map of extensions or null if there are none
-
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- Returns:
- a map of the result that strictly follows the spec
-
toString
-
newExecutionResult
public static <T extends ExecutionResultImpl.Builder<T>> ExecutionResultImpl.Builder<T> newExecutionResult()
-