Sha256: 68ff356fabce2b36e9252b35a16c96142cbe91459de6c6c15e7c6416fcdc21e3

Contents?: true

Size: 670 Bytes

Versions: 29

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module StaticValidation
    class ArgumentsAreDefined < GraphQL::StaticValidation::ArgumentsValidator
      def validate_node(parent, node, defn, context)
        argument_defn = context.warden.arguments(defn).find { |arg| arg.name == 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, context: context)
          GraphQL::Language::Visitor::SKIP
        else
          nil
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
graphql-1.6.7 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.6.6 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.6.5 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.6.4 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.15 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.6.3 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.6.2 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.6.1 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.6.0 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.14 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.13 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.7.1 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.12 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.11 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.10 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.9 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.8 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.7 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.6 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.5.5 lib/graphql/static_validation/rules/arguments_are_defined.rb