Skip to content

Commit

Permalink
schema: remove error handling middleware
Browse files Browse the repository at this point in the history
This will be handled by AshGraphql now. Add a TODO to error.ex since it's not
possible to remove it now.

Signed-off-by: Riccardo Binetti <[email protected]>
  • Loading branch information
rbino committed Feb 6, 2024
1 parent 549667d commit 8d1bd46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 2 additions & 0 deletions backend/lib/edgehog/error.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ defmodule Edgehog.Error do
Module used to normalize all errors in Edghog, so that they can be shown by the API.
"""

# TODO: Remove this once it's not a compile dependency anymore

require Logger
alias __MODULE__

Expand Down
9 changes: 0 additions & 9 deletions backend/lib/edgehog_web/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ defmodule EdgehogWeb.Schema do
alias EdgehogWeb.Middleware
alias EdgehogWeb.Resolvers

def middleware(middleware, _field, %Absinthe.Type.Object{identifier: type})
when type in [:query, :subscription, :mutation] do
middleware ++ [Middleware.ErrorHandler]
end

def middleware(middleware, _field, _object) do
middleware
end

node interface do
resolve_type fn
%Edgehog.BaseImages.BaseImage{}, _ ->
Expand Down

0 comments on commit 8d1bd46

Please sign in to comment.