2
3
4
5
6
7
8
9
10
|
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible.rb', line 2
def validate_node(parent, node, defn, context)
return if node.value.is_a?(GraphQL::Language::Nodes::VariableIdentifier)
validator = GraphQL::StaticValidation::LiteralValidator.new
arg_defn = defn.arguments[node.name]
valid = validator.validate(node.value, arg_defn.type)
if !valid
context.errors << message("Argument #{node.name} on #{parent.class.name.split("::").last} '#{parent.name}' has an invalid value", parent)
end
end
|