Sha256: e142f6b64c8720c11548fba639119922b92bb41658327190bec535c2e26e374a

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

class GraphQL::StaticValidation::ArgumentLiteralsAreCompatible < GraphQL::StaticValidation::ArgumentsValidator
  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
      kind_of_node = node_type(parent)
      error_arg_name = parent_name(parent, defn)
      context.errors << message("Argument '#{node.name}' on #{kind_of_node} '#{error_arg_name}' has an invalid value", parent)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
graphql-0.10.9 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.10.8 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.10.7 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.10.6 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.10.5 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb