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:164

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:159

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:148

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:171

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:144

Inherited from​

BaseHandlerOptions.onError


responseMeta?​

optional responseMeta: ResponseMetaFn<TRouter>

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

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:154

Inherited from​

BaseHandlerOptions.router