Sha256: c9504ecf5e274a847bb831d524844947d72f3a02e2e42e9583de46d62b01c97a

Contents?: true

Size: 754 Bytes

Versions: 13

Compression:

Stored size: 754 Bytes

Contents

module GraphQL
  module StaticValidation
    class 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]
        return unless arg_defn
        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
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
graphql-0.17.2 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.17.1 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.17.0 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.16.1 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.16.0 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.15.3 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.15.2 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.14.2 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.15.1 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.15.0 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.14.1 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.14.0 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
graphql-0.13.0 lib/graphql/static_validation/rules/argument_literals_are_compatible.rb