Package graphql.execution
Class ValuesResolverConversion
- java.lang.Object
-
- graphql.execution.ValuesResolverConversion
-
class ValuesResolverConversion extends java.lang.Object
This class, originally broken out fromValuesResolver
contains code for the conversion of values from one form (literal, external etc..) to another.
-
-
Constructor Summary
Constructors Constructor Description ValuesResolverConversion()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.Object
defaultValueToInternalValue(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, InputValueWithState defaultValue, GraphQLInputType type, GraphQLContext graphqlContext, java.util.Locale locale)
(package private) static java.lang.Object
externalValueToInternalValue(GraphqlFieldVisibility fieldVisibility, java.lang.Object externalValue, GraphQLInputType type, GraphQLContext graphqlContext, java.util.Locale locale)
Converts an external value to an internal valueprivate static java.lang.Object
externalValueToInternalValueForEnum(GraphQLEnumType graphQLEnumType, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale)
including validationprivate static java.util.List
externalValueToInternalValueForList(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale)
including validationprivate static java.lang.Object
externalValueToInternalValueForObject(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, java.util.Map<java.lang.String,java.lang.Object> inputMap, GraphQLContext graphqlContext, java.util.Locale locale)
performs validationprivate static java.lang.Object
externalValueToInternalValueForScalar(GraphQLScalarType graphQLScalarType, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale)
including validation(package private) static CoercedVariables
externalValueToInternalValueForVariables(InputInterceptor inputInterceptor, GraphQLSchema schema, java.util.List<VariableDefinition> variableDefinitions, RawVariables rawVariables, GraphQLContext graphqlContext, java.util.Locale locale)
performs validation too(package private) static java.lang.Object
externalValueToInternalValueImpl(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType graphQLType, java.lang.Object originalValue, GraphQLContext graphqlContext, java.util.Locale locale)
Performs validation too(package private) static java.lang.Object
externalValueToLiteral(GraphqlFieldVisibility fieldVisibility, @Nullable java.lang.Object value, GraphQLInputType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
No validation: the external value is assumed to be valid.private static Value<?>
externalValueToLiteralForEnum(GraphQLEnumType enumType, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale)
No validationprivate static java.lang.Object
externalValueToLiteralForList(GraphqlFieldVisibility fieldVisibility, GraphQLList listType, java.lang.Object value, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
No validationprivate static java.lang.Object
externalValueToLiteralForObject(GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, java.lang.Object inputValue, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
No validationprivate static Value<?>
externalValueToLiteralForScalar(GraphQLScalarType scalarType, java.lang.Object value, GraphQLContext graphqlContext, @NotNull java.util.Locale locale)
No validation(package private) static boolean
isNullValue(java.lang.Object value)
(package private) static java.lang.Object
literalToInternalValue(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
No validation (it was checked before via ArgumentsOfCorrectType and VariableDefaultValuesOfCorrectType)private static java.lang.Object
literalToInternalValueForInputObject(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType type, ObjectValue inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
no validationprivate static java.lang.Object
literalToInternalValueForList(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, Value value, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
no validationprivate static java.lang.Object
literalToInternalValueForScalar(Value inputValue, GraphQLScalarType scalarType, CoercedVariables coercedVariables, GraphQLContext graphqlContext, @NotNull java.util.Locale locale)
no validationprivate static @Nullable java.lang.Object
literalToInternalValueImpl(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
private static java.util.Map<java.lang.String,ObjectField>
mapObjectValueFieldsByName(ObjectValue inputValue)
(package private) static @Nullable java.lang.Object
valueToInternalValueImpl(InputInterceptor inputInterceptor, InputValueWithState inputValueWithState, GraphQLInputType inputType, GraphQLContext graphqlContext, java.util.Locale locale)
(package private) static java.lang.Object
valueToLiteralImpl(GraphqlFieldVisibility fieldVisibility, InputValueWithState inputValueWithState, GraphQLType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
-
-
-
Method Detail
-
valueToLiteralImpl
static java.lang.Object valueToLiteralImpl(GraphqlFieldVisibility fieldVisibility, InputValueWithState inputValueWithState, GraphQLType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
-
externalValueToInternalValue
static java.lang.Object externalValueToInternalValue(GraphqlFieldVisibility fieldVisibility, java.lang.Object externalValue, GraphQLInputType type, GraphQLContext graphqlContext, java.util.Locale locale)
Converts an external value to an internal value- Parameters:
fieldVisibility
- the field visibility to useexternalValue
- the input external valuetype
- the type of input valuegraphqlContext
- the GraphqlContext to uselocale
- the Locale to use- Returns:
- a value converted to an internal value
-
valueToInternalValueImpl
@Nullable static @Nullable java.lang.Object valueToInternalValueImpl(InputInterceptor inputInterceptor, InputValueWithState inputValueWithState, GraphQLInputType inputType, GraphQLContext graphqlContext, java.util.Locale locale)
-
externalValueToLiteral
static java.lang.Object externalValueToLiteral(GraphqlFieldVisibility fieldVisibility, @Nullable @Nullable java.lang.Object value, GraphQLInputType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
No validation: the external value is assumed to be valid.
-
externalValueToLiteralForScalar
private static Value<?> externalValueToLiteralForScalar(GraphQLScalarType scalarType, java.lang.Object value, GraphQLContext graphqlContext, @NotNull @NotNull java.util.Locale locale)
No validation
-
externalValueToLiteralForEnum
private static Value<?> externalValueToLiteralForEnum(GraphQLEnumType enumType, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale)
No validation
-
externalValueToLiteralForList
private static java.lang.Object externalValueToLiteralForList(GraphqlFieldVisibility fieldVisibility, GraphQLList listType, java.lang.Object value, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
No validation
-
externalValueToLiteralForObject
private static java.lang.Object externalValueToLiteralForObject(GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, java.lang.Object inputValue, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, java.util.Locale locale)
No validation
-
externalValueToInternalValueForVariables
static CoercedVariables externalValueToInternalValueForVariables(InputInterceptor inputInterceptor, GraphQLSchema schema, java.util.List<VariableDefinition> variableDefinitions, RawVariables rawVariables, GraphQLContext graphqlContext, java.util.Locale locale)
performs validation too
-
externalValueToInternalValueImpl
static java.lang.Object externalValueToInternalValueImpl(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType graphQLType, java.lang.Object originalValue, GraphQLContext graphqlContext, java.util.Locale locale) throws NonNullableValueCoercedAsNullException, CoercingParseValueException
Performs validation too
-
externalValueToInternalValueForObject
private static java.lang.Object externalValueToInternalValueForObject(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, java.util.Map<java.lang.String,java.lang.Object> inputMap, GraphQLContext graphqlContext, java.util.Locale locale) throws NonNullableValueCoercedAsNullException, CoercingParseValueException
performs validation
-
externalValueToInternalValueForScalar
private static java.lang.Object externalValueToInternalValueForScalar(GraphQLScalarType graphQLScalarType, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale) throws CoercingParseValueException
including validation- Throws:
CoercingParseValueException
-
externalValueToInternalValueForEnum
private static java.lang.Object externalValueToInternalValueForEnum(GraphQLEnumType graphQLEnumType, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale) throws CoercingParseValueException
including validation- Throws:
CoercingParseValueException
-
externalValueToInternalValueForList
private static java.util.List externalValueToInternalValueForList(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, java.lang.Object value, GraphQLContext graphqlContext, java.util.Locale locale) throws CoercingParseValueException, NonNullableValueCoercedAsNullException
including validation
-
literalToInternalValue
static java.lang.Object literalToInternalValue(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
No validation (it was checked before via ArgumentsOfCorrectType and VariableDefaultValuesOfCorrectType)- Parameters:
fieldVisibility
- the field visibilitytype
- the type of the input valueinputValue
- the AST literal to be changedcoercedVariables
- the coerced variable valuesgraphqlContext
- the GraphqlContext to uselocale
- the Locale to use- Returns:
- literal converted to an internal value
-
literalToInternalValueImpl
@Nullable private static @Nullable java.lang.Object literalToInternalValueImpl(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
-
literalToInternalValueForScalar
private static java.lang.Object literalToInternalValueForScalar(Value inputValue, GraphQLScalarType scalarType, CoercedVariables coercedVariables, GraphQLContext graphqlContext, @NotNull @NotNull java.util.Locale locale)
no validation
-
literalToInternalValueForList
private static java.lang.Object literalToInternalValueForList(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, Value value, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
no validation
-
literalToInternalValueForInputObject
private static java.lang.Object literalToInternalValueForInputObject(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType type, ObjectValue inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, java.util.Locale locale)
no validation
-
isNullValue
static boolean isNullValue(java.lang.Object value)
-
mapObjectValueFieldsByName
private static java.util.Map<java.lang.String,ObjectField> mapObjectValueFieldsByName(ObjectValue inputValue)
-
defaultValueToInternalValue
static java.lang.Object defaultValueToInternalValue(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, InputValueWithState defaultValue, GraphQLInputType type, GraphQLContext graphqlContext, java.util.Locale locale)
-
-