Package graphql
Class TypeResolutionEnvironment
- java.lang.Object
-
- graphql.TypeResolutionEnvironment
-
@PublicApi public class TypeResolutionEnvironment extends java.lang.Object
This is passed to aTypeResolver
to help with object type resolution. SeeTypeResolver.getType(graphql.TypeResolutionEnvironment)
for how this is used
-
-
Constructor Summary
Constructors Constructor Description TypeResolutionEnvironment(TypeResolutionParameters parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getArguments()
<T> T
getContext()
Deprecated.usegetGraphQLContext()
insteadMergedField
getField()
GraphQLType
getFieldType()
GraphQLContext
getGraphQLContext()
<T> T
getLocalContext()
Returns the local context object set in viaDataFetcherResult.getLocalContext()
<T> T
getObject()
You will be passed the specific source object that needs to be resolved into a concrete graphql object typeGraphQLSchema
getSchema()
DataFetchingFieldSelectionSet
getSelectionSet()
-
-
-
Constructor Detail
-
TypeResolutionEnvironment
public TypeResolutionEnvironment(TypeResolutionParameters parameters)
-
-
Method Detail
-
getObject
public <T> T getObject()
You will be passed the specific source object that needs to be resolved into a concrete graphql object type- Type Parameters:
T
- you decide what type it is- Returns:
- the object that needs to be resolved into a specific graphql object type
-
getArguments
public java.util.Map<java.lang.String,java.lang.Object> getArguments()
- Returns:
- the runtime arguments to this the graphql field
-
getField
public MergedField getField()
- Returns:
- the graphql field in question
-
getFieldType
public GraphQLType getFieldType()
- Returns:
- the type of the graphql field, which still be either a
GraphQLUnionType
or aGraphQLInterfaceType
-
getSchema
public GraphQLSchema getSchema()
- Returns:
- the graphql schema in question
-
getContext
@Deprecated(since="2021-12-27") public <T> T getContext()
Deprecated.usegetGraphQLContext()
insteadReturns the context object set in viaExecutionInput.getContext()
- Type Parameters:
T
- the type to cast the result to- Returns:
- the context object
-
getGraphQLContext
public GraphQLContext getGraphQLContext()
- Returns:
- the
GraphQLContext
object set in viaExecutionInput.getGraphQLContext()
-
getLocalContext
public <T> T getLocalContext()
Returns the local context object set in viaDataFetcherResult.getLocalContext()
- Type Parameters:
T
- the type to cast the result to- Returns:
- the local context object
-
getSelectionSet
public DataFetchingFieldSelectionSet getSelectionSet()
- Returns:
- the
DataFetchingFieldSelectionSet
for the current field fetch that needs type resolution
-
-