Problems to send arrays to grpc client

43 views
Skip to first unread message

Stivenson Rincón

unread,
Apr 11, 2020, 9:53:41 PM4/11/20
to grpc.io

Hi guys, best regards everyone.

Please guys I have been studying quite a few "typescript" with "grpc". but I have not been able to get an array from the grpc server.

And in this repo (link) I have two alternatives of use (one of them using an envoy proxy)

What do you think? I have studied everything in this theme and I don't understand why arrays are so complicated to bring the client. :(


Without envoy proxy (master): https://github.com/stivenson/example-typescript-grpc-api/blob/master/src/index.test.ts

With envoy proxy (other branch): https://github.com/stivenson/example-typescript-grpc-api/blob/feature/alternative-use-with-web-client/src/index.test.ts

Thank you for your attention.
branches are well documented in each readme. Sorry for my English.

I want to leave this repo as a contribution to the community, for a guide on the integration of Typescript with various technologies.

The link of issue is this: https://github.com/stivenson/example-typescript-grpc-api/issues/1

Michael Lumish

unread,
Apr 15, 2020, 2:47:22 PM4/15/20
to Stivenson Rincón, grpc.io
There's a lot of code in that repository so it's hard to tell what exactly is happening. One thing that stands out is that your server is constructing message objects using types generated with protoc, then calling toObject and passing it to a service callback generated using @grpc/proto-loader. It would be simpler to just construct the plain object directly, and it's not clear if that toObject method generates an object with the right structure.

--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/742e951c-24ff-4a26-8959-2ec830781e16%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages