Open zimt28 opened 6 years ago
Just a thought: Maybe it's possible to build a directive, so that something which has been configured gets returned/ raised?
Just like
@graphql """
query ($id: ID!) {
file(id: $id) @required @put {
owner
}
}
"""
Using Phoenix alone I handled missing data ("not found") by just using Ecto's
!
functions (one!
etc.). These raise anEcto.NoResultsError
, which Phoenix can handle via aPlug.Exception
implementation to show a 404 page.I'm now changing my app to use
Absinthe.Phoenix.Controller
and would like to know what's the best way to handle these cases.My current approach looks like this, but it's quite repetitive. I'm using the new
action_fallback
macro from Phoenix 1.3.Is there a better/ suggested way to do this properly?