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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncontextValue(String name) Retrieve a context value.default <T> Optional<T> contextValue(String name, Class<T> type) Retrieve a typed context value.booleanWhether an exception was set on this context.Retrieve partial resultsThrowable.voidpartialResultsException(Throwable throwable) Add a partial resultsThrowable.default voidsetContextValue(String name, Object value) Set a context value.
-
Field Details
-
EXECUTION_CONTEXT_KEY
GraphQL Java context key that stores the Helidon GraphQL execution context. -
HELIDON_CONTEXT_KEY
GraphQL Java context key that stores the Helidon common context active for GraphQL execution.
-
-
Method Details
-
setContextValue
-
contextValue
-
contextValue
Retrieve a typed context value.- Type Parameters:
T- type of the context value- Parameters:
name- name of the context valuetype- 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
-
partialResultsException
-
hasPartialResultsException
boolean hasPartialResultsException()Whether an exception was set on this context.- Returns:
- true if there was a partial results exception
-