Interface ExecutionGraphQlRequest

All Superinterfaces:
GraphQlRequest
All Known Implementing Classes:
DefaultExecutionGraphQlRequest, RSocketGraphQlRequest, WebGraphQlRequest, WebSocketGraphQlRequest

public interface ExecutionGraphQlRequest extends GraphQlRequest
Implementation of GraphQlRequest for request handling through GraphQL Java with support for customizing the ExecutionInput passed into GraphQL.
Since:
1.0.0
Author:
Rossen Stoyanchev, Brian Clozel
  • Method Details

    • getId

      String getId()
      Return the transport assigned id for the request that in turn sets executionId.

      By default, the id is initialized as follows:

      • On WebFlux, this is the ServerHttpRequest id which correlates to WebFlux log messages. For Reactor Netty, it also correlates to server log messages.
      • On Spring MVC, the id is generated via AlternativeJdkIdGenerator, which does not correlate to anything, but is more efficient than the default ExecutionIdProvider which relies on UUID.randomUUID().
      • On WebSocket, the id is set to the message id of the "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 executionId(ExecutionId) or configure GraphQL with an ExecutionIdProvider.

      Returns:
      the request id
    • executionId

      void executionId(ExecutionId executionId)
      Configure the ExecutionId to set on ExecutionInput.getExecutionId(), overriding the transport assigned id.
      Parameters:
      executionId - the id to use
    • getExecutionId

      @Nullable ExecutionId getExecutionId()
      Return the configured executionId.
    • getLocale

      @Nullable Locale getLocale()
      Return the transport assigned locale value, if any.
    • configureExecutionInput

      void configureExecutionInput(BiFunction<ExecutionInput,ExecutionInput.Builder,ExecutionInput> configurer)
      Provide a BiFunction 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.
      Parameters:
      configurer - a BiFunction that accepts the ExecutionInput initialized so far, and a builder to customize it.
    • toExecutionInput

      ExecutionInput toExecutionInput()
      Create the ExecutionInput to pass to GraphQL. passed to GraphQL. The ExecutionInput is populated with values from "this" ExecutionGraphQlRequest, and then customized with functions provided via configureExecutionInput(BiFunction).
      Returns:
      the resulting ExecutionInput