Console output is confusing when backend runtime build fails
Turn multiple data sources into a single GraphQL API.
Brought to you by:
skeep
Originally created by: kyelewis
Describe the bug
When the backend fails to build properly at runtime, both type generation steps run and return confusing console output.
Expected behavior
The backend error during type generation is clearly identified, execution of those tasks is stopped and no further codegen tasks run.
Actual behavior
The actual error is reported, but then below it, each of the generate outputs tasks outputs the following logging:
Failed to load schema from graphweaver:
invalid json response body at http://localhost:9001/ reason: Unexpected end of JSON input
FetchError: invalid json response body at http://localhost:9001/ reason: Unexpected end of JSON input
at .pnpm/node-fetch@2.6.11/node_modules/node-fetch/lib/index.js:273:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async loader_default (.pnpm/@exogee+graphweaver-builder@0.2.2_@types+react@18.0.27_typescript@4.9.5/node_modules/@e…
at async .pnpm/@graphql-tools+load@8.0.0_graphql@16.6.0/node_modules/@graphql-tools/load/cjs/load-typedefs/collect-sou…
GraphQL Code Generator supports:
- ES Modules and CommonJS exports (export as default or named export "schema")
- Introspection JSON File
- URL of GraphQL endpoint
- Multiple files with type definitions (glob expression)
- String in config file
Try to use one of above options and run codegen again.
Originally posted by: skeep-exogee
Thanks @kyelewis we will look to get this fixed along with https://github.com/exogee-technology/graphweaver/issues/137