Created
September 4, 2017 23:37
-
-
Save carlows/5aeb71a4b99882314987bdaa1485e865 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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