# @monarcode/effetch-query/effetch (https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch)

`@monarcode/effetch-query/effetch` turns Effetch endpoints into queries and mutations. Import what you use:

```ts
import {
  EndpointQueryError,
  fromClient,
} from "@monarcode/effetch-query/effetch";
```

Its exports follow, grouped by the guide that covers them. Each one has
the first paragraph of its docs, and what it needs and how it fails; your
editor shows the rest, with an example, when you hover the name.

## Queries from endpoints

Guide: [Queries from endpoints](https://0758e0c7.effetch-query.pages.dev/docs/queries).

### fromClient

Turns `Fetch.endpoint` definitions into queries and mutations that call them through your Effetch client: give it the client's service, a `Fetch.Service` class or a `Context.Service` key. Use it at module level, next to the definitions: the client is only reached when a query fetches or a mutation runs, from your services (so the service must be in `Register["services"]`). Returns an [`Endpoints`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpoints-type), whose `query`, `infiniteQuery` and `mutation` make them.

The adapter adds no behaviour of its own: a query is a [`Query.family`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query#family) member keyed by its route, and a mutation is a [`Mutation.make`](https://0758e0c7.effetch-query.pages.dev/docs/reference/mutation#make) whose `run` calls the endpoint, and that invalidates its route with `EndpointsOptions.invalidates`. From a `Fetch.Service` class it reads the `defaultError` and `statusErrors` the client is made with, to send errors to the browser; from a `Context.Service` key, give them in the options ([`EndpointsOptions`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointsoptions)). The definitions of a `Fetch.Endpoints` class (`TodoApi.definitions`) work as any other. It needs `@monarcode/effetch` 0.1, from `0.1.0-rc.4`.

### endpoints

**Deprecated.** Use [`fromClient`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#fromclient): rename the import and the call.

The former name of [`fromClient`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#fromclient), which works the same: it takes the same client and options, and returns the same [`Endpoints`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpoints-type). It stays for the 0.1 releases and goes in 0.2.0.

### EndpointQuery

A family of queries, one per call of an Effetch endpoint, made by `Endpoints.query`. Call it with the endpoint's `params` and `query` to get the query for that call. Its key is the route's path with the params filled in, then the query object: `GET /todos/:id` called with `{ params: { id: 1 } }` is `["todos", 1]`.

### EndpointQueryArgs

What a query from route `R` takes: the path's params, and a query object. They make its key, so `headers` and `plugins` are given once, in [`EndpointQueryOptions`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointqueryoptions), instead.

- `Q`: the type of `query`, checked with `Fetch.QueryOf`, so a value typed with an `interface` is accepted too. Default: `Fetch.QueryInput`.
- `QS`: the endpoint's `query` schema, if it has one: `query` is then the schema's type, required when the schema has required fields.

### EndpointQueryCallError

The error of a query `Endpoints.query` makes from an endpoint: the `Fetch.CallError` of its call, from its `output` schema `O`, its error body schema `EB` ([`ErrorSchema`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#errorschema)), the client's plugins `Ps`, its status errors `SE` and its stream format `St`. A stream endpoint's elements are decoded as they come, so its `DecodeError` isn't for the whole `output`.

### EndpointQueryOptions

Options for `Endpoints.query`: a query's options ([`Query.Options`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query#options)), a `placeholder`, `live` updates, and the headers and plugin overrides `client.bind` takes (`Fetch.BindOptions`). `A` is the query's value and `Args` the call's `params` and `query` ([`EndpointQueryArgs`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointqueryargs)), which type `placeholder` and `live`; `api.query` sets both from the endpoint.

| Prop                  | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `placeholder?`        | `function`      | A value to show for a query until it has one, from the call's `params` and `query`, as Query.MakeOptions.placeholder: an Effect that returns `Option.some(value)`, or `Option.none()` for nothing. It gets the route's `params` and the `query` of the call that made the query: calls that send the same request share one, so a later call's extra fields, or a query it gives in another form that encodes the same, aren't seen. Default: none. |
| `live?`               | `function`      | The server pushes that keep a query's value up to date, from the call's `params` and `query`, as Query.MakeOptions.live: a `Stream` of functions, each applied to the value. Default: none.                                                                                                                                                                                                                                                         |
| `headers?`            | `union`         | Headers for every call, over the definition's. A call's own header wins.                                                                                                                                                                                                                                                                                                                                                                            |
| `plugins?`            | `Overrides<Ps>` | Plugin overrides for every call. A call's own override wins.                                                                                                                                                                                                                                                                                                                                                                                        |
| `staleTime?`          | `union`         | How long a success counts as fresh. Default: 0, stale at once.                                                                                                                                                                                                                                                                                                                                                                                      |
| `retry?`              | `object`        | Retries a failed fetch on this schedule, which gets each failure. Defects aren't retried. Default: no retries.                                                                                                                                                                                                                                                                                                                                      |
| `refetchOnMount?`     | `union`         | If true, refetches a stale query when a component starts using it. Default: `true`.                                                                                                                                                                                                                                                                                                                                                                 |
| `retryOnMount?`       | `union`         | If true, refetches a failed query when a component starts using it, however recent the failure. A suspense reader (React's `useSuspenseQuery`) of a failure with no earlier value throws it to an error boundary instead, so it never starts using the query to retry it (see `useResetQueryFailure`). Default: `true`.                                                                                                                             |
| `refetchOnFocus?`     | `union`         | If true, refetches a stale query in use when the app regains focus (CommonOptions.signals). Default: `true`.                                                                                                                                                                                                                                                                                                                                        |
| `refetchOnReconnect?` | `union`         | If true, refetches a stale query in use when the device reconnects (CommonOptions.signals). Default: `true`.                                                                                                                                                                                                                                                                                                                                        |
| `refetchInterval?`    | `union`         | The interval at which a query in use refetches. A tick that finds a fetch in progress doesn't start another. Polling pauses while nothing uses the query and resumes when something starts using it. Default: no polling.                                                                                                                                                                                                                           |
| `gcTime?`             | `union`         | How long a query nothing uses stays cached. Default: 5 minutes. Unlike the other options, there's no client-wide default.                                                                                                                                                                                                                                                                                                                           |
| `reactivityKeys?`     | `union`         | The `Reactivity` keys that refetch this query when invalidated, for Effect code that publishes them (Effect's SQL clients do). Run `Reactivity.invalidate` through the client, as QueryClient.QueryClient.runPromise does, to reach it. Default: none.                                                                                                                                                                                              |
| `entities?`           | `object`        | How this query takes part in the client's entity sync (QueryClient.EntitiesOptions.sync). Default: it does, if it has a `schema`.                                                                                                                                                                                                                                                                                                                   |

### EndpointQueryOptionsFor

The options `Endpoints.query` takes for an endpoint: those of a stream query ([`EndpointStreamOptions`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointstreamoptions)) for a stream endpoint, whose stream format `St` is `"sse"` or `"ndjson"`, else those of a fetched one ([`EndpointQueryOptions`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointqueryoptions)). `E` is the query's error ([`EndpointQueryCallError`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointquerycallerror)), `A` its value ([`EndpointQueryValue`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointqueryvalue)), `R` the endpoint's route and `QS` its `query` schema, which type `placeholder` and `live`.

### EndpointQueryValue

The value of a query `Endpoints.query` makes from an endpoint, from its `output` schema `O` and its stream format `St`: the decoded `output` (the raw `HttpClientResponse` without one), or for a stream endpoint (`stream: "sse"` or `"ndjson"`) its latest element, a `Fetch.SseEvent` of the `output` for SSE.

### Endpoints

Queries and mutations for one Effetch client, made by [`fromClient`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#fromclient).

### EndpointsOptions

Options for [`fromClient`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#fromclient).

| Prop            | Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key?`          | `Key`     | A prefix put before every key these endpoints make, when another backend has the same paths: with `["wallet"]`, `GET /accounts/:id` is `["wallet", "accounts", 1]`. Default: no prefix.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `defaultError?` | `EB`      | The client's `defaultError`, for queries whose endpoint has no `error` schema of its own: their `HttpError` bodies go to the browser encoded with it (`QueryClient.dehydrate` with `failures: "include"`), and it's shown as EndpointQuery.error. It's typed as the client's. Default: for a `Fetch.Service` class, the one it was declared with (`Api.config`); this option overrides it, as it must for a class whose `layer` builds its client from another config. A client behind a `Context.Service` key can't be read until its layer is built, so give it here. Without one, the client still decodes and types those bodies, but they go as JSON, so a query whose body isn't JSON isn't sent.                                                                                                                                                                                                                                                                                |
| `statusErrors?` | `SE`      | The client's `statusErrors`, so its queries can send those errors to the browser (`QueryClient.dehydrate` with `failures: "include"`). It's typed as the client's. Default: for a `Fetch.Service` class, the ones it was declared with (`Api.config`); this option overrides them. A client behind a `Context.Service` key can't be read until its layer is built, so give them here. Without them, the client's errors are still decoded and typed, but a query that fails with one isn't sent: the browser fetches it again.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `invalidates?`  | `"route"` | If `"route"`, a mutation that succeeds invalidates its route's queries, as Query.invalidate does: every query whose key starts with the route's EndpointQuery.key, the `key` prefix and the path's literals before its first param. `PATCH /todos/:id` invalidates `["todos"]`, so `GET /todos` and `GET /todos/:id` refetch, along with any other query under that key. A route with no param invalidates its whole path: `POST /todos/reorder` invalidates `["todos", "reorder"]`, which no list is keyed under, so give it an `invalidates` of its own. A route that starts with a param invalidates every query under `key`, or every query on the client without one. It invalidates more than a write changes, on purpose: a query refetched for nothing costs a request, and one left stale shows old data. A mutation's own `invalidates` replaces it, and `invalidates: []` turns it off for that mutation. Default: a mutation invalidates only what its `invalidates` says. |

### RegisteredSchema

A schema whose decoding and encoding need nothing outside your registered services (`Register["services"]`) and the client. The adapter accepts only these, so an endpoint whose schema needs another service is a compile error where its query or mutation is defined (`Endpoints.query`, `Endpoints.mutation`).

## Query keys

Guide: [Query keys](https://0758e0c7.effetch-query.pages.dev/docs/queries/keys).

### EndpointQueryError

Thrown when a call's `query` can't be part of its key: it doesn't match the endpoint's `query` schema, a field encodes to an object, or a field is `Redacted`, whose secret the key would hold and send to the browser. Send a secret in a header instead. It's thrown when the query is made, such as `todos({ query })` in a component, before anything is fetched.

### KeyQuerySchema

A `query` schema an endpoint query can be keyed by: one whose encoding needs no services, since a key is encoded when the family is called, outside any Effect. `Endpoints.mutation` takes any query schema whose services are registered.

## Query errors

Guide: [Query errors](https://0758e0c7.effetch-query.pages.dev/docs/queries/errors).

### ErrorSchema

The error schema a bound endpoint decodes error bodies with: its own, or the client's `defaultError` (see `EndpointsOptions.defaultError`).

## Errors by status

Guide: [Errors by status](https://0758e0c7.effetch-query.pages.dev/docs/queries/status-errors).

### RegisteredStatusErrors

A `statusErrors` map (`Fetch.StatusErrorMap`) whose schemas need nothing outside your registered services, as [`RegisteredSchema`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#registeredschema). The adapter accepts only these, on the client and on each endpoint: its queries and mutations decode the errors, and its queries send them to the browser (the client's only when [`fromClient`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#fromclient) has them, see `EndpointsOptions.statusErrors`).

## Queries from a stream

Guide: [Queries from a stream](https://0758e0c7.effetch-query.pages.dev/docs/queries/streams).

### EndpointStreamOptions

Options for `Endpoints.query` with a stream endpoint (`stream: "sse"` or `"ndjson"`): a stream query's options ([`Query.StreamOptions`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query#streamoptions)), a `placeholder`, and the headers and plugin overrides `client.bind` takes (`Fetch.BindOptions`). `A` is the value, one element of the stream, and `Args` the call's arguments.

| Prop              | Type            | Description                                                                                                                                                                                                                 |
| ----------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `placeholder?`    | `function`      | A value to show for a query until its first element, from the call's `params` and `query`, as EndpointQueryOptions.placeholder. Default: none.                                                                              |
| `headers?`        | `union`         | Headers for every call, over the definition's. A call's own header wins.                                                                                                                                                    |
| `plugins?`        | `Overrides<Ps>` | Plugin overrides for every call. A call's own override wins.                                                                                                                                                                |
| `gcTime?`         | `union`         | The time a query nothing uses stays cached, as Options.gcTime. Default: 5 minutes.                                                                                                                                          |
| `retry?`          | `object`        | The schedule to resubscribe on after the stream fails, as `Stream.retry` takes it: the schedule starts over once an element comes through. Defects aren't retried. Default: the client's `queries.defaults.retry`, or none. |
| `retryOnMount?`   | `union`         | If true, a query whose stream failed subscribes again when something starts using it. Default: the client's `queries.defaults.retryOnMount`, or `true`.                                                                     |
| `reactivityKeys?` | `union`         | The `Reactivity` keys that resubscribe this query when invalidated, as Options.reactivityKeys. Default: none.                                                                                                               |

## Infinite queries

Guide: [Infinite queries](https://0758e0c7.effetch-query.pages.dev/docs/queries/infinite).

### EndpointInfiniteQuery

A family of infinite queries, one per call of an Effetch endpoint, made by `Endpoints.infiniteQuery`. Call it with the endpoint's `params` and `query` to get the [`InfiniteQuery.InfiniteQuery`](https://0758e0c7.effetch-query.pages.dev/docs/reference/infinite-query#infinitequery) for that call; a page field given there is ignored. Keys and matching are as for [`EndpointQuery`](https://0758e0c7.effetch-query.pages.dev/docs/reference/effetch#endpointquery).

### EndpointInfiniteQueryOptions

Options for `Endpoints.infiniteQuery`: an infinite query's page options ([`InfiniteQuery.PageOptions`](https://0758e0c7.effetch-query.pages.dev/docs/reference/infinite-query#pageoptions)) and query options ([`Query.Options`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query#options)), the query field each page's param is sent in, and the headers and plugin overrides `client.bind` takes (`Fetch.BindOptions`).

| Prop                  | Type                               | Description                                                                                                                                                                                                                                                                                                                                                                                       |
| --------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `reactivityKeys?`     | `union`                            | The `Reactivity` keys that refetch this query when invalidated, for Effect code that publishes them (Effect's SQL clients do). Run `Reactivity.invalidate` through the client, as QueryClient.QueryClient.runPromise does, to reach it. Default: none.                                                                                                                                            |
| `entities?`           | `object`                           | How this query takes part in the client's entity sync (QueryClient.EntitiesOptions.sync). Default: it does, if it has a `schema`.                                                                                                                                                                                                                                                                 |
| `pageParam`           | `EndpointPageField<QS, P>`         | The query field each page's param is sent in, such as `"cursor"` or `"skip"`. It's set on every page's request, over the call's own value, and left out of the key. The param must be a value a query field takes (`Fetch.QueryValue`), such as a string or a number. With a `query` schema on the endpoint, it's an optional field of the schema whose type takes the param (EndpointPageField). |
| `headers?`            | `union`                            | Headers for every call, over the definition's. A call's own header wins.                                                                                                                                                                                                                                                                                                                          |
| `plugins?`            | `Overrides<Ps>`                    | Plugin overrides for every call. A call's own override wins.                                                                                                                                                                                                                                                                                                                                      |
| `staleTime?`          | `union`                            | How long a success counts as fresh. Default: 0, stale at once.                                                                                                                                                                                                                                                                                                                                    |
| `retry?`              | `object`                           | Retries a failed fetch on this schedule, which gets each failure. Defects aren't retried. Default: no retries.                                                                                                                                                                                                                                                                                    |
| `refetchOnMount?`     | `union`                            | If true, refetches a stale query when a component starts using it. Default: `true`.                                                                                                                                                                                                                                                                                                               |
| `retryOnMount?`       | `union`                            | If true, refetches a failed query when a component starts using it, however recent the failure. A suspense reader (React's `useSuspenseQuery`) of a failure with no earlier value throws it to an error boundary instead, so it never starts using the query to retry it (see `useResetQueryFailure`). Default: `true`.                                                                           |
| `refetchOnFocus?`     | `union`                            | If true, refetches a stale query in use when the app regains focus (CommonOptions.signals). Default: `true`.                                                                                                                                                                                                                                                                                      |
| `refetchOnReconnect?` | `union`                            | If true, refetches a stale query in use when the device reconnects (CommonOptions.signals). Default: `true`.                                                                                                                                                                                                                                                                                      |
| `refetchInterval?`    | `union`                            | The interval at which a query in use refetches. A tick that finds a fetch in progress doesn't start another. Polling pauses while nothing uses the query and resumes when something starts using it. Default: no polling.                                                                                                                                                                         |
| `gcTime?`             | `union`                            | How long a query nothing uses stays cached. Default: 5 minutes. Unlike the other options, there's no client-wide default.                                                                                                                                                                                                                                                                         |
| `initialPageParam`    | `P`                                | The first page's param.                                                                                                                                                                                                                                                                                                                                                                           |
| `nextPageParam`       | `PageParamFunction<A, NoInfer<P>>` | The param of the page after the last one, or `undefined` / `null` for none.                                                                                                                                                                                                                                                                                                                       |
| `previousPageParam?`  | `PageParamFunction<A, NoInfer<P>>` | The param of the page before the first one, or `undefined` / `null` for none. Without it, there's no previous page.                                                                                                                                                                                                                                                                               |
| `maxPages?`           | `number`                           | The most pages to keep. Past it, a page is dropped from the far end: the first when a next page loads, the last when a previous page does. Give `previousPageParam` too, so the dropped pages can load again. Default: no limit.                                                                                                                                                                  |

### EndpointPageField

The query fields an infinite query's `EndpointInfiniteQueryOptions.pageParam` can name. The param `P` must be a `Fetch.QueryValue`, such as a string or a number, so pages cross to the browser as JSON. Without a `query` schema (`QS` is `undefined`), any field. With one, the schema's optional fields whose type takes `P` (`undefined` aside, for a first page with no cursor): optional, so a call can leave it out.

## Define a mutation

Guide: [Define a mutation](https://0758e0c7.effetch-query.pages.dev/docs/mutations).

### EndpointMutationOptions

Options for `Endpoints.mutation`: a mutation's options ([`Mutation.MakeOptions`](https://0758e0c7.effetch-query.pages.dev/docs/reference/mutation#makeoptions)) without `run`, which is the endpoint, and the headers and plugin overrides `client.bind` takes (`Fetch.BindOptions`).

| Prop           | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `headers?`     | `union`         | Headers for every call, over the definition's. A call's own header wins.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `plugins?`     | `Overrides<Ps>` | Plugin overrides for every call. A call's own override wins.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `optimistic?`  | `function`      | Updates the cache before `run`, so the change shows at once. Its Query.set and Query.update calls are recorded, and if the run fails, the queries they wrote are put back, newest write first. A query written again in the meantime, even by a fetch, is put back all the same. Only writes made while it runs count: not those of a fiber it forks that write after it's done, nor those of a mutation it runs. A fetch of the same query already in progress still settles over the optimistic value, as it does over any Query.set, and there's no way to cancel it: the query then shows what that fetch returned.                                                                                                                                                                                                                                          |
| `onSuccess?`   | `function`      | Runs after a successful `run`, before `invalidates`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `onFailure?`   | `function`      | Runs after a failed `run`, once the optimistic writes are rolled back.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `onSettled?`   | `function`      | Runs after `run` succeeds or fails, after `onSuccess` or `onFailure`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `invalidates?` | `union`         | Queries to invalidate after `onSuccess`, as Query.invalidate does: a list of targets, or a function of the run's value and variables that returns one. Default: none. A failed run invalidates nothing. A key that holds a query, a family or a group matches nothing: in a list, the run dies with a Query.KeyHoldsTargetError before it starts; from the function, the change is already saved, so the target is logged and skipped. Combine targets with Query.group.                                                                                                                                                                                                                                                                                                                                                                                         |
| `retry?`       | `object`        | Retries a failed run on this schedule, which gets each failure. Defects aren't retried. Default: no retries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `concurrent?`  | `union`         | The policy for how one use's runs (one component's `useMutation`, say) overlap. Separate uses, and `Mutation.run` calls, never affect each other. Default: `true`. - `true`: runs overlap. - `false`: a new run interrupts the one in progress, whose optimistic writes are rolled back first. - `"queue"`: a new run waits until the ones before it have settled, so runs go one at a time, in order. A queued run counts as in progress (`useIsMutating`, `useMutationState`), but its `optimistic` runs when it starts, so a run that fails rolls back only its own writes. - `"drop"`: a new run is ignored while the one the use shows is in progress, such as a second click on a submit button. It never starts or calls anything, and its `run` resolves at once with an interrupted `Exit`. After `reset`, which stops showing a run, a new run starts. |

### EndpointVariables

What a mutation from route `R` takes when run: the endpoint's call options (`params`, `query`, `body`, `headers`, `plugins`), or nothing when none are required. The variables of `Endpoints.mutation`.

## Related pages

- [Entry points](https://0758e0c7.effetch-query.pages.dev/docs/reference): what each entry point exports.
- [`@monarcode/effetch-query`](https://0758e0c7.effetch-query.pages.dev/docs/reference/core): the core entry point's namespaces and top-level names.
- [`Query`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query): defining queries, keys and targets, and the cache from Effect.
- [`InfiniteQuery`](https://0758e0c7.effetch-query.pages.dev/docs/reference/infinite-query): queries that load a list one page at a time.
- [`Mutation`](https://0758e0c7.effetch-query.pages.dev/docs/reference/mutation): defining and running mutations.
- [`Entity`](https://0758e0c7.effetch-query.pages.dev/docs/reference/entity): records whose every cached copy a write updates.
- [`QueryClient`](https://0758e0c7.effetch-query.pages.dev/docs/reference/query-client): the client, its options and hooks, and server rendering.
- [`Signals`](https://0758e0c7.effetch-query.pages.dev/docs/reference/signals): where a client hears about focus and reconnects.
- [`@monarcode/effetch-query/react`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react): the provider, the hooks and the boundaries.
- [`@monarcode/effetch-query/react-native`](https://0758e0c7.effetch-query.pages.dev/docs/reference/react-native): focus and online signals for React Native.
- [`@monarcode/effetch-query/react/tanstack-router`](https://0758e0c7.effetch-query.pages.dev/docs/reference/tanstack-router): connecting a client to TanStack Router and Start.