Class SmallRyeContext

java.lang.Object
io.smallrye.graphql.execution.context.SmallRyeContext
All Implemented Interfaces:
Context

public class SmallRyeContext extends Object implements Context
Implements the Context from MicroProfile API. WARNING: This class has to be used as semi-immutable. When propagating this to a new execution, it has to be cloned. A clone is a deep copy WITH THE EXCEPTION OF: - Added extensions - ExecutionResult - DataFetchingEnvironment (this actually should be rewritten after cloning for each new fetcher) These above things get shared between all clones to enable applications to write their own data into them.
Author:
Phillip Kruger (phillip.kruger@redhat.com)
  • Constructor Details

    • SmallRyeContext

      public SmallRyeContext(String createdBy)
  • Method Details

    • clone

      public SmallRyeContext clone()
      Overrides:
      clone in class Object
    • getAddedExtensions

      public Map<String,Object> getAddedExtensions()
    • addExtension

      public void addExtension(String key, Object value)
      Adds single instance of user created extension into the context.
      Parameters:
      key - The key (identification) of the extension.
      value - The value of extension.
    • getRequest

      public jakarta.json.JsonObject getRequest()
      Specified by:
      getRequest in interface Context
    • setRequest

      public void setRequest(jakarta.json.JsonObject request)
    • getExecutionId

      public String getExecutionId()
      Specified by:
      getExecutionId in interface Context
    • setExecutionId

      public void setExecutionId(String executionId)
    • getFieldName

      public String getFieldName()
      Specified by:
      getFieldName in interface Context
    • setFieldName

      public void setFieldName(String fieldName)
    • getField

      public Field getField()
    • setField

      public void setField(Field field)
    • getArguments

      public <A> Map<String,A> getArguments()
      Specified by:
      getArguments in interface Context
    • setArguments

      public <A> void setArguments(Map<String,A> arguments)
    • getSource

      public <S> S getSource()
      Specified by:
      getSource in interface Context
    • setSource

      public <S> void setSource(S source)
    • getPath

      public String getPath()
      Specified by:
      getPath in interface Context
    • setPath

      public void setPath(String path)
    • getSelectedFields

      public jakarta.json.JsonArray getSelectedFields()
      Specified by:
      getSelectedFields in interface Context
    • setSelectedFields

      public void setSelectedFields(jakarta.json.JsonArray selectedFields)
    • getSelectedAndSourceFields

      public jakarta.json.JsonArray getSelectedAndSourceFields()
      Specified by:
      getSelectedAndSourceFields in interface Context
    • setSelectedAndSourceFields

      public void setSelectedAndSourceFields(jakarta.json.JsonArray selectedAndSourceFields)
    • getOperationType

      public String getOperationType()
      Specified by:
      getOperationType in interface Context
    • setOperationType

      public void setOperationType(String operationType)
    • getRequestedOperationTypes

      public List<String> getRequestedOperationTypes()
      Specified by:
      getRequestedOperationTypes in interface Context
    • setRequestedOperationTypes

      public void setRequestedOperationTypes(List<String> requestedOperationTypes)
    • getParentTypeName

      public Optional<String> getParentTypeName()
      Specified by:
      getParentTypeName in interface Context
    • setParentTypeName

      public void setParentTypeName(String parentTypeName)
    • getOperationName

      public Optional<String> getOperationName()
      Specified by:
      getOperationName in interface Context
    • setOperationName

      public void setOperationName(String operationName)
    • getDataFetchingEnvironment

      public graphql.schema.DataFetchingEnvironment getDataFetchingEnvironment()
    • setDataFetchingEnvironment

      public void setDataFetchingEnvironment(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment)
    • getExecutionInput

      public graphql.ExecutionInput getExecutionInput()
    • setExecutionInput

      public void setExecutionInput(graphql.ExecutionInput executionInput)
    • getQueryCache

      public QueryCache getQueryCache()
    • setQueryCache

      public void setQueryCache(QueryCache queryCache)
    • getDocumentSupplier

      public DocumentSupplier getDocumentSupplier()
    • setDocumentSupplier

      public void setDocumentSupplier(DocumentSupplier documentSupplier)
    • setExecutionResult

      public void setExecutionResult(graphql.ExecutionResult executionResult)
    • unwrap

      public <T> T unwrap(Class<T> wrappedType)
      Specified by:
      unwrap in interface Context
    • toString

      public String toString()
      Overrides:
      toString in class Object