Class SmallRyeContextManager


  • public class SmallRyeContextManager
    extends Object
    Adds methods to make the life cycle of the context easy to implement
    Author:
    Phillip Kruger ([email protected])
    • Constructor Detail

      • SmallRyeContextManager

        public SmallRyeContextManager()
    • 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