Below is my code. My question is is this architecture feasible and how to modify it to be effective。
[Nest] 23752 - 2021/04/19 下午2:05:27 [InstanceLoader] GraphQLModule dependencies initialized +0ms
[Nest] 23752 - 2021/04/19 下午2:05:27 [NestMicroservice] Nest microservice successfully started +3ms
Method handler FindOne for /hero.HeroService/FindOne expected but not provided
Method handler FindMany for /hero.HeroService/FindMany expected but not provided
[Nest] 23752 - 2021/04/19 下午2:05:27 [NestApplication] Nest application successfully started +499ms
Application is running on: http://[::1]:3000
When i request /graphql
Application is running on: http://[::1]:3000
[Nest] 23752 - 2021/04/19 下午2:19:18 [ExceptionsHandler] 12 UNIMPLEMENTED: The server does not implement this method +830291ms
Error: 12 UNIMPLEMENTED: The server does not implement this method
at Object.exports.createStatusError (D:\gitlab\nest-grcp-client\node_modules\grpc\src\common.js:91:15)
at ClientDuplexStream._emitStatusIfDone (D:\gitlab\nest-grcp-client\node_modules\grpc\src\client.js:233:26)
at ClientDuplexStream._receiveStatus (D:\gitlab\nest-grcp-client\node_modules\grpc\src\client.js:211:8)
at Object.onReceiveStatus (D:\gitlab\nest-grcp-client\node_modules\grpc\src\client_interceptors.js:1311:15)
at InterceptingListener._callNext (D:\gitlab\nest-grcp-client\node_modules\grpc\src\client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (D:\gitlab\nest-grcp-client\node_modules\grpc\src\client_interceptors.js:618:8)
at D:\gitlab\nest-grcp-client\node_modules\grpc\src\client_interceptors.js:1127:18
hero/hero.proto
syntax = "proto3";
package hero;
service HeroService{
rpc FindOne (HeroById) returns (Hero);
rpc FindMany (stream HeroById) returns (stream Hero);
}
message HeroById{
int32 id = 1;
}
message Hero{
int32 id = 1;
string name = 2;
}
hero/models/hero.model.ts
import { Field, ObjectType, ID } from '@nestjs/graphql';
@ObjectType()
export class HeroModel {
@Field(() => ID)
id: string;
@Field({ nullable: true })
name: string;
}
Below is my code. My question is is this architecture feasible and how to modify it to be effective。
When i request /graphql
hero/hero.proto
hero/models/hero.model.ts
hero/interfaces/hero.interface.ts
hero/hero.service.ts
hero/hero.resolver.ts
hero/module.ts
grpc-client.options.ts
main.ts
Need Help!!!