我试图在函数中调用一个简单的 grpc 请求,但我不知道如何等待响应并将其传递到 grpc 调用之外。
应该是这样的:
Client: (parent, args, context, info) =>{
client.Get({thing, objects, properties}, function(err, response) {
//how to return the response outside?
});
//await for the response function.
};
Run Code Online (Sandbox Code Playgroud)
是否可以在 client.Get 函数之外以某种方式返回响应?有人有一些建议吗?谢谢您的建议!