Sha256: abeb792b5327ceba634a619dc790ed609d18d1cec49da12e40bceaa3ef10dc53

Contents?: true

Size: 580 Bytes

Versions: 13

Compression:

Stored size: 580 Bytes

Contents

module GraphQL
  module StaticValidation
    class ArgumentsAreDefined < GraphQL::StaticValidation::ArgumentsValidator
      def validate_node(parent, node, defn, context)
        argument_defn = defn.arguments[node.name]
        if argument_defn.nil?
          kind_of_node = node_type(parent)
          error_arg_name = parent_name(parent, defn)
          context.errors << message("#{kind_of_node} '#{error_arg_name}' doesn't accept argument '#{node.name}'", parent)
          GraphQL::Language::Visitor::SKIP
        else
          nil
        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/arguments_are_defined.rb
graphql-0.17.1 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.17.0 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.16.1 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.16.0 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.15.3 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.15.2 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.14.2 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.15.1 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.15.0 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.14.1 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.14.0 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-0.13.0 lib/graphql/static_validation/rules/arguments_are_defined.rb