public class DefaultExecutionGraphQlRequest extends DefaultGraphQlRequest implements ExecutionGraphQlRequest
GraphQlRequest for server side handling, adding the transport (e.g. HTTP
or WebSocket handler) assigned id and locale in the addition to the GraphQlRequest inputs.
Supports the initialization of ExecutionInput that is passed to
GraphQL. You can customize that via
configureExecutionInput(BiFunction).
| Constructor and Description |
|---|
DefaultExecutionGraphQlRequest(String document,
String operationName,
Map<String,Object> variables,
Map<String,Object> extensions,
String id,
Locale locale)
Create an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configureExecutionInput(BiFunction<ExecutionInput,ExecutionInput.Builder,ExecutionInput> configurer)
|
void |
executionId(ExecutionId executionId)
Configure the
ExecutionId to set on
ExecutionInput.getExecutionId(), overriding the transport assigned
id. |
ExecutionId |
getExecutionId()
Return the configured
executionId. |
String |
getId()
Return the transport assigned id for the request that in turn sets
executionId. |
Locale |
getLocale()
Return the transport assigned locale value, if any.
|
ExecutionInput |
toExecutionInput()
Create the
ExecutionInput to pass to GraphQL. |
String |
toString() |
equals, getDocument, getExtensions, getOperationName, getVariables, hashCode, toMapclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDocument, getExtensions, getOperationName, getVariables, toMappublic DefaultExecutionGraphQlRequest(String document, @Nullable String operationName, @Nullable Map<String,Object> variables, @Nullable Map<String,Object> extensions, String id, @Nullable Locale locale)
document - textual representation of the operation(s)operationName - optionally, the name of the operation to executevariables - variables by which the query is parameterizedextensions - implementor specific, protocol extensionsid - the request id, to be used as the ExecutionIdlocale - the locale associated with the requestpublic String getId()
ExecutionGraphQlRequestexecutionId.
By default, the id is initialized as follows:
ServerHttpRequest id which correlates
to WebFlux log messages. For Reactor Netty, it also correlates to server
log messages.
AlternativeJdkIdGenerator, which does
not correlate to anything, but is more efficient than the default
ExecutionIdProvider which relies on
UUID.randomUUID().
"subscribe"
message from the GraphQL over WebSocket protocol that is used to correlate
request and response messages on the the WebSocket.
To override this id, use ExecutionGraphQlRequest.executionId(ExecutionId) or configure
GraphQL with an ExecutionIdProvider.
getId in interface ExecutionGraphQlRequestpublic void executionId(ExecutionId executionId)
ExecutionGraphQlRequestExecutionId to set on
ExecutionInput.getExecutionId(), overriding the transport assigned
id.executionId in interface ExecutionGraphQlRequestexecutionId - the id to use@Nullable public ExecutionId getExecutionId()
ExecutionGraphQlRequestexecutionId.getExecutionId in interface ExecutionGraphQlRequest@Nullable public Locale getLocale()
ExecutionGraphQlRequestgetLocale in interface ExecutionGraphQlRequestpublic void configureExecutionInput(BiFunction<ExecutionInput,ExecutionInput.Builder,ExecutionInput> configurer)
ExecutionGraphQlRequestBiFunction to help initialize the ExecutionInput
passed to GraphQL. The ExecutionInput is first
pre-populated with values from "this" ExecutionGraphQlRequest, and
is then customized with the functions provided here.configureExecutionInput in interface ExecutionGraphQlRequestconfigurer - a BiFunction that accepts the
ExecutionInput initialized so far, and a builder to customize it.public ExecutionInput toExecutionInput()
ExecutionGraphQlRequestExecutionInput to pass to GraphQL.
passed to GraphQL. The ExecutionInput is populated
with values from "this" ExecutionGraphQlRequest, and then customized
with functions provided via ExecutionGraphQlRequest.configureExecutionInput(BiFunction).toExecutionInput in interface ExecutionGraphQlRequestExecutionInputpublic String toString()
toString in class DefaultGraphQlRequest