Skip to content

Commit 09a1e65

Browse files
Merge pull request #2365 from TeddyGandon/patch-1
docs(microservices/grpc): fix ServerUnaryCall generics
2 parents 2a55f83 + 5206465 commit 09a1e65

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/microservices/grpc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Next, we need to implement the service. To define a handler that fulfills this d
134134
@Controller()
135135
export class HeroesController {
136136
@GrpcMethod('HeroesService', 'FindOne')
137-
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any>): Hero {
137+
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any, any>): Hero {
138138
const items = [
139139
{ id: 1, name: 'John' },
140140
{ id: 2, name: 'Doe' },
@@ -170,7 +170,7 @@ Both `@GrpcMethod()` decorator arguments are optional. If called without the sec
170170
@Controller()
171171
export class HeroesController {
172172
@GrpcMethod('HeroesService')
173-
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any>): Hero {
173+
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any, any>): Hero {
174174
const items = [
175175
{ id: 1, name: 'John' },
176176
{ id: 2, name: 'Doe' },
@@ -199,7 +199,7 @@ You can also omit the first `@GrpcMethod()` argument. In this case, Nest automat
199199
@Controller()
200200
export class HeroesService {
201201
@GrpcMethod()
202-
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any>): Hero {
202+
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any, any>): Hero {
203203
const items = [
204204
{ id: 1, name: 'John' },
205205
{ id: 2, name: 'Doe' },
@@ -493,7 +493,7 @@ To send back metadata from the handler, use the `ServerUnaryCall#sendMetadata()`
493493
@Controller()
494494
export class HeroesService {
495495
@GrpcMethod()
496-
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any>): Hero {
496+
findOne(data: HeroById, metadata: Metadata, call: ServerUnaryCall<any, any>): Hero {
497497
const serverMetadata = new Metadata();
498498
const items = [
499499
{ id: 1, name: 'John' },

0 commit comments

Comments
 (0)