Interface: HTTPBaseHandlerOptions<TRouter, TRequest>
On this page
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:59
The options every HTTP adapter takes.
Extends
BaseHandlerOptions<TRouter,TRequest>
Type Parameters
| Type Parameter |
|---|
TRouter extends AnyTRPCRouter |
TRequest |
Properties
allowBatching?
optionalallowBatching:boolean
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:192
Whether clients can batch calls into one request.
See
https://trpc.io/docs/client/links/httpBatchLink#disabling-request-batching
Default
trueInherited from
BaseHandlerOptions.allowBatching
allowMethodOverride?
optionalallowMethodOverride:boolean
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:186
Lets clients call queries and subscriptions with POST as well as GET. Mutations always use POST.
See
https://trpc.io/docs/rpc#overriding-the-default-http-method
Default
falseInherited from
BaseHandlerOptions.allowMethodOverride
batching?
optionalbatching:object
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:172
enabled
enabled:
boolean
Default
trueDeprecated
Use allowBatching instead. This will be removed in v12.
Inherited from
BaseHandlerOptions.batching
maxBatchSize?
optionalmaxBatchSize:number
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:199
The most calls a batch can have. Larger batches get a 400 error. Set
the client's maxItems to the same or a lower number.
See
https://trpc.io/docs/client/links/httpBatchLink#limiting-batch-size
Default
unlimitedInherited from
BaseHandlerOptions.maxBatchSize
onError?
optionalonError:HTTPErrorHandler<TRouter,TRequest>
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:168
Called with each error a procedure throws, for example to log it.
See
https://trpc.io/docs/server/error-handling#handling-errors
Inherited from
BaseHandlerOptions.onError
responseMeta?
optionalresponseMeta:ResponseMetaFn<TRouter>
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:68
Sets the response's status and headers before it's sent, for example to cache it.
See
https://trpc.io/docs/server/caching#using-responsemeta-to-cache-responses
router
router:
TRouter
Defined in: packages/server/src/unstable-core-do-not-import/http/types.ts:179
The router to serve.
Inherited from
BaseHandlerOptions.router