@PublicApi public class ExecutableNormalizedOperation extends java.lang.Object
ExecutableNormalizedOperation
represent how the text of a graphql operation (sometimes known colloquially as a query)
will be executed at runtime according to the graphql specification. It handles complex mechanisms like merging
duplicate fields into one and also detecting when the types of a given field may actually be for more than one possible object
type.
An operation consists of a list of ExecutableNormalizedField
s in a parent child hierarchy
Constructor and Description |
---|
ExecutableNormalizedOperation(OperationDefinition.Operation operation,
java.lang.String operationName,
java.util.List<ExecutableNormalizedField> topLevelFields,
com.google.common.collect.ImmutableListMultimap<Field,ExecutableNormalizedField> fieldToNormalizedField,
java.util.Map<ExecutableNormalizedField,MergedField> normalizedFieldToMergedField,
java.util.Map<ExecutableNormalizedField,QueryDirectives> normalizedFieldToQueryDirectives,
com.google.common.collect.ImmutableListMultimap<FieldCoordinates,ExecutableNormalizedField> coordinatesToNormalizedFields,
int operationFieldCount,
int operationDepth) |
public ExecutableNormalizedOperation(OperationDefinition.Operation operation, java.lang.String operationName, java.util.List<ExecutableNormalizedField> topLevelFields, com.google.common.collect.ImmutableListMultimap<Field,ExecutableNormalizedField> fieldToNormalizedField, java.util.Map<ExecutableNormalizedField,MergedField> normalizedFieldToMergedField, java.util.Map<ExecutableNormalizedField,QueryDirectives> normalizedFieldToQueryDirectives, com.google.common.collect.ImmutableListMultimap<FieldCoordinates,ExecutableNormalizedField> coordinatesToNormalizedFields, int operationFieldCount, int operationDepth)
public OperationDefinition.Operation getOperation()
public java.lang.String getOperationName()
public int getOperationFieldCount()
ExecutableNormalizedField
s are in the operation.public int getOperationDepth()
public com.google.common.collect.ImmutableListMultimap<FieldCoordinates,ExecutableNormalizedField> getCoordinatesToNormalizedFields()
ExecutableNormalizedField
maps to a one or more field coordinate in the schemapublic java.util.List<ExecutableNormalizedField> getTopLevelFields()
ExecutableNormalizedField
s in this operation.public com.google.common.collect.ImmutableListMultimap<Field,ExecutableNormalizedField> getFieldToNormalizedField()
Field
to ExecutableNormalizedField
public java.util.List<ExecutableNormalizedField> getNormalizedFields(Field field)
ExecutableNormalizedField
s given a Field
AST element in the operationfield
- the field to look upExecutableNormalizedField
s that represent that fieldpublic java.util.Map<ExecutableNormalizedField,MergedField> getNormalizedFieldToMergedField()
ExecutableNormalizedField
to MergedField
spublic MergedField getMergedField(ExecutableNormalizedField executableNormalizedField)
MergedField
given a ExecutableNormalizedField
executableNormalizedField
- the field to use the keyMergedField
or null if its not presentpublic java.util.Map<ExecutableNormalizedField,QueryDirectives> getNormalizedFieldToQueryDirectives()
ExecutableNormalizedField
to its QueryDirectives
public QueryDirectives getQueryDirectives(ExecutableNormalizedField executableNormalizedField)
QueryDirectives
associated with the given ExecutableNormalizedField
executableNormalizedField
- the executable normalised field in questionpublic ExecutableNormalizedField getNormalizedField(MergedField mergedField, GraphQLFieldsContainer fieldsContainer, ResultPath resultPath)
ExecutableNormalizedField
given a merged field and a result path. If this does not find a field it will assert with an exceptionmergedField
- the merged fieldfieldsContainer
- the containing type of that fieldresultPath
- the result path in play