Skip to main content
Version: 11.x

Function: transformTRPCResponse()

transformTRPCResponse<TResponse>(config, itemOrItems): TRPCErrorResponse | TRPCSuccessResponse | {id: JSONRPC2.RequestId;} & TRPCResultMessage< unknown > | (TRPCResponse | TRPCResponseMessage)[]

Takes a unserialized TRPCResponse and serializes it with the router's transformers

Type parameters

Parameter
TResponse extends TRPCResponse | TRPCResponse[] | TRPCResponseMessage | TRPCResponseMessage[]

Parameters

ParameterType
configAnyRootConfig
itemOrItemsTResponse

Returns

TRPCErrorResponse | TRPCSuccessResponse | {id: JSONRPC2.RequestId;} & TRPCResultMessage< unknown > | (TRPCResponse | TRPCResponseMessage)[]

Source

packages/core/dist/transformer.d.ts:72


Generated using TypeDoc and typedoc-plugin-markdown