class GraphQL::StaticValidation::Error
Generates GraphQL-compliant validation message.
Attributes
Public Class Methods
# File lib/graphql/static_validation/error.rb, line 22 def initialize(message, path: nil, nodes: []) @message = message @nodes = Array(nodes) @path = path end
Public Instance Methods
Source
# File lib/graphql/static_validation/error.rb, line 29 def to_h { "message" => message, "locations" => locations }.tap { |h| h["path"] = path unless path.nil? } end
A hash representation of this Message