Sha256: 0c4dc1fe46192ee45dda53a5e350dfe355eb6ac9a3d6a9830d83c04a6fb96ced
Contents?: true
Size: 659 Bytes
Versions: 27
Compression:
Stored size: 659 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 < GraphQL::Error # @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 hash["locations"] = [ { "line" => ast_node.line, "column" => ast_node.col, } ] end hash end end end
Version data entries
27 entries across 27 versions & 1 rubygems