mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-20 05:13:33 +12:00
fix: don't add graphql types if API doesn't compile
This commit is contained in:
parent
f81f8d45cb
commit
a7e4b165e4
1 changed files with 29 additions and 23 deletions
|
@ -22,8 +22,9 @@ defmodule AshGraphql do
|
|||
|
||||
def run(blueprint, _opts) do
|
||||
api = unquote(api)
|
||||
Code.ensure_compiled(api)
|
||||
|
||||
case Code.ensure_compiled(api) do
|
||||
{:module, _} ->
|
||||
blueprint_with_queries =
|
||||
api
|
||||
|> AshGraphql.Api.queries(__MODULE__)
|
||||
|
@ -49,6 +50,11 @@ defmodule AshGraphql do
|
|||
end)
|
||||
|
||||
{:ok, %{blueprint_with_mutations | schema_definitions: new_defs}}
|
||||
|
||||
{:error, _} ->
|
||||
# Something else will fail here, so we don't need to
|
||||
{:ok, blueprint}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue