Skip to content

Instantly share code, notes, and snippets.

@carlows
Created September 4, 2017 23:37
Show Gist options
  • Save carlows/5aeb71a4b99882314987bdaa1485e865 to your computer and use it in GitHub Desktop.
Save carlows/5aeb71a4b99882314987bdaa1485e865 to your computer and use it in GitHub Desktop.
module Errors
class CustomExecutionError < GraphQL::ExecutionError
def to_h
hash = {
"message" => message,
"test" => "hello world"
}
if ast_node
hash["locations"] = [
{
"line" => ast_node.line,
"column" => ast_node.col,
}
]
end
if path
hash["path"] = path
end
hash
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment