Class: GraphQL::StaticValidation::ArgumentsValidator

Inherits:
Object
  • Object
show all
Includes:
Message::MessageHelper
Defined in:
lib/graphql/static_validation/arguments_validator.rb

Overview

Implement validate_node

Instance Method Summary collapse

Methods included from Message::MessageHelper

#message

Instance Method Details

#validate(context) ⇒ Object


5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/graphql/static_validation/arguments_validator.rb', line 5

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