Package graphql
Class TypeResolutionEnvironment
java.lang.Object
graphql.TypeResolutionEnvironment
This is passed to a
TypeResolver
to help with object type resolution.
See TypeResolver.getType(graphql.TypeResolutionEnvironment)
for how this is used-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
Deprecated.getField()
<T> T
Returns the local context object set in viaDataFetcherResult.getLocalContext()
<T> T
You will be passed the specific source object that needs to be resolved into a concrete graphql object type
-
Constructor Details
-
TypeResolutionEnvironment
-
-
Method Details
-
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
- Returns:
- the runtime arguments to this the graphql field
-
getField
- Returns:
- the graphql field in question
-
getFieldType
- Returns:
- the type of the graphql field, which still be either a
GraphQLUnionType
or aGraphQLInterfaceType
-
getSchema
- Returns:
- the graphql schema in question
-
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
- 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
- Returns:
- the
DataFetchingFieldSelectionSet
for the current field fetch that needs type resolution
-
getGraphQLContext()
instead