grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.56k stars 762 forks source link

getMethodDescriptor(...).createUnaryResponse is not a function #1215

Closed eyouyou closed 2 years ago

eyouyou commented 2 years ago

Hi there,

I try to construct a UnaryResponse in Interceptor but failed

Code:

class InterceptorTest 
{

    intercept(request: any, invoker: any) {
        return Promise.resolve( request.getMethodDescriptor().createUnaryResponse(new GeneralReply()));
    }

}

or how to create response

thanks

Version:

grpc-web: 1.3.1

sampajano commented 2 years ago

Please refer to interceptor documentations on how it can be used:

Thanks :)