Interface ExecutionContext


public interface ExecutionContext
GraphQL execution context to support partial results and context values. Context values are backed by Helidon common context and are also available from Contexts.context() during GraphQL execution.
  • Field Details

    • EXECUTION_CONTEXT_KEY

      static final String EXECUTION_CONTEXT_KEY
      GraphQL Java context key that stores the Helidon GraphQL execution context.
    • HELIDON_CONTEXT_KEY

      static final String HELIDON_CONTEXT_KEY
      GraphQL Java context key that stores the Helidon common context active for GraphQL execution.
  • Method Details

    • setContextValue

      default void setContextValue(String name, Object value)
      Set a context value.
      Parameters:
      name - name of the context value
      value - context value
    • contextValue

      default Optional<Object> contextValue(String name)
      Retrieve a context value.
      Parameters:
      name - name of the context value
      Returns:
      the context value, or empty if it is not present
    • contextValue

      default <T> Optional<T> contextValue(String name, Class<T> type)
      Retrieve a typed context value.
      Type Parameters:
      T - type of the context value
      Parameters:
      name - name of the context value
      type - expected type of the context value
      Returns:
      the context value, or empty if it is not present or not assignable to the requested type
    • partialResultsException

      void partialResultsException(Throwable throwable)
      Add a partial results Throwable.
      Parameters:
      throwable - Throwable
    • partialResultsException

      Throwable partialResultsException()
      Retrieve partial results Throwable.
      Returns:
      the Throwable
    • hasPartialResultsException

      boolean hasPartialResultsException()
      Whether an exception was set on this context.
      Returns:
      true if there was a partial results exception