public class WebOutput
extends java.lang.Object
implements graphql.ExecutionResult
ExecutionResult, provide a way to transform it, and collect input for custom HTTP response headers for GraphQL over HTTP
requests.| Modifier and Type | Class and Description |
|---|---|
static class |
WebOutput.Builder
Builder to transform a
WebOutput. |
| Constructor and Description |
|---|
WebOutput(WebInput input,
graphql.ExecutionResult executionResult)
Create an instance that wraps the given
ExecutionResult. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getData() |
java.util.List<graphql.GraphQLError> |
getErrors() |
java.util.Map<java.lang.Object,java.lang.Object> |
getExtensions() |
org.springframework.http.HttpHeaders |
getResponseHeaders()
Return a read-only view of any custom headers to be added to the HTTP response, or
null until transform(Consumer) is used to add such headers. |
WebInput |
getWebInput()
Return the associated
WebInput used for the execution. |
boolean |
isDataPresent() |
java.util.Map<java.lang.String,java.lang.Object> |
toSpecification() |
WebOutput |
transform(java.util.function.Consumer<WebOutput.Builder> consumer)
Transform this
WebOutput instance through a WebOutput.Builder and return a
new instance with the modified values. |
public WebOutput(WebInput input, graphql.ExecutionResult executionResult)
ExecutionResult.input - the container for the GraphQL inputexecutionResult - the result of performing a graphql querypublic WebInput getWebInput()
WebInput used for the execution.@Nullable public <T> T getData()
getData in interface graphql.ExecutionResultpublic boolean isDataPresent()
isDataPresent in interface graphql.ExecutionResultpublic java.util.List<graphql.GraphQLError> getErrors()
getErrors in interface graphql.ExecutionResult@Nullable public java.util.Map<java.lang.Object,java.lang.Object> getExtensions()
getExtensions in interface graphql.ExecutionResultpublic java.util.Map<java.lang.String,java.lang.Object> toSpecification()
toSpecification in interface graphql.ExecutionResult@Nullable public org.springframework.http.HttpHeaders getResponseHeaders()
null until transform(Consumer) is used to add such headers.transform(Consumer),
WebOutput.Builder.responseHeader(String, String...)public WebOutput transform(java.util.function.Consumer<WebOutput.Builder> consumer)
WebOutput instance through a WebOutput.Builder and return a
new instance with the modified values.consumer - teh callback that will transform the WebOutput