# `PgRest.Plan.Call`
[🔗](https://github.com/agoodway/pgrest/blob/v0.2.0/lib/pg_rest/planner/plan.ex#L198)

The function call an RPC read plan reads from (`PgRest.Plan.Read` `source: {:call, call}`),
compiled by `PgRest.SQL.Call`.

`args` is how the arguments reach the function:

  * `{:direct, %{name => value | [value]}}` - GET/HEAD query parameters; a variadic
    parameter collects its repeated values in order, any other keeps the last
  * `{:json, body, keys}` - a POST body (the raw JSON text) for a function with named
    parameters; `keys` are the argument names the request supplies
  * `{:single, body}` - a POST body passed whole to the single unnamed `json`/`jsonb`
    parameter

`read_only?` is true for GET/HEAD and for a POST to a stable or immutable function: the
transaction then runs read-only. `scope` is `{resource, scoped_query}` when the result rows
must be checked against the stored, in-scope rows (`result_scope: :stored_rows` on a scoped
resource), else `nil`.

# `args`

```elixir
@type args() ::
  {:direct, %{required(String.t()) =&gt; String.t() | [String.t()]}}
  | {:json, binary(), [String.t()]}
  | {:single, binary()}
```

# `t`

```elixir
@type t() :: %PgRest.Plan.Call{
  args: args(),
  function: PgRest.Function.t(),
  read_only?: boolean(),
  scope: {module(), Ecto.Query.t()} | nil
}
```

---

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