Module: GraphQL::StaticValidation::Error::ErrorHelper
- Defined in:
- lib/graphql/static_validation/error.rb
Overview
Convenience for validators
@requires_ancestor: Kernel
Instance Method Summary collapse
-
#error(error_message, nodes, context: nil, path: nil, extensions: {}) ⇒ Object
Error
error_messageis located atnode: (String error_message, GraphQL::Language::Nodes::AbstractNode | Array nodes, ?context: GraphQL::StaticValidation::ValidationContext?, ?path: Array[String | Integer]?, ?extensions: Hash[String, untyped]) -> GraphQL::StaticValidation::Error.
Instance Method Details
#error(error_message, nodes, context: nil, path: nil, extensions: {}) ⇒ Object
Error error_message is located at node
: (String error_message, GraphQL::Language::Nodes::AbstractNode | Array nodes, ?context: GraphQL::StaticValidation::ValidationContext?, ?path: Array[String | Integer]?, ?extensions: Hash[String, untyped]) -> GraphQL::StaticValidation::Error
14 15 16 17 18 19 |
# File 'lib/graphql/static_validation/error.rb', line 14 def error(, nodes, context: nil, path: nil, extensions: {}) path ||= (context #: as !nil ).path nodes = Array(nodes) GraphQL::StaticValidation::Error.new(, nodes: nodes, path: path) end |