Package io.smallrye.graphql.cdi.context
Class CDISmallRyeContext
java.lang.Object
io.smallrye.graphql.execution.context.SmallRyeContext
io.smallrye.graphql.cdi.context.CDISmallRyeContext
- All Implemented Interfaces:
io.smallrye.graphql.api.Context
public class CDISmallRyeContext
extends io.smallrye.graphql.execution.context.SmallRyeContext
Class that serves as a proxy decorator for obtaining the current SmallRyeContext. It always calls
SmallRyeContext.getContext() to obtain the current instance, and delegates to it.
This is necessary because the SmallRyeContext is an immutable class, yet we, in some cases,
need to be able to inject different instances of it during the serving of one HTTP request.
This way, we make sure that an @Inject-ed SmallRyeContext is never cached and calls to it always check
if there is a new context instance assigned to the current thread.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.smallrye.graphql.api.Context
io.smallrye.graphql.api.Context.VariablesParser -
Field Summary
Fields inherited from interface io.smallrye.graphql.api.Context
OPERATION_NAME, QUERY, VARIABLES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(String key, Object value) <A> AgetArgument(String name) <A> AgetArgumentOrDefault(String name, A defaultValue) graphql.schema.DataFetchingEnvironmentio.smallrye.graphql.execution.context.DocumentSuppliergraphql.ExecutionInputio.smallrye.graphql.schema.model.FieldgetField()getPath()getQuery()io.smallrye.graphql.execution.QueryCachejakarta.json.JsonObjectjakarta.json.JsonArrayjakarta.json.JsonArray<S> S<A> BooleanhasArgument(String name) booleanbooleanbooleanboolean<A> voidsetArguments(Map<String, A> arguments) voidsetDataFetchingEnvironment(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment) voidsetDocumentSupplier(io.smallrye.graphql.execution.context.DocumentSupplier documentSupplier) voidsetExecutionId(String executionId) voidsetExecutionInput(graphql.ExecutionInput executionInput) voidsetField(io.smallrye.graphql.schema.model.Field field) voidsetFieldName(String fieldName) voidsetOperationName(String operationName) voidsetOperationType(String operationType) voidsetParentTypeName(String parentTypeName) voidvoidsetQueryCache(io.smallrye.graphql.execution.QueryCache queryCache) voidsetRequest(jakarta.json.JsonObject request) voidsetRequestedOperationTypes(List<String> requestedOperationTypes) voidsetSelectedAndSourceFields(jakarta.json.JsonArray selectedAndSourceFields) voidsetSelectedFields(jakarta.json.JsonArray selectedFields) <S> voidsetSource(S source) toString()<T> TMethods inherited from class io.smallrye.graphql.execution.context.SmallRyeContext
clone, setExecutionResult
-
Constructor Details
-
CDISmallRyeContext
-
-
Method Details
-
unwrap
- Specified by:
unwrapin interfaceio.smallrye.graphql.api.Context- Overrides:
unwrapin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setDocumentSupplier
public void setDocumentSupplier(io.smallrye.graphql.execution.context.DocumentSupplier documentSupplier) - Overrides:
setDocumentSupplierin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getDocumentSupplier
public io.smallrye.graphql.execution.context.DocumentSupplier getDocumentSupplier()- Overrides:
getDocumentSupplierin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setQueryCache
public void setQueryCache(io.smallrye.graphql.execution.QueryCache queryCache) - Overrides:
setQueryCachein classio.smallrye.graphql.execution.context.SmallRyeContext
-
getQueryCache
public io.smallrye.graphql.execution.QueryCache getQueryCache()- Overrides:
getQueryCachein classio.smallrye.graphql.execution.context.SmallRyeContext
-
setExecutionInput
public void setExecutionInput(graphql.ExecutionInput executionInput) - Overrides:
setExecutionInputin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getExecutionInput
public graphql.ExecutionInput getExecutionInput()- Overrides:
getExecutionInputin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setDataFetchingEnvironment
public void setDataFetchingEnvironment(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment) - Overrides:
setDataFetchingEnvironmentin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getDataFetchingEnvironment
public graphql.schema.DataFetchingEnvironment getDataFetchingEnvironment()- Overrides:
getDataFetchingEnvironmentin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setParentTypeName
- Overrides:
setParentTypeNamein classio.smallrye.graphql.execution.context.SmallRyeContext
-
getParentTypeName
- Specified by:
getParentTypeNamein interfaceio.smallrye.graphql.api.Context- Overrides:
getParentTypeNamein classio.smallrye.graphql.execution.context.SmallRyeContext
-
setRequestedOperationTypes
- Overrides:
setRequestedOperationTypesin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getRequestedOperationTypes
- Specified by:
getRequestedOperationTypesin interfaceio.smallrye.graphql.api.Context- Overrides:
getRequestedOperationTypesin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setOperationType
- Overrides:
setOperationTypein classio.smallrye.graphql.execution.context.SmallRyeContext
-
getOperationType
- Specified by:
getOperationTypein interfaceio.smallrye.graphql.api.Context- Overrides:
getOperationTypein classio.smallrye.graphql.execution.context.SmallRyeContext
-
setSelectedAndSourceFields
public void setSelectedAndSourceFields(jakarta.json.JsonArray selectedAndSourceFields) - Overrides:
setSelectedAndSourceFieldsin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getSelectedAndSourceFields
public jakarta.json.JsonArray getSelectedAndSourceFields()- Specified by:
getSelectedAndSourceFieldsin interfaceio.smallrye.graphql.api.Context- Overrides:
getSelectedAndSourceFieldsin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setSelectedFields
public void setSelectedFields(jakarta.json.JsonArray selectedFields) - Overrides:
setSelectedFieldsin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getSelectedFields
public jakarta.json.JsonArray getSelectedFields()- Specified by:
getSelectedFieldsin interfaceio.smallrye.graphql.api.Context- Overrides:
getSelectedFieldsin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setPath
- Overrides:
setPathin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getPath
- Specified by:
getPathin interfaceio.smallrye.graphql.api.Context- Overrides:
getPathin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setSource
public <S> void setSource(S source) - Overrides:
setSourcein classio.smallrye.graphql.execution.context.SmallRyeContext
-
getSource
public <S> S getSource()- Specified by:
getSourcein interfaceio.smallrye.graphql.api.Context- Overrides:
getSourcein classio.smallrye.graphql.execution.context.SmallRyeContext
-
setArguments
- Overrides:
setArgumentsin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getArguments
- Specified by:
getArgumentsin interfaceio.smallrye.graphql.api.Context- Overrides:
getArgumentsin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setField
public void setField(io.smallrye.graphql.schema.model.Field field) - Overrides:
setFieldin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getField
public io.smallrye.graphql.schema.model.Field getField()- Overrides:
getFieldin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setFieldName
- Overrides:
setFieldNamein classio.smallrye.graphql.execution.context.SmallRyeContext
-
getFieldName
- Specified by:
getFieldNamein interfaceio.smallrye.graphql.api.Context- Overrides:
getFieldNamein classio.smallrye.graphql.execution.context.SmallRyeContext
-
setExecutionId
- Overrides:
setExecutionIdin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getExecutionId
- Specified by:
getExecutionIdin interfaceio.smallrye.graphql.api.Context- Overrides:
getExecutionIdin classio.smallrye.graphql.execution.context.SmallRyeContext
-
setRequest
public void setRequest(jakarta.json.JsonObject request) - Overrides:
setRequestin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getRequest
public jakarta.json.JsonObject getRequest()- Specified by:
getRequestin interfaceio.smallrye.graphql.api.Context- Overrides:
getRequestin classio.smallrye.graphql.execution.context.SmallRyeContext
-
hasSource
public boolean hasSource() -
getArgumentOrDefault
-
getArgument
-
hasArgument
-
hasVariables
public boolean hasVariables() -
getVariables
-
hasOperationName
public boolean hasOperationName() -
getOperationName
- Specified by:
getOperationNamein interfaceio.smallrye.graphql.api.Context- Overrides:
getOperationNamein classio.smallrye.graphql.execution.context.SmallRyeContext
-
setOperationName
- Overrides:
setOperationNamein classio.smallrye.graphql.execution.context.SmallRyeContext
-
getQuery
-
hasRequest
public boolean hasRequest() -
toString
- Overrides:
toStringin classio.smallrye.graphql.execution.context.SmallRyeContext
-
getAddedExtensions
- Overrides:
getAddedExtensionsin classio.smallrye.graphql.execution.context.SmallRyeContext
-
addExtension
- Overrides:
addExtensionin classio.smallrye.graphql.execution.context.SmallRyeContext
-