Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 020c400

Browse files
committed
Fix #59 by capturing FunctionClauseError and reporting error
1 parent bad241a commit 020c400

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/graphql/execution/resolvable.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ defmodule GraphQL.Execution.ResolveWrapper do
1111
{:ok, fun.()}
1212
rescue
1313
e in RuntimeError -> {:error, e.message}
14+
e in FunctionClauseError -> {:error, "Could not find a resolve function for this query."}
1415
end
1516
end
1617
end

test/graphql/execution/executor_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ defmodule GraphQL.Execution.Executor.ExecutorTest do
142142
type: %String{},
143143
args: %{
144144
name: %{type: %String{}}
145-
},
145+
},
146146
resolve: fn(_, %{name: name}, _) -> "Hello #{name}!!" end,
147147
}
148148
}

0 commit comments

Comments
 (0)