public class ValuesResolver
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ValuesResolver.ValueMode |
Constructor and Description |
---|
ValuesResolver() |
Modifier and Type | Method and Description |
---|---|
CoercedVariables |
coerceVariableValues(GraphQLSchema schema,
java.util.List<VariableDefinition> variableDefinitions,
RawVariables rawVariables)
This method coerces the "raw" variables values provided to the engine.
|
static java.lang.Object |
externalValueToInternalValue(GraphqlFieldVisibility fieldVisibility,
java.lang.Object externalValue,
GraphQLInputType type)
Converts an external value to an internal value
|
java.util.Map<java.lang.String,java.lang.Object> |
getArgumentValues(GraphQLCodeRegistry codeRegistry,
java.util.List<GraphQLArgument> argumentTypes,
java.util.List<Argument> arguments,
CoercedVariables coercedVariables) |
java.util.Map<java.lang.String,java.lang.Object> |
getArgumentValues(java.util.List<GraphQLArgument> argumentTypes,
java.util.List<Argument> arguments,
CoercedVariables coercedVariables)
This is not used for validation: the argument literals are all validated and the variables are validated (when coerced)
|
static <T> T |
getInputValueImpl(GraphQLInputType inputType,
InputValueWithState inputValue) |
java.util.Map<java.lang.String,NormalizedInputValue> |
getNormalizedArgumentValues(java.util.List<GraphQLArgument> argumentTypes,
java.util.List<Argument> arguments,
java.util.Map<java.lang.String,NormalizedInputValue> normalizedVariables)
No validation as the arguments are assumed valid
|
java.util.Map<java.lang.String,NormalizedInputValue> |
getNormalizedVariableValues(GraphQLSchema schema,
java.util.List<VariableDefinition> variableDefinitions,
RawVariables rawVariables)
Normalized variables values are Literals with type information.
|
java.lang.Object |
literalToInternalValue(GraphqlFieldVisibility fieldVisibility,
GraphQLType type,
Value inputValue,
CoercedVariables coercedVariables)
No validation (it was checked before via ArgumentsOfCorrectType and VariableDefaultValuesOfCorrectType)
|
java.lang.Object |
literalToNormalizedValue(GraphqlFieldVisibility fieldVisibility,
GraphQLType type,
Value inputValue,
java.util.Map<java.lang.String,NormalizedInputValue> normalizedVariables) |
static java.lang.Object |
valueToInternalValue(InputValueWithState inputValueWithState,
GraphQLType type) |
static Value<?> |
valueToLiteral(@NotNull GraphqlFieldVisibility fieldVisibility,
@NotNull InputValueWithState inputValueWithState,
@NotNull GraphQLType type)
Takes a value which can be in different states (internal, literal, external value) and converts into Literal
This assumes the value is valid!
|
static Value<?> |
valueToLiteral(InputValueWithState inputValueWithState,
GraphQLType type) |
public CoercedVariables coerceVariableValues(GraphQLSchema schema, java.util.List<VariableDefinition> variableDefinitions, RawVariables rawVariables) throws CoercingParseValueException, NonNullableValueCoercedAsNullException
DataFetchingEnvironment
This method is called once per execution and also performs validation.schema
- the schemavariableDefinitions
- the variable definitionsrawVariables
- the supplied variablesCoercingParseValueException
NonNullableValueCoercedAsNullException
public java.util.Map<java.lang.String,NormalizedInputValue> getNormalizedVariableValues(GraphQLSchema schema, java.util.List<VariableDefinition> variableDefinitions, RawVariables rawVariables)
schema
- the schema to usevariableDefinitions
- the list of variable definitionsrawVariables
- the raw variablespublic java.util.Map<java.lang.String,java.lang.Object> getArgumentValues(java.util.List<GraphQLArgument> argumentTypes, java.util.List<Argument> arguments, CoercedVariables coercedVariables)
argumentTypes
- the list of argument typesarguments
- the AST argumentscoercedVariables
- the coerced variablespublic java.util.Map<java.lang.String,NormalizedInputValue> getNormalizedArgumentValues(java.util.List<GraphQLArgument> argumentTypes, java.util.List<Argument> arguments, java.util.Map<java.lang.String,NormalizedInputValue> normalizedVariables)
argumentTypes
- the list of argument typesarguments
- the AST argumentsnormalizedVariables
- the normalised variablespublic java.util.Map<java.lang.String,java.lang.Object> getArgumentValues(GraphQLCodeRegistry codeRegistry, java.util.List<GraphQLArgument> argumentTypes, java.util.List<Argument> arguments, CoercedVariables coercedVariables)
public static Value<?> valueToLiteral(InputValueWithState inputValueWithState, GraphQLType type)
public static Value<?> valueToLiteral(@NotNull @NotNull GraphqlFieldVisibility fieldVisibility, @NotNull @NotNull InputValueWithState inputValueWithState, @NotNull @NotNull GraphQLType type)
fieldVisibility
- the field visibility to useinputValueWithState
- the input valuetype
- the type of input valuepublic static java.lang.Object externalValueToInternalValue(GraphqlFieldVisibility fieldVisibility, java.lang.Object externalValue, GraphQLInputType type)
fieldVisibility
- the field visibility to useexternalValue
- the input external valuetype
- the type of input valuepublic static java.lang.Object valueToInternalValue(InputValueWithState inputValueWithState, GraphQLType type) throws CoercingParseValueException, CoercingParseLiteralException
@Nullable public static <T> T getInputValueImpl(GraphQLInputType inputType, InputValueWithState inputValue)
public java.lang.Object literalToNormalizedValue(GraphqlFieldVisibility fieldVisibility, GraphQLType type, Value inputValue, java.util.Map<java.lang.String,NormalizedInputValue> normalizedVariables)
public java.lang.Object literalToInternalValue(GraphqlFieldVisibility fieldVisibility, GraphQLType type, Value inputValue, CoercedVariables coercedVariables)
fieldVisibility
- the field visibilitytype
- the type of the input valueinputValue
- the AST literal to be changedcoercedVariables
- the coerced variable values