# Function: splitLink()

> 

> **splitLink**\<`TRouter`\>(`opts`): [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\>

Defined in: packages/client/dist/splitLink-zyV5y7N1.d.mts:9

Sends each operation down one of two link chains, based on `condition`.

## Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
| `TRouter` *extends* `AnyRouter` | `AnyRouter` |

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `opts` | \{ `condition`: (`op`) => `boolean`; `false`: [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\> \| [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\>[]; `true`: [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\> \| [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\>[]; \} | - |
| `opts.condition` | (`op`) => `boolean` | Picks the chain for an operation. |
| `opts.false` | [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\> \| [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\>[] | The link to execute next if the test function returns `false`. |
| `opts.true` | [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\> \| [`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\>[] | The link to execute next if the test function returns `true`. |

## Returns

[`TRPCLink`](https://trpc.io/docs/typedoc/react-query/index/type-aliases/TRPCLink.md)\<`TRouter`\>

## See

https://trpc.io/docs/client/links/splitLink
