Comments (4)
@michaelmohamed Unfortunately it's not that simple... TLDR if you just want to get it working, then I recommend downgrading to an older version of the grpc handler for now; I think 0.93.2 might be the last version without the bug (which was introduced in #5420).
Explanation: the bug is happening because of a new feature that was added to include the grpc metadata in a .graphql file using a graphql directive, and then read the metadata from the .graphql file instead of directly from the grpc API. In theory, that will make it possible to publish the schema for grpc APIs to GraphQL Hive as explained in the docs, although not everyone needs that feature. The problem is that there's a bug in the way that the grpc metadata is saved in the .graphql file, meaning that graphql-mesh isn't always able to read it properly. Specifically, this seems to happen as soon as you're using a grpc API that has more than one protobuf package.
The WeakMap error is just a symptom of this issue, and my "fix" is just a better error message for it, because even when the underlying issue is fixed it would be good to have better error handling for that case. (My PR gives it this error message: "Protobuf metadata not found in the GraphQL schema or is corrupted. The gRPC handler only accepts GraphQL schema files generated using GraphQL Mesh".)
I was also trying to fix the underlying issue, but got too busy and it was also a bigger task than I first anticipated, because there seems to be an upstream issue in @graphql-tools/stitch
or one of its dependencies. I'm not one of the maintainers of this repo so the code is unfamiliar to me...hopefully someone like @ardatan can take a look. Relevant details here and here.
from graphql-mesh.
I created a repo earlier with a reproduction of this issue. Steps to reproduce:
git clone [email protected]:mbrowne/graphql-mesh-bug-repro.git --single-branch --branch grpc-source-issue
cd graphql-mesh-bug-repro
yarn
yarn grpc:start
Then in another terminal window:
yarn mesh:start
I also already fixed this error in a fork of this repo:
https://github.com/ardatan/graphql-mesh/compare/master...mbrowne:graphql-mesh:grpc-sdl-fixes?expand=1
Unfortunately there is still a second issue that will likely be encountered by anyone who encounters this first issue, as I described at #5438, but I suppose it makes sense to start by getting a bug fix for this error merged.
from graphql-mesh.
@mbrowne is there a way to use your fix in my project by modifying my package.json?
How do we get these changes merged in?
from graphql-mesh.
Hey there, I faced the same issue >= 0.94.0 getting this error. < 0.94.0 dynamic vars are not working with :|
from graphql-mesh.
Related Issues (20)
- mesh build --throwOnInvalidConfig does not throw on invalid config
- RPC Method Named 'Close' Conflicts with Client Connection Close Operation in GraphQL Mesh gRPC Handling
- Response types from OAS response schema $ref
- Feedback for “Extend Transform (experimental)”
- Feedback for “Operation Field Permissions”
- HTTP cache returns unusable response if TTL = 0 => server hangs indefinitely
- Easily access underlying API responses HOT 2
- TypeScript strict null checks
- graphql-mesh with gRPC and openapi handlers + global transform results in cached variables HOT 1
- `@omnigraph/openapi`: OpenAPI array values not converted correctly into GraphQL
- mysql HOT 1
- Using enum in swaggers break other routes HOT 5
- prometheus config not working HOT 6
- Supergraph handler fails with same field name HOT 2
- SDK return types are misleading
- transform-hive does not support SelfHosting
- Format check in CI HOT 3
- `yarn install` fails, due to `node_libcurl` & node >= 20 combination
- Update Postgraphile to the latest
- Document Hive Client parameters in Mesh configuration with more details
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-mesh.