Class ExecutionStepInfo
java.lang.Object
graphql.execution.ExecutionStepInfo
As the graphql query executes, it forms a hierarchy from parent fields (and their type) to their child fields (and their type)
until a scalar type is encountered; this class captures that execution type information.
The static graphql type system (rightly) does not contain a hierarchy of child to parent types nor the nonnull ness of type instances, so this helper class adds this information during query execution.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionThis allows you to morph a type into a more specialized form yet return the same parent and non-null ness, for example taking aGraphQLInterfaceTypeand turning it into a specificGraphQLObjectTypeafter type resolution has occurred<T> @Nullable TgetArgument(String name) Returns the named argument@Nullable MergedFieldgetField()This returns the AST fields that matches thegetFieldDefinition()during execution@Nullable GraphQLFieldDefinitionThis returns the field definition that is in play when this type info was created or null if the type is a root query type@Nullable GraphQLObjectTypeThe GraphQLObjectType where fieldDefinition is defined.@Nullable ExecutionStepInfogetPath()getType()This returns the type for the current step.This returns the type which is unwrapped if it wasGraphQLNonNullwrapped<T extends GraphQLOutputType>
TThis returns the type which is unwrapped if it wasGraphQLNonNullwrapped and then cast to the target type.booleanbooleanbooleanstatic ExecutionStepInfo.Builderstatic ExecutionStepInfo.BuildernewExecutionStepInfo(ExecutionStepInfo existing) toString()transform(Consumer<ExecutionStepInfo.Builder> builderConsumer)
-
Method Details
-
getObjectType
The GraphQLObjectType where fieldDefinition is defined. Note: For the Introspection field __typename the returned object type doesn't actually contain the fieldDefinition.- Returns:
- the GraphQLObjectType defining the
getFieldDefinition()
-
getType
This returns the type for the current step.- Returns:
- the graphql type in question
-
getUnwrappedNonNullType
This returns the type which is unwrapped if it wasGraphQLNonNullwrapped- Returns:
- the graphql type in question
-
getUnwrappedNonNullTypeAs
This returns the type which is unwrapped if it wasGraphQLNonNullwrapped and then cast to the target type.- Type Parameters:
T- for two- Returns:
- the graphql type in question
-
getFieldDefinition
This returns the field definition that is in play when this type info was created or null if the type is a root query type- Returns:
- the field definition or null if there is not one
-
getField
This returns the AST fields that matches thegetFieldDefinition()during execution- Returns:
- the merged fields
-
getPath
- Returns:
- the
ResultPathto this info
-
isNonNullType
public boolean isNonNullType()- Returns:
- true if the type must be nonnull
-
isListType
public boolean isListType()- Returns:
- true if the type is a list
-
getArguments
-
getArgument
Returns the named argument- Type Parameters:
T- you decide what type it is- Parameters:
name- the name of the argument- Returns:
- the named argument or null if it's not present
-
getParent
- Returns:
- the parent type information
-
hasParent
public boolean hasParent()- Returns:
- true if the type has a parent (most do)
-
changeTypeWithPreservedNonNull
This allows you to morph a type into a more specialized form yet return the same parent and non-null ness, for example taking aGraphQLInterfaceTypeand turning it into a specificGraphQLObjectTypeafter type resolution has occurred- Parameters:
newType- the new type to be- Returns:
- a new type info with the same
-
simplePrint
- Returns:
- the type in graphql SDL format, eg [typeName!]!
-
toString
-
transform
-
getResultKey
-
newExecutionStepInfo
- Returns:
- a builder of type info
-
newExecutionStepInfo
-