Skip to main content
Version: 11.x

Interface: HTTPBaseHandlerOptions<TRouter, TRequest>

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:48

Base interface for anything using HTTP

Extends

  • BaseHandlerOptions<TRouter, TRequest>

Type Parameters

Type Parameter
TRouter extends AnyTRPCRouter
TRequest

Properties

allowBatching?

optional allowBatching: boolean

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:160

Allow request batching

Default

ts
true
ts
true

Inherited from

BaseHandlerOptions.allowBatching


allowMethodOverride?

optional allowMethodOverride: boolean

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:155

Allow method override - will skip the method check

Default

ts
false
ts
false

Inherited from

BaseHandlerOptions.allowMethodOverride


batching?

optional batching: object

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:144

enabled

enabled: boolean

Default
ts
true
ts
true

Deprecated

use allowBatching instead, this will be removed in v12

Inherited from

BaseHandlerOptions.batching


maxBatchSize?

optional maxBatchSize: number

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:167

Restrict the maximum size of a batch call, invalid requests will be rejected with a 400 error

Important

Ensure you set the same or lower limit on your client batch link

Default

ts
unlimited
ts
unlimited

Inherited from

BaseHandlerOptions.maxBatchSize


onError?

optional onError: HTTPErrorHandler<TRouter, TRequest>

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:140

Inherited from

BaseHandlerOptions.onError


responseMeta?

optional responseMeta: ResponseMetaFn<TRouter>

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:55

Add handler to be called before response is sent to the user Useful for setting cache headers

See

https://trpc.io/docs/v11/caching


router

router: TRouter

Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:150

Inherited from

BaseHandlerOptions.router