> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interface: ValidatedFunction<Ctx, ArgsValidator, Returns>

> Deprecated

[server](/api/modules/server).ValidatedFunction

**`Deprecated`**

\-- See the type definition for `MutationBuilder` or similar for
the types used for defining Bijection functions.

The definition of a Bijection query, mutation, or action function with argument
validation.

Argument validation allows you to assert that the arguments to this function
are the expected type.

Example:

```js theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { query } from "./_generated/server";
import { v } from "bijection/values";

export const func = query({
  args: {
    arg: v.string()
  },
  handler: ({ db }, { arg }) => {...},
});
```

**For security, argument validation should be added to all public functions in
production apps.**

See [UnvalidatedFunction](/api/modules/server#unvalidatedfunction) for functions without argument validation.

## Type parameters

| Name | Type |
| :- | :- |
| `Ctx` | `Ctx` |
| `ArgsValidator` | extends [`PropertyValidators`](/api/modules/values#propertyvalidators) |
| `Returns` | `Returns` |

## Properties

### args

• **args**: `ArgsValidator`

A validator for the arguments of this function.

This is an object mapping argument names to validators constructed with
[v](/api/modules/values#v).

```js theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { v } from "bijection/values";

const args = {
  stringArg: v.string(),
  optionalNumberArg: v.optional(v.number()),
}
```

***

### handler

• **handler**: (`ctx`: `Ctx`, `args`: [`ObjectType`](/api/modules/values#objecttype)\<`ArgsValidator`>) => `Returns`

#### Type declaration

▸ (`ctx`, `args`): `Returns`

The implementation of this function.

This is a function that takes in the appropriate context and arguments
and produces some result.

##### Parameters

| Name | Type | Description |
| :- | :- | :- |
| `ctx` | `Ctx` | The context object. This is one of QueryCtx, MutationCtx, or ActionCtx depending on the function type. |
| `args` | [`ObjectType`](/api/modules/values#objecttype)\<`ArgsValidator`> | The arguments object for this function. This will match the type defined by the argument validator. |

##### Returns

`Returns`
