MCPcopy
hub / github.com/nestjs/nest / GrpcMethod

Function GrpcMethod

packages/microservices/decorators/message-pattern.decorator.ts:104–116  ·  view source on GitHub ↗
(
  service: string | undefined,
  method?: string,
)

Source from the content-addressed store, hash-verified

102export function GrpcMethod(service?: string): MethodDecorator;
103export function GrpcMethod(service: string, method?: string): MethodDecorator;
104export function GrpcMethod(
105 service: string | undefined,
106 method?: string,
107): MethodDecorator {
108 return (
109 target: object,
110 key: string | symbol,
111 descriptor: PropertyDescriptor,
112 ) => {
113 const metadata = createGrpcMethodMetadata(target, key, service, method);
114 return MessagePattern(metadata, Transport.GRPC)(target, key, descriptor);
115 };
116}
117
118/**
119 * Registers gRPC call through RX handler for service and method

Callers 4

TestServiceClass · 0.90
GrpcControllerClass · 0.90
HeroControllerClass · 0.90

Calls 2

createGrpcMethodMetadataFunction · 0.85
MessagePatternFunction · 0.85

Tested by

no test coverage detected