You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Hey guys, so it seems like for quite some time @graphql-mesh/graphql is struggling to generate GQL schema based on introspection url. I've debugged the issue for a while and my conclusions are:
Seems like even if explicitly configured introspection query always uses GET method instead of POST. I believe that may be linked to issues with undici Issue on version 0.4.8 whatwg-node#52
After workaround for 1st issue, second is that Hasura GraphQL Engine and also SpaceX GQL Api returns introspection in form of: {data: {__schema}} while @graphql-mesh/graphq (in: server/node_modules/@graphql-mesh/graphql/index.js:86) expects it to be just {__schema}.
To Reproduce
Steps to reproduce the behavior:
Stackblitz sandbox
Repro includes my workaround, check ./workaroundFetch.js file comments to learn more and see how it fails without hard-coding method: "POST" or dropping data.__schema -> __schema transformation of the response.
On the sidenote, I was struggling quite a bit with having any useful debugging informations, w/o instrospection configured, I'd got errors like:
TypeError: Cannot read properties of undefined (reading 'extensions') at BareMerger.handleSingleSource (C:\Projects\trackbuild\server\node_modules\@graphql-mesh\merger-bare\index.js:28:40) at BareMerger.getUnifiedSchema (C:\Projects\trackbuild\server\node_modules\@graphql-mesh\merger-bare\index.js:48:25) at getMesh (C:\Projects\trackbuild\server\node_modules\@graphql-mesh\runtime\index.js:315:43) at async initGraphQlMesh
which wasn't that helpful.
After adding the introspection it gives more specific error infos. But because of using it stackblitz reproduction fails, so w/o introspection & customFetch it works just fine there.
However, in my local project, it was giving me the error above. Where configuring the introspection & customFetch with a workaround resolves the issue.
Also by looking at my custom fetch impl. it seems like it's not having "typical introspection query" body delivered when using sources.graphql.introspection in config, but I had to prepare my own.
I may be a choice but it might be worth metioning in docs?
The text was updated successfully, but these errors were encountered:
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
Hey guys, so it seems like for quite some time
@graphql-mesh/graphql
is struggling to generate GQL schema based on introspection url. I've debugged the issue for a while and my conclusions are:{data: {__schema}}
while@graphql-mesh/graphq
(in: server/node_modules/@graphql-mesh/graphql/index.js:86) expects it to be just{__schema}
.To Reproduce
Steps to reproduce the behavior:
Stackblitz sandbox
Repro includes my workaround, check
./workaroundFetch.js
file comments to learn more and see how it fails without hard-codingmethod: "POST"
or droppingdata.__schema
->__schema
transformation of the response.Expected behavior
Schema should get generated properly.
Environment:
@graphql-mesh/...
: most recentbut it also fails for older versions
Additional context
On the sidenote, I was struggling quite a bit with having any useful debugging informations, w/o
instrospection
configured, I'd got errors like:which wasn't that helpful.
After adding the
introspection
it gives more specific error infos. But because of using it stackblitz reproduction fails, so w/ointrospection
&customFetch
it works just fine there.However, in my local project, it was giving me the error above. Where configuring the
introspection
&customFetch
with a workaround resolves the issue.Also by looking at my custom fetch impl. it seems like it's not having "typical introspection query" body delivered when using
sources.graphql.introspection
in config, but I had to prepare my own.I may be a choice but it might be worth metioning in docs?
The text was updated successfully, but these errors were encountered: