Class SmallRyeContextManager
- java.lang.Object
-
- io.smallrye.graphql.execution.context.SmallRyeContextManager
-
public class SmallRyeContextManager extends Object
Adds methods to make the life cycle of the context easy to implement- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
-
Constructor Summary
Constructors Constructor Description SmallRyeContextManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearCurrentSmallRyeContext()static SmallRyeContextfromInitialRequest(jakarta.json.JsonObject request)This creates a new context at the beginning of the requeststatic SmallRyeContextgetCurrentSmallRyeContext()static 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 Detail
-
CONTEXT
public static final String CONTEXT
- See Also:
- Constant Field Values
-
-
Method Detail
-
restoreSmallRyeContext
public static SmallRyeContext restoreSmallRyeContext(graphql.schema.DataFetchingEnvironment dfe)
-
getCurrentSmallRyeContext
public static SmallRyeContext getCurrentSmallRyeContext()
-
restore
public static void restore(SmallRyeContext smallRyeContext)
-
clearCurrentSmallRyeContext
public static void clearCurrentSmallRyeContext()
-
fromInitialRequest
public static SmallRyeContext fromInitialRequest(jakarta.json.JsonObject request)
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
-
-