Skip to content
tRPC

Partners

Type Alias: HTTPBatchLinkOptions<TRoot>

On this page

HTTPBatchLinkOptions<TRoot>: HTTPLinkBaseOptions<TRoot> & object

Defined in: packages/client/src/links/HTTPBatchLinkOptions.ts:10

The options of httpBatchLink.

Type declaration

headers?

optional headers: HTTPHeaders | (opts) => HTTPHeaders | Promise<HTTPHeaders>

Headers for each request: an object, or a function of the batch's operations that returns them.

See

https://trpc.io/docs/client/headers

maxItems?

optional maxItems: number

The most calls one batch can have. Set it to the server's maxBatchSize or lower.

See

https://trpc.io/docs/client/links/httpBatchLink#limiting-batch-size

Default

Infinity

maxURLLength?

optional maxURLLength: number

The longest URL a batched GET request can have. Calls that would make it longer go in another batch. A call too long on its own fails.

See

https://trpc.io/docs/client/links/httpBatchLink#setting-a-maximum-url-length

Default

Infinity

Type Parameters

Type Parameter
TRoot extends AnyClientTypes

See

https://trpc.io/docs/client/links/httpBatchLink#options