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)
- Project Roadmap
- Project Roadmap
- Schema generation is non-deterministic
- Document `UWS_HTTP_MAX_HEADERS_SIZE`
- TLS configuration for “Redis Cache” HOT 1
- With encapsulate transform, it is not possible to point to the root types
- Fails on Abacus OData schema
- ODATA query parameters not url-encoded
- Disabling any resolver on a Mongoose model fails to generate the schema HOT 3
- Error: No `subscribe` function found! Register it using "useEngine" plugin. HOT 2
- Feedback for “Type Merging Transform” HOT 1
- mesh build fails when package.json has type: module HOT 5
- `Must provide query string.` should not be an error with APQ
- Feedback for “Type Merging Transform”
- After conversion getting error at execution step HOT 3
- Feedback for “GraphQL”
- Package manager warnings from native binaries
- Feedback for “Type Merging Transform”
- Better Error Messages and Debugging Experience
- Inaccurate transformed document caching HOT 2
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.