Sha256: 45f3f3e2c7dd208f3da260a121a7cac0b59a7afc379205d57371220ed5f01bd1

Contents?: true

Size: 628 Bytes

Versions: 11

Compression:

Stored size: 628 Bytes

Contents

# Implement validate_node
class GraphQL::StaticValidation::ArgumentsValidator
  include GraphQL::StaticValidation::Message::MessageHelper

  def validate(context)
    visitor = context.visitor
    visitor[GraphQL::Language::Nodes::Argument] << -> (node, parent) {
      return if parent.is_a?(GraphQL::Language::Nodes::InputObject) || context.skip_field?(parent.name)
      if parent.is_a?(GraphQL::Language::Nodes::Directive)
        parent_defn = context.schema.directives[parent.name]
      else
        parent_defn = context.field_definition
      end
      validate_node(parent, node, parent_defn, context)
    }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
graphql-0.10.4 lib/graphql/static_validation/arguments_validator.rb
graphql-0.10.3 lib/graphql/static_validation/arguments_validator.rb
graphql-0.10.2 lib/graphql/static_validation/arguments_validator.rb
graphql-0.10.1 lib/graphql/static_validation/arguments_validator.rb
graphql-0.10.0 lib/graphql/static_validation/arguments_validator.rb
graphql-0.9.5 lib/graphql/static_validation/arguments_validator.rb
graphql-0.9.4 lib/graphql/static_validation/arguments_validator.rb
graphql-0.9.3 lib/graphql/static_validation/arguments_validator.rb
graphql-0.9.2 lib/graphql/static_validation/arguments_validator.rb
graphql-0.8.1 lib/graphql/static_validation/arguments_validator.rb
graphql-0.8.0 lib/graphql/static_validation/arguments_validator.rb