Class SmallRyeContextManager
java.lang.Object
io.smallrye.graphql.execution.context.SmallRyeContextManager
Adds methods to make the life cycle of the context easy to implement
- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic SmallRyeContextfromInitialRequest(jakarta.json.JsonObject request) This creates a new context at the beginning of the requeststatic SmallRyeContextstatic SmallRyeContextpopulateFromDataFetchingEnvironment(Type type, Field field, graphql.schema.DataFetchingEnvironment dataFetchingEnvironment) This will populate the provided smallRyeContext from the GraphQL-Java DataFetchingEnvironment, and is per field.static SmallRyeContextpopulateFromExecutionInput(graphql.ExecutionInput executionInput, QueryCache queryCache) This will populate the context with the input, and happens on every new request, just before GraphQL execute is calledstatic voidrestore(SmallRyeContext smallRyeContext) static SmallRyeContextrestoreSmallRyeContext(graphql.schema.DataFetchingEnvironment dfe)
-
Field Details
-
CONTEXT
- See Also:
-
-
Constructor Details
-
SmallRyeContextManager
public SmallRyeContextManager()
-
-
Method Details
-
restoreSmallRyeContext
-
getCurrentSmallRyeContext
-
restore
-
clearCurrentSmallRyeContext
public static void clearCurrentSmallRyeContext() -
fromInitialRequest
This creates a new context at the beginning of the request- Parameters:
request- the original request- Returns:
- the initial context
-
populateFromExecutionInput
public static SmallRyeContext populateFromExecutionInput(graphql.ExecutionInput executionInput, QueryCache queryCache) This will populate the context with the input, and happens on every new request, just before GraphQL execute is called- Parameters:
executionInput-queryCache-- Returns:
- the current context
-
populateFromDataFetchingEnvironment
public static SmallRyeContext populateFromDataFetchingEnvironment(Type type, Field field, graphql.schema.DataFetchingEnvironment dataFetchingEnvironment) This will populate the provided smallRyeContext from the GraphQL-Java DataFetchingEnvironment, and is per field.- Parameters:
type-field-dataFetchingEnvironment-- Returns:
- the current context
-