Sha256: a2271acb0623ee16c4d0772b1e092bb43c499edd32c5ae59891b9b10e7762228

Contents?: true

Size: 668 Bytes

Versions: 46

Compression:

Stored size: 668 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}'", node, context: context)
          GraphQL::Language::Visitor::SKIP
        else
          nil
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
graphql-1.8.18 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.17 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.16 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.15 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.14 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.13 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.12 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.11 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.10 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.9 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.8 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.7 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.6 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.5 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.4 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.3 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.2 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.1 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.0 lib/graphql/static_validation/rules/arguments_are_defined.rb
graphql-1.8.0.pre11 lib/graphql/static_validation/rules/arguments_are_defined.rb