How to stop a field resolution after a middleware returns an error?

@itopiz

        resolution
        |> Absinthe.Resolution.put_result({:error, unauthenticated()})

changes the state of the Resolution struct to resolved.
So you can add a clause in ParseIDs middleware to catch this case and pass like this:

  def call(%Resolution{state: :resolved} = resolution, _) do
    resolution
  end
1 Like