Package graphql.normalized
Class VariableAccumulator
- java.lang.Object
-
- graphql.normalized.VariableAccumulator
-
public class VariableAccumulator extends java.lang.Object
This accumulator class decides on whether to create a variable for a query argument and if so it tracks what variables were made. TheExecutableNormalizedOperationToAstCompiler
then uses all the variables when it compiles the final document.
-
-
Constructor Summary
Constructors Constructor Description VariableAccumulator(@Nullable VariablePredicate variablePredicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VariableValueWithDefinition
accumulateVariable(NormalizedInputValue normalizedInputValue)
int
getAccumulatedSize()
java.util.List<VariableDefinition>
getVariableDefinitions()
java.util.Map<java.lang.String,java.lang.Object>
getVariablesMap()
boolean
shouldMakeVariable(ExecutableNormalizedField executableNormalizedField, java.lang.String argName, NormalizedInputValue normalizedInputValue)
-
-
-
Constructor Detail
-
VariableAccumulator
public VariableAccumulator(@Nullable @Nullable VariablePredicate variablePredicate)
-
-
Method Detail
-
shouldMakeVariable
public boolean shouldMakeVariable(ExecutableNormalizedField executableNormalizedField, java.lang.String argName, NormalizedInputValue normalizedInputValue)
-
accumulateVariable
public VariableValueWithDefinition accumulateVariable(NormalizedInputValue normalizedInputValue)
-
getAccumulatedSize
public int getAccumulatedSize()
-
getVariableDefinitions
public java.util.List<VariableDefinition> getVariableDefinitions()
- Returns:
- the variable definitions that would go on the operation declaration
-
getVariablesMap
public java.util.Map<java.lang.String,java.lang.Object> getVariablesMap()
- Returns:
- the map of variable names to variable values
-
-