Skip to content

Instantly share code, notes, and snippets.

@sultaniman
Created April 30, 2019 13:23
Show Gist options
  • Save sultaniman/82ab34e171eb59fae8a9ebbb71db2137 to your computer and use it in GitHub Desktop.
Save sultaniman/82ab34e171eb59fae8a9ebbb71db2137 to your computer and use it in GitHub Desktop.
# add this to your schema module
# if it's a field for the mutation object, add this middleware to the end
def middleware(middleware, _field, %{identifier: :mutation}) do
middleware ++ [Idp.Middlewares.HandleAPIErrors]
end
# if it's any other object keep things as is
def middleware(middleware, _field, _object), do: middleware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment