# `Rivet.Auth.Graphql`
[🔗](https://github.com/srevenant/rivet-ident/blob/main/lib/auth/graphql.ex#L1)

Helpers for Graphql resolvers.

# `az_assertion`

```elixir
@type az_assertion() :: Rivet.Auth.Assertion.t()
```

# `az_log`

```elixir
@type az_log() :: String.t() | nil
```

# `az_user`

```elixir
@type az_user() :: Rivet.Ident.User.t() | map()
```

# `action`

```elixir
@spec action(
  atom(),
  keyword()
) :: Rivet.Auth.Assertion.t()
```

# `authz`

This wraps check_authz with logging and creates normal error output for
Absinthe to handle.

    with {:ok, authed} <- authz(context, %Rivet.Auth.Assertion{}, "doTheThing") do
      handle success
    end

# `authz_user`

Accept authorization from a user.
Punt to authz_action(), but log graphql bits.

# `check_authz`

check_authz/2 attempts to verify %Auth.Assertion{} against the specified user,
and if the assertion includes a domain reference, it will attempt to walk
up the reference tree (if a parent_id exists) and try checking auth again.

# `current_user`

Handles extracting the current user from the Absinthe context, and then will
either call `func` and pass in the current user or return an error if there is
no user in the context

# `current_user`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
