# `Arc.Pipeline`
[🔗](https://github.com/Cratis/Arc.Elixir/blob/main/lib/arc/pipeline.ex#L4)

Runs commands and queries: authorize, bind, validate, provide, handle, record.

This is what the HTTP host, LiveView, `Arc.Test` and `Arc.execute/3` all call, so a rule is
implemented once and holds on every path.

Telemetry events are emitted around each run:

  * `[:arc, :command, :start | :stop]` with `%{command: module, correlation_id: id}` (stop adds `success?`)
  * `[:arc, :query, :start | :stop]` with `%{read_model: module, query: name, correlation_id: id}`

# `execute_command`

```elixir
@spec execute_command(module(), map() | struct(), Arc.Context.t(), keyword()) ::
  Arc.CommandResult.t()
```

Executes a command.

`input` is a wire map (string keys, `camelCase`) or an already-built command struct.

## Options

  * `:validate_only` - authorize and validate, but do not provide or handle

# `execute_query`

```elixir
@spec execute_query(
  Arc.Descriptor.t(),
  Arc.Descriptor.Query.t(),
  map(),
  Arc.Context.t(),
  keyword()
) ::
  Arc.QueryResult.t()
```

Executes a query.

`args` is a map of raw argument values keyed by wire name (matched case-insensitively).

## Options

  * `:page`, `:page_size` - zero-based page and page size, applied to lists
  * `:sort_by`, `:sort_direction` - field name (`camelCase`) and `:asc` or `:desc`

---

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