Module: GraphQL::StaticValidation::Message::MessageHelper

Overview

Convenience for validators

Instance Method Summary collapse

Instance Method Details

#message(message, nodes, context: nil, path: nil) ⇒ Object

Error message is located at node



9
10
11
12
13
# File 'lib/graphql/static_validation/message.rb', line 9

def message(message, nodes, context: nil, path: nil)
  path ||= context.path
  nodes = Array(nodes)
  GraphQL::StaticValidation::Message.new(message, nodes: nodes, path: path)
end