Execution Context
NestRpcExecutionContext
wraps Nest's ExecutionContext
and exposes:
getClass()
andgetHandler()
for the current router and methodgetType()
which returns"http-rpc"
switchToHttp()
for standard Nest HTTP objectsswitchToHttpRpc().getInput<T>()
to access the raw input for this call
Use it implicitly via param decorators or explicitly in service code:
import { NestRPCService } from '@nestjs-rpc/server';
// programmatic execution
await rpcService.execute(UserQueriesRouter, 'getUser', ctx);