Package graphql.normalized
Class ExecutableNormalizedOperationFactory
java.lang.Object
graphql.normalized.ExecutableNormalizedOperationFactory
This factory can create a
ExecutableNormalizedOperation
which represents what would be executed
during a given graphql operation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
static class
private static class
static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
buildFieldWithChildren
(ExecutableNormalizedField executableNormalizedField, com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> fieldAndAstParents, FieldCollectorNormalizedQueryParams fieldCollectorNormalizedQueryParams, com.google.common.collect.ImmutableListMultimap.Builder<Field, ExecutableNormalizedField> fieldNormalizedField, BiConsumer<ExecutableNormalizedField, MergedField> captureMergedField, com.google.common.collect.ImmutableListMultimap.Builder<FieldCoordinates, ExecutableNormalizedField> coordinatesToNormalizedFields, int curLevel, int maxLevel) private void
collectField
(FieldCollectorNormalizedQueryParams parameters, List<ExecutableNormalizedOperationFactory.CollectedField> result, Field field, Set<GraphQLObjectType> possibleObjectTypes, GraphQLCompositeType astTypeCondition) private void
collectFragmentSpread
(FieldCollectorNormalizedQueryParams parameters, List<ExecutableNormalizedOperationFactory.CollectedField> result, FragmentSpread fragmentSpread, Set<GraphQLObjectType> possibleObjects) collectFromMergedField
(FieldCollectorNormalizedQueryParams parameters, ExecutableNormalizedField executableNormalizedField, com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> mergedField, int level) collectFromOperation
(FieldCollectorNormalizedQueryParams parameters, OperationDefinition operationDefinition, GraphQLObjectType rootType) private void
collectFromSelectionSet
(FieldCollectorNormalizedQueryParams parameters, SelectionSet selectionSet, List<ExecutableNormalizedOperationFactory.CollectedField> result, GraphQLCompositeType astTypeCondition, Set<GraphQLObjectType> possibleObjects) private void
collectInlineFragment
(FieldCollectorNormalizedQueryParams parameters, List<ExecutableNormalizedOperationFactory.CollectedField> result, InlineFragment inlineFragment, Set<GraphQLObjectType> possibleObjects, GraphQLCompositeType astTypeCondition) createExecutableNormalizedOperation
(GraphQLSchema graphQLSchema, Document document, String operationName, CoercedVariables coercedVariableValues) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.createExecutableNormalizedOperation
(GraphQLSchema graphQLSchema, OperationDefinition operationDefinition, Map<String, FragmentDefinition> fragments, CoercedVariables coercedVariableValues) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.private ExecutableNormalizedOperation
createExecutableNormalizedOperationImplWithRawVariables
(GraphQLSchema graphQLSchema, OperationDefinition operationDefinition, Map<String, FragmentDefinition> fragments, RawVariables rawVariables, ExecutableNormalizedOperationFactory.Options options) createExecutableNormalizedOperationWithRawVariables
(GraphQLSchema graphQLSchema, Document document, String operationName, RawVariables rawVariables) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.createExecutableNormalizedOperationWithRawVariables
(GraphQLSchema graphQLSchema, Document document, String operationName, RawVariables rawVariables, GraphQLContext graphQLContext, Locale locale) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.createExecutableNormalizedOperationWithRawVariables
(GraphQLSchema graphQLSchema, Document document, String operationName, RawVariables rawVariables, ExecutableNormalizedOperationFactory.Options options) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.private ExecutableNormalizedField
createNF
(FieldCollectorNormalizedQueryParams parameters, ExecutableNormalizedOperationFactory.CollectedFieldGroup collectedFieldGroup, int level, ExecutableNormalizedField parent) private void
createNFs
(com.google.common.collect.ImmutableList.Builder<ExecutableNormalizedField> nfListBuilder, FieldCollectorNormalizedQueryParams parameters, Map<String, List<ExecutableNormalizedOperationFactory.CollectedField>> fieldsByName, com.google.common.collect.ImmutableListMultimap.Builder<ExecutableNormalizedField, ExecutableNormalizedOperationFactory.FieldAndAstParent> normalizedFieldToAstFields, int level, ExecutableNormalizedField parent) private ExecutableNormalizedOperation
createNormalizedQueryImpl
(GraphQLSchema graphQLSchema, OperationDefinition operationDefinition, Map<String, FragmentDefinition> fragments, CoercedVariables coercedVariableValues, @Nullable Map<String, NormalizedInputValue> normalizedVariableValues, ExecutableNormalizedOperationFactory.Options options) Creates a new ExecutableNormalizedOperation for the provided queryfieldsByResultKey
(List<ExecutableNormalizedOperationFactory.CollectedField> collectedFields) private Set
<GraphQLObjectType> narrowDownPossibleObjects
(Set<GraphQLObjectType> currentOnes, GraphQLCompositeType typeCondition, GraphQLSchema graphQLSchema) private static MergedField
newMergedField
(com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> fieldAndAstParents) private com.google.common.collect.ImmutableSet
<GraphQLObjectType> resolvePossibleObjects
(GraphQLCompositeType type, GraphQLSchema graphQLSchema) private com.google.common.collect.ImmutableSet
<GraphQLObjectType> resolvePossibleObjects
(List<GraphQLFieldDefinition> defs, GraphQLSchema graphQLSchema) private void
updateCoordinatedToNFMap
(com.google.common.collect.ImmutableListMultimap.Builder<FieldCoordinates, ExecutableNormalizedField> coordinatesToNormalizedFields, ExecutableNormalizedField topLevel) private void
updateFieldToNFMap
(ExecutableNormalizedField executableNormalizedField, com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> mergedField, com.google.common.collect.ImmutableListMultimap.Builder<Field, ExecutableNormalizedField> fieldToNormalizedField)
-
Field Details
-
conditionalNodes
-
-
Constructor Details
-
ExecutableNormalizedOperationFactory
public ExecutableNormalizedOperationFactory()
-
-
Method Details
-
createExecutableNormalizedOperation
public static ExecutableNormalizedOperation createExecutableNormalizedOperation(GraphQLSchema graphQLSchema, Document document, String operationName, CoercedVariables coercedVariableValues) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.- Parameters:
graphQLSchema
- the schema to be useddocument
- theDocument
holding the operation textoperationName
- the operation name to usecoercedVariableValues
- the coerced variables to use- Returns:
- a runtime representation of the graphql operation.
-
createExecutableNormalizedOperation
public static ExecutableNormalizedOperation createExecutableNormalizedOperation(GraphQLSchema graphQLSchema, OperationDefinition operationDefinition, Map<String, FragmentDefinition> fragments, CoercedVariables coercedVariableValues) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.- Parameters:
graphQLSchema
- the schema to be usedoperationDefinition
- the operation to be executedfragments
- a set of fragments associated with the operationcoercedVariableValues
- the coerced variables to use- Returns:
- a runtime representation of the graphql operation.
-
createExecutableNormalizedOperationWithRawVariables
public static ExecutableNormalizedOperation createExecutableNormalizedOperationWithRawVariables(GraphQLSchema graphQLSchema, Document document, String operationName, RawVariables rawVariables) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.- Parameters:
graphQLSchema
- the schema to be useddocument
- theDocument
holding the operation textoperationName
- the operation name to userawVariables
- the raw variables to be coerced- Returns:
- a runtime representation of the graphql operation.
-
createExecutableNormalizedOperationWithRawVariables
public static ExecutableNormalizedOperation createExecutableNormalizedOperationWithRawVariables(GraphQLSchema graphQLSchema, Document document, String operationName, RawVariables rawVariables, GraphQLContext graphQLContext, Locale locale) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.- Parameters:
graphQLSchema
- the schema to be useddocument
- theDocument
holding the operation textoperationName
- the operation name to userawVariables
- the raw variables that have not yet been coercedgraphQLContext
- theGraphQLContext
to use during coercionlocale
- theLocale
to use during coercion- Returns:
- a runtime representation of the graphql operation.
-
createExecutableNormalizedOperationWithRawVariables
public static ExecutableNormalizedOperation createExecutableNormalizedOperationWithRawVariables(GraphQLSchema graphQLSchema, Document document, String operationName, RawVariables rawVariables, ExecutableNormalizedOperationFactory.Options options) This will create a runtime representation of the graphql operation that would be executed in a runtime sense.- Parameters:
graphQLSchema
- the schema to be useddocument
- theDocument
holding the operation textoperationName
- the operation name to userawVariables
- the raw variables that have not yet been coercedoptions
- theExecutableNormalizedOperationFactory.Options
to use for parsing- Returns:
- a runtime representation of the graphql operation.
-
createExecutableNormalizedOperationImplWithRawVariables
private ExecutableNormalizedOperation createExecutableNormalizedOperationImplWithRawVariables(GraphQLSchema graphQLSchema, OperationDefinition operationDefinition, Map<String, FragmentDefinition> fragments, RawVariables rawVariables, ExecutableNormalizedOperationFactory.Options options) -
createNormalizedQueryImpl
private ExecutableNormalizedOperation createNormalizedQueryImpl(GraphQLSchema graphQLSchema, OperationDefinition operationDefinition, Map<String, FragmentDefinition> fragments, CoercedVariables coercedVariableValues, @Nullable @Nullable Map<String, NormalizedInputValue> normalizedVariableValues, ExecutableNormalizedOperationFactory.Options options) Creates a new ExecutableNormalizedOperation for the provided query -
buildFieldWithChildren
private void buildFieldWithChildren(ExecutableNormalizedField executableNormalizedField, com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> fieldAndAstParents, FieldCollectorNormalizedQueryParams fieldCollectorNormalizedQueryParams, com.google.common.collect.ImmutableListMultimap.Builder<Field, ExecutableNormalizedField> fieldNormalizedField, BiConsumer<ExecutableNormalizedField, MergedField> captureMergedField, com.google.common.collect.ImmutableListMultimap.Builder<FieldCoordinates, ExecutableNormalizedField> coordinatesToNormalizedFields, int curLevel, int maxLevel) -
newMergedField
private static MergedField newMergedField(com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> fieldAndAstParents) -
updateFieldToNFMap
private void updateFieldToNFMap(ExecutableNormalizedField executableNormalizedField, com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> mergedField, com.google.common.collect.ImmutableListMultimap.Builder<Field, ExecutableNormalizedField> fieldToNormalizedField) -
updateCoordinatedToNFMap
private void updateCoordinatedToNFMap(com.google.common.collect.ImmutableListMultimap.Builder<FieldCoordinates, ExecutableNormalizedField> coordinatesToNormalizedFields, ExecutableNormalizedField topLevel) -
collectFromMergedField
public ExecutableNormalizedOperationFactory.CollectNFResult collectFromMergedField(FieldCollectorNormalizedQueryParams parameters, ExecutableNormalizedField executableNormalizedField, com.google.common.collect.ImmutableList<ExecutableNormalizedOperationFactory.FieldAndAstParent> mergedField, int level) -
fieldsByResultKey
private Map<String,List<ExecutableNormalizedOperationFactory.CollectedField>> fieldsByResultKey(List<ExecutableNormalizedOperationFactory.CollectedField> collectedFields) -
collectFromOperation
public ExecutableNormalizedOperationFactory.CollectNFResult collectFromOperation(FieldCollectorNormalizedQueryParams parameters, OperationDefinition operationDefinition, GraphQLObjectType rootType) -
createNFs
private void createNFs(com.google.common.collect.ImmutableList.Builder<ExecutableNormalizedField> nfListBuilder, FieldCollectorNormalizedQueryParams parameters, Map<String, List<ExecutableNormalizedOperationFactory.CollectedField>> fieldsByName, com.google.common.collect.ImmutableListMultimap.Builder<ExecutableNormalizedField, ExecutableNormalizedOperationFactory.FieldAndAstParent> normalizedFieldToAstFields, int level, ExecutableNormalizedField parent) -
createNF
private ExecutableNormalizedField createNF(FieldCollectorNormalizedQueryParams parameters, ExecutableNormalizedOperationFactory.CollectedFieldGroup collectedFieldGroup, int level, ExecutableNormalizedField parent) -
groupByCommonParents
private List<ExecutableNormalizedOperationFactory.CollectedFieldGroup> groupByCommonParents(Collection<ExecutableNormalizedOperationFactory.CollectedField> fields) -
collectFromSelectionSet
private void collectFromSelectionSet(FieldCollectorNormalizedQueryParams parameters, SelectionSet selectionSet, List<ExecutableNormalizedOperationFactory.CollectedField> result, GraphQLCompositeType astTypeCondition, Set<GraphQLObjectType> possibleObjects) -
collectFragmentSpread
private void collectFragmentSpread(FieldCollectorNormalizedQueryParams parameters, List<ExecutableNormalizedOperationFactory.CollectedField> result, FragmentSpread fragmentSpread, Set<GraphQLObjectType> possibleObjects) -
collectInlineFragment
private void collectInlineFragment(FieldCollectorNormalizedQueryParams parameters, List<ExecutableNormalizedOperationFactory.CollectedField> result, InlineFragment inlineFragment, Set<GraphQLObjectType> possibleObjects, GraphQLCompositeType astTypeCondition) -
collectField
private void collectField(FieldCollectorNormalizedQueryParams parameters, List<ExecutableNormalizedOperationFactory.CollectedField> result, Field field, Set<GraphQLObjectType> possibleObjectTypes, GraphQLCompositeType astTypeCondition) -
narrowDownPossibleObjects
private Set<GraphQLObjectType> narrowDownPossibleObjects(Set<GraphQLObjectType> currentOnes, GraphQLCompositeType typeCondition, GraphQLSchema graphQLSchema) -
resolvePossibleObjects
private com.google.common.collect.ImmutableSet<GraphQLObjectType> resolvePossibleObjects(List<GraphQLFieldDefinition> defs, GraphQLSchema graphQLSchema) -
resolvePossibleObjects
private com.google.common.collect.ImmutableSet<GraphQLObjectType> resolvePossibleObjects(GraphQLCompositeType type, GraphQLSchema graphQLSchema)
-