Sha256: 8f4fe23395f08158537b5764f20865948b43135d5e1c76f19a1a18502349051a
Contents?: true
Size: 704 Bytes
Versions: 14
Compression:
Stored size: 704 Bytes
Contents
module GraphQL # If a field's resolve function returns a {ExecutionError}, # the error will be inserted into the response's `"errors"` key # and the field will resolve to `nil`. class ExecutionError < RuntimeError # @return [GraphQL::Language::Nodes::Field] the field where the error occured attr_accessor :ast_node # @return [Hash] An entry for the response's "errors" key def to_h hash = { "message" => message, } if ast_node.nil? hash["locations"] = [] else hash["locations"] = [ { "line" => ast_node.line, "column" => ast_node.col, } ] end hash end end end
Version data entries
14 entries across 14 versions & 1 rubygems