ardatan / graphql-mesh

πŸ•ΈοΈ GraphQL Mesh - The Graph of Everything - Federated architecture for any API service

Home Page:https://the-guild.dev/graphql/mesh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gRPC reflection doesn't work for one endpoint handling multiple services

mr-nagashima opened this issue Β· 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

The backend's gRPC API provides nine services.

I wrote the .meshrc.yaml below.

.meshrc.yaml

sources:
  - name: Backend
    handler:
      grpc:
        endpoint: backend:3000

And when I started GraphQL Mesh in dev mode, I got an error at the end.

$ mesh dev
    :
Mesh - Server πŸ’‘ Starting GraphQL Mesh...
Mesh - Server πŸ’‘ Serving GraphQL Mesh: http://0.0.0.0:4000
Mesh - Backend πŸ› Getting stored root and decoded descriptor set objects
Mesh - Backend πŸ› Building Roots
Mesh - Backend πŸ› Using the reflection
Mesh - Backend πŸ› Creating gRPC Reflection Client
Mesh - Backend πŸ› Resolving root of Service: greet.v1.GreetService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: cancellation.v1.CancellationService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: supplier.v1.SupplierService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: depot.v1.DepotService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: warehouse.v1.WarehouseService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: office.v1.OfficeService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: company.v1.CompanyService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: plan.v1.PlanService from the reflection response
Mesh - Backend πŸ› Resolving root of Service: room.v1.RoomService from the reflection response
    :
Mesh - Backend πŸ› Building the schema structure based on the root object
Mesh - Backend - Root0 πŸ› Visiting .nested[greet]
    :
Mesh - Backend πŸ› Building the schema structure based on the root object
Mesh - Backend - Root8 πŸ› Visiting .nested[google]
    :
Mesh - Backend πŸ› Building the final GraphQL Schema
Mesh - Backend - Root8 πŸ› Creating service client for package definition
Mesh - Backend πŸ’₯ Failed to generate the schema for the source "Backend"
Invalid value used as weak map key
Mesh HTTP πŸ’₯ Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh.
    at getMesh (/app/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:124:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

I think that the reflection has been loaded, the above error occurs at the very end.
What does "Invalid value used as weak map key" indicate?

I would appreciate it if you could tell me the solution.

To Reproduce Steps to reproduce the behavior:

Expected behavior

Start normally

Environment:

  • OS: macOS 14.4.1
  • @graphql-mesh/...:
  • NodeJS: 20

Additional context