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)
  • Field Details

  • Constructor Details

    • SmallRyeContextManager

      public SmallRyeContextManager()
  • Method Details

    • 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