use of graphql.validation.ArgumentValidationUtil in project graphql-java by graphql-java.
the class ArgumentsOfCorrectType method checkArgument.
@Override
public void checkArgument(Argument argument) {
GraphQLArgument fieldArgument = getValidationContext().getArgument();
if (fieldArgument == null)
return;
ArgumentValidationUtil validationUtil = new ArgumentValidationUtil(argument);
if (!validationUtil.isValidLiteralValue(argument.getValue(), fieldArgument.getType(), getValidationContext().getSchema())) {
addError(ValidationErrorType.WrongType, argument.getSourceLocation(), validationUtil.getMessage());
}
}
Aggregations