I have attempted all I can to send and receive arbitrary data using 
`google.protobuf.Struct` from NodeJS all to no success. 

I am using the official `@grpc/grpc-js` npm package for all my needs.

Below is my proto file:

    message WorkSpaceRequest{
        google.protobuf.Struct body=1;
    }

    message WorkSpaceResponse{
        google.protobuf.Struct workspace=1;
    }

Here is how I sent out the request from a NodeJS Client

       function findById(id) {
          client?.findById({ body: {id:xxxxxx} }, (err, response) => {
               if (err) {
                   console.log(err);
                   return;
               }
               let workspace=response.workspace; 
              //Below is the response that keeps coming back
               {
                  "fields": {}
               }
          });
       }

Here is my rpc implementation function:
  

        function findById(call, callback) {
          let {id} = call.request.body; //Id always comes in as undefined 
even though it has a value to it.
          let sampleWorkspaceSpace = {
            "name": "Sample Workspace Name",
            "id": "Sample Workspace Id"
        }
        callback(null, { workspace: sampleWorkspaceSpace  });
      }

What could I be doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/ef288a69-6a35-4d98-9085-0b6d0417358fn%40googlegroups.com.

Reply via email to