graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

grpc handler error: "8 RESOURCE_EXHAUSTED: Received message larger than max (6771289 vs. 4194304)"

Open cristianbriscaru opened this issue 1 year ago • 3 comments

Issue workflow progress

Progress of the issue based on the Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • [ ] 2. A failing test has been provided
  • [ ] 3. A local solution has been provided
  • [ ] 4. A pull request is pending review

Describe the bug

When using grpahql-mesh with the grpc handler when making a request if the grpc response is greater than the default max size there will be an error thrown : "8 RESOURCE_EXHAUSTED: Received message larger than max (6771289 vs. 4194304)".

This is caused by the grpc client default max_receive_message_length : 4194304 : https://github.com/grpc/grpc-node/issues/1093.

The only fix for this issue would be to pass a "grpc.max_receive_message_length" config option to the grpc client but grpahql-mesh doesn't support this.

To Reproduce Steps to reproduce the behavior: To reproduce make a request where the response size is greater than 4194304

Expected behavior

A way to pass config options to the grpc client

sources:
  - name: MyGRPCService
    handler:
      grpc:
        endpoint: 'localhost:50051'
        options:
          'grpc.max_receive_message_length':  10000000

Or a way to pass a custom client to the handler

sources:
  - name: MyGRPCService
    handler:
      grpc:
        client: ./custom-grpc-client.js

Environment:

  • OS:
  • @graphql-mesh/...:
  • NodeJS:

Additional context

cristianbriscaru avatar Jun 21 '24 11:06 cristianbriscaru

Thanks for creating the issue! PRs are welcome if anyone is interested in implementing this missing option!

ardatan avatar Jun 21 '24 14:06 ardatan

Any updates?

Georg-Mirchev avatar Aug 26 '24 13:08 Georg-Mirchev

Looking for this feature !

akateliev avatar Aug 26 '24 13:08 akateliev