Sha256: 4ba1c514453a9bb66df0700e36f2c83181e41e7c097ac8724ab04a09518c5c7b

Contents?: true

Size: 537 Bytes

Versions: 2

Compression:

Stored size: 537 Bytes

Contents

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

  def validate(context)
    visitor = context.visitor
    visitor[GraphQL::Nodes::Field] << -> (node, parent) {
      field_defn = context.field_definition
      validate_node(node, field_defn, context)
    }
    visitor[GraphQL::Nodes::Directive] << -> (node, parent) {
      directive_defn = context.schema.directives[node.name]
      validate_node(node, directive_defn, context)
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graphql-0.3.0 lib/graph_ql/static_validation/arguments_validator.rb
graphql-0.2.0 lib/graph_ql/static_validation/arguments_validator.rb