Skip to content
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 error on build when source handler fails #3951

Open
4 tasks
ejkg opened this issue May 19, 2022 · 2 comments
Open
4 tasks

Cryptic error on build when source handler fails #3951

ejkg opened this issue May 19, 2022 · 2 comments

Comments

@ejkg
Copy link

ejkg commented May 19, 2022

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

Our build broke recently and it was throwing a very confusing error. luckily we were able to find the issue and fix it. One of our data sources is Contentful and we were pointing our build to a contentful environment that no longer existed. The error gave no indication that an issue was happening with that particular data source.

It's difficult to know who to contact when we don't know what's failing.

Stack Trace

💥 🕸️  Mesh Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
    at Object.getMesh (/Users/edwinjackson/path/to/project-root/node_modules/@graphql-mesh/runtime/index.js:69:15)
    at async Object.handler (/Users/edwinjackson/path/to/project-root/node_modules/@graphql-mesh/cli/bin.js:1089:53)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

Steps to reproduce the behavior:
To reproduce, configure at least 2 data sources. One that is fine, and another that doesn't exist. There should be in error that doesn't fully describe the situation.

sources:
  - name: OkayHandler
    handler:
      graphql:
        endpoint: http://my-serviceA-url:3000/graphql
  # This service is down at build time
  - name: BrokenHandler
    handler:
      graphql:
        endpoint: https://my-serviceB-url:3000/graphql

then

$ yarn run mesh:build 

should produce an output like this:

💥 🕸️  Mesh Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
    at Object.getMesh (/Users/edwinjackson/path/to/project-root/node_modules/@graphql-mesh/runtime/index.js:69:15)
    at async Object.handler (/Users/edwinjackson/path/to/project-root/node_modules/@graphql-mesh/cli/bin.js:1089:53)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

Mesh should indicate which data source handler failed.

Environment:

  • OS: macOS
  • "@graphql-mesh/cli": "0.70.3":
  • NodeJS: v16.14.2
@ardatan
Copy link
Owner

ardatan commented May 19, 2022

So if one of the sources fails, it fails with a long stack trace without giving a clue. Did I understand correctly?

@ejkg
Copy link
Author

ejkg commented May 19, 2022

I should have provided a sample stacktrace. I'll update the original comment with some more information.

💥 🕸️  Mesh Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
    at Object.getMesh (/Users/edwinjackson/path/to/project-root/node_modules/@graphql-mesh/runtime/index.js:69:15)
    at async Object.handler (/Users/edwinjackson/path/to/project-root/node_modules/@graphql-mesh/cli/bin.js:1089:53)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@Urigo Urigo mentioned this issue Aug 11, 2022
22 tasks
This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants