-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cryptic runtime error when running hive-gateway supergraph #8267
Comments
It looks like a TypeScript parse error. @enisdenjo Do you think we can improve this error message to show which file is the issue? |
@ejkg I tried replicating the issue following your description but couldn't get it to fail. It could be something with the Can you please share also the imports you do in BTW, for future reference, the Hive Gateway has been moved to: https://github.com/graphql-hive/gateway. |
graphql-hive/gateway#462 now exposes file paths of syntax errors - can you please try the alpha release to find the error? |
Hey Dennis, thanks for the update using the new package version basically I had to make this change in my composed supergraph. // supergraph/resolver.types.ts
- SizeMetadata: ResolverTypeWrapper<@mesh@EnrichedProductAttributes>;
+ SizeMetadata: ResolverTypeWrapper<@mesh#EnrichedProductAttributes>; This was caused by a typo in a codegen mapper that would have been really hard trace without the improved error reporting. import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "./src/supergraph/schema.graphql",
generates: {
"./src/supergraph/resolvers.types.ts": {
config: {
mappers: {
- SizeMetadata: "@mesh@EnrichedProductAttributes",
+ SizeMetadata: "@mesh#EnrichedProductAttributes",
},
},
},
},
};
export default config; Much appreciated. |
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Github,
Stackblitz
or
CodeSandbox
Describe the bug
I'm having trouble replicating this bug in a smaller context. I've got a very cryptic error from sucrase being thrown when I run
hive-gateway supergraph
. This command produces a runtime error which doesn't seem to be caught by typescript - yet the errors suggest this is a typescript issue.I can "fix" the issue by omitting a particular resolver file from the gateway config. However something strange. If I comment all of the code from the file it still doesn't resolve the issue, only if I remove the reference from my additionalResolvers in gateway.config does it work
When I comment out custom resolvers like this:
The gateway builds and executes the supergraph as expected.
Just to summarize. I believe the issue has to do with custom resolvers in the hive gateway because that appears to be the trigger for causing the cryptic error.
To Reproduce Steps to reproduce the behavior:
Still working on isolating the actual issue.
Expected behavior
Mesh composes the supergraph properly, but the gateway is unable to run our custom resolvers.
Environment:
"@graphql-hive/gateway": "^1.7.8"
:Additional context
Other relevant packages and their versions:
The text was updated successfully, but these errors were encountered: