Package graphql.execution
Class ValuesResolverConversion
java.lang.Object
graphql.execution.ValuesResolverConversion
This class, originally broken out from
ValuesResolver
contains code for the conversion of values
from one form (literal, external etc..) to another.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Object
defaultValueToInternalValue
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, InputValueWithState defaultValue, GraphQLInputType type, GraphQLContext graphqlContext, Locale locale) (package private) static Object
externalValueToInternalValue
(GraphqlFieldVisibility fieldVisibility, Object externalValue, GraphQLInputType type, GraphQLContext graphqlContext, Locale locale) Converts an external value to an internal valueprivate static Object
externalValueToInternalValueForEnum
(GraphQLEnumType graphQLEnumType, Object value, GraphQLContext graphqlContext, Locale locale) including validationprivate static List
externalValueToInternalValueForList
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, Object value, GraphQLContext graphqlContext, Locale locale) including validationprivate static Object
externalValueToInternalValueForObject
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, Map<String, Object> inputMap, GraphQLContext graphqlContext, Locale locale) performs validationprivate static Object
externalValueToInternalValueForScalar
(GraphQLScalarType graphQLScalarType, Object value, GraphQLContext graphqlContext, Locale locale) including validation(package private) static CoercedVariables
externalValueToInternalValueForVariables
(InputInterceptor inputInterceptor, GraphQLSchema schema, List<VariableDefinition> variableDefinitions, RawVariables rawVariables, GraphQLContext graphqlContext, Locale locale) performs validation too(package private) static Object
externalValueToInternalValueImpl
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType graphQLType, Object originalValue, GraphQLContext graphqlContext, Locale locale) Performs validation too(package private) static Object
externalValueToLiteral
(GraphqlFieldVisibility fieldVisibility, @Nullable Object value, GraphQLInputType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale) No validation: the external value is assumed to be valid.private static Value
<?> externalValueToLiteralForEnum
(GraphQLEnumType enumType, Object value, GraphQLContext graphqlContext, Locale locale) No validationprivate static Object
externalValueToLiteralForList
(GraphqlFieldVisibility fieldVisibility, GraphQLList listType, Object value, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale) No validationprivate static Object
externalValueToLiteralForObject
(GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, Object inputValue, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale) No validationprivate static Value
<?> externalValueToLiteralForScalar
(GraphQLScalarType scalarType, Object value, GraphQLContext graphqlContext, @NotNull Locale locale) No validation(package private) static boolean
isNullValue
(Object value) (package private) static Object
literalToInternalValue
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, Locale locale) No validation (it was checked before via ArgumentsOfCorrectType and VariableDefaultValuesOfCorrectType)private static Object
literalToInternalValueForInputObject
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType type, ObjectValue inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, Locale locale) no validationprivate static Object
literalToInternalValueForList
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, Value value, CoercedVariables coercedVariables, GraphQLContext graphqlContext, Locale locale) no validationprivate static Object
literalToInternalValueForScalar
(Value inputValue, GraphQLScalarType scalarType, CoercedVariables coercedVariables, GraphQLContext graphqlContext, @NotNull Locale locale) no validationprivate static @Nullable Object
literalToInternalValueImpl
(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, Locale locale) private static Map
<String, ObjectField> mapObjectValueFieldsByName
(ObjectValue inputValue) (package private) static @Nullable Object
valueToInternalValueImpl
(InputInterceptor inputInterceptor, InputValueWithState inputValueWithState, GraphQLInputType inputType, GraphQLContext graphqlContext, Locale locale) (package private) static Object
valueToLiteralImpl
(GraphqlFieldVisibility fieldVisibility, InputValueWithState inputValueWithState, GraphQLType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale)
-
Constructor Details
-
ValuesResolverConversion
ValuesResolverConversion()
-
-
Method Details
-
valueToLiteralImpl
static Object valueToLiteralImpl(GraphqlFieldVisibility fieldVisibility, InputValueWithState inputValueWithState, GraphQLType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale) -
externalValueToInternalValue
static Object externalValueToInternalValue(GraphqlFieldVisibility fieldVisibility, Object externalValue, GraphQLInputType type, GraphQLContext graphqlContext, 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 Object valueToInternalValueImpl(InputInterceptor inputInterceptor, InputValueWithState inputValueWithState, GraphQLInputType inputType, GraphQLContext graphqlContext, Locale locale) -
externalValueToLiteral
static Object externalValueToLiteral(GraphqlFieldVisibility fieldVisibility, @Nullable @Nullable Object value, GraphQLInputType type, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale) No validation: the external value is assumed to be valid. -
externalValueToLiteralForScalar
private static Value<?> externalValueToLiteralForScalar(GraphQLScalarType scalarType, Object value, GraphQLContext graphqlContext, @NotNull @NotNull Locale locale) No validation -
externalValueToLiteralForEnum
private static Value<?> externalValueToLiteralForEnum(GraphQLEnumType enumType, Object value, GraphQLContext graphqlContext, Locale locale) No validation -
externalValueToLiteralForList
private static Object externalValueToLiteralForList(GraphqlFieldVisibility fieldVisibility, GraphQLList listType, Object value, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale) No validation -
externalValueToLiteralForObject
private static Object externalValueToLiteralForObject(GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, Object inputValue, ValuesResolver.ValueMode valueMode, GraphQLContext graphqlContext, Locale locale) No validation -
externalValueToInternalValueForVariables
static CoercedVariables externalValueToInternalValueForVariables(InputInterceptor inputInterceptor, GraphQLSchema schema, List<VariableDefinition> variableDefinitions, RawVariables rawVariables, GraphQLContext graphqlContext, Locale locale) performs validation too -
externalValueToInternalValueImpl
static Object externalValueToInternalValueImpl(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType graphQLType, Object originalValue, GraphQLContext graphqlContext, Locale locale) throws NonNullableValueCoercedAsNullException, CoercingParseValueException Performs validation too -
externalValueToInternalValueForObject
private static Object externalValueToInternalValueForObject(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType inputObjectType, Map<String, Object> inputMap, GraphQLContext graphqlContext, Locale locale) throws NonNullableValueCoercedAsNullException, CoercingParseValueExceptionperforms validation -
externalValueToInternalValueForScalar
private static Object externalValueToInternalValueForScalar(GraphQLScalarType graphQLScalarType, Object value, GraphQLContext graphqlContext, Locale locale) throws CoercingParseValueException including validation- Throws:
CoercingParseValueException
-
externalValueToInternalValueForEnum
private static Object externalValueToInternalValueForEnum(GraphQLEnumType graphQLEnumType, Object value, GraphQLContext graphqlContext, Locale locale) throws CoercingParseValueException including validation- Throws:
CoercingParseValueException
-
externalValueToInternalValueForList
private static List externalValueToInternalValueForList(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, Object value, GraphQLContext graphqlContext, Locale locale) throws CoercingParseValueException, NonNullableValueCoercedAsNullException including validation -
literalToInternalValue
static Object literalToInternalValue(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, 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 Object literalToInternalValueImpl(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLType type, Value inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, Locale locale) -
literalToInternalValueForScalar
private static Object literalToInternalValueForScalar(Value inputValue, GraphQLScalarType scalarType, CoercedVariables coercedVariables, GraphQLContext graphqlContext, @NotNull @NotNull Locale locale) no validation -
literalToInternalValueForList
private static Object literalToInternalValueForList(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLList graphQLList, Value value, CoercedVariables coercedVariables, GraphQLContext graphqlContext, Locale locale) no validation -
literalToInternalValueForInputObject
private static Object literalToInternalValueForInputObject(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, GraphQLInputObjectType type, ObjectValue inputValue, CoercedVariables coercedVariables, GraphQLContext graphqlContext, Locale locale) no validation -
isNullValue
-
mapObjectValueFieldsByName
-
defaultValueToInternalValue
static Object defaultValueToInternalValue(InputInterceptor inputInterceptor, GraphqlFieldVisibility fieldVisibility, InputValueWithState defaultValue, GraphQLInputType type, GraphQLContext graphqlContext, Locale locale)
-