Module: GraphQL::StaticValidation::Error::ErrorHelper

Included in:
ArgumentNamesAreUnique, FieldsHaveAppropriateSelections, NoDefinitionsArePresent
Defined in:
lib/graphql/static_validation/error.rb

Overview

Convenience for validators

Instance Method Summary collapse

Instance Method Details

#error(error_message, nodes, context: nil, path: nil, extensions: {}) ⇒ Object

Error error_message is located at node


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

def error(error_message, nodes, context: nil, path: nil, extensions: {})
  path ||= context.path
  nodes = Array(nodes)
  GraphQL::StaticValidation::Error.new(error_message, nodes: nodes, path: path)
end