graphql.execution.ValuesResolverOneOfValidation Maven / Gradle / Ivy
package graphql.execution;
import graphql.Assert;
import graphql.Internal;
import graphql.i18n.I18n;
import graphql.language.ArrayValue;
import graphql.language.ObjectField;
import graphql.language.ObjectValue;
import graphql.language.Value;
import graphql.schema.GraphQLInputObjectField;
import graphql.schema.GraphQLInputObjectType;
import graphql.schema.GraphQLInputType;
import graphql.schema.GraphQLList;
import graphql.schema.GraphQLType;
import graphql.schema.GraphQLTypeUtil;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
import static graphql.schema.GraphQLTypeUtil.isList;
@Internal
final class ValuesResolverOneOfValidation {
@SuppressWarnings("unchecked")
static void validateOneOfInputTypes(GraphQLType type, Object inputValue, Value> argumentValue, String argumentName, Locale locale) {
GraphQLType unwrappedNonNullType = GraphQLTypeUtil.unwrapNonNull(type);
if (isList(unwrappedNonNullType)
&& !ValuesResolverConversion.isNullValue(inputValue)
&& inputValue instanceof List
&& argumentValue instanceof ArrayValue) {
GraphQLType elementType = ((GraphQLList) unwrappedNonNullType).getWrappedType();
List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy