It appears code errors are still being swallowed. I made a minimal repo showing the issue.
clone this repo: https://github.com/jsphweid/graphql-code-generator-bug
npm i
npm run generate:code
it fails with an unhelpful error message: Failed to load schema from ./src/index.ts. (but WHERE did it fail?!?!)
go to src/Context.ts
comment out the bad import import * as Archive from "../../../raw-archive/src";
run npm run generate:code again. It works.
Why is it hiding the actual code error?
It's really time-consuming to find bugs like this in large codebases. It'd be awesome if this were fixed.
Hi @jsphweid
We recently did some major changes in the implementation of graphql-toolkit, so it might come from there.
I'll take a look.
Thank you for reporting it!
@jsphweid
fixed it in: https://github.com/dotansimha/graphql-code-generator/pull/2339
can you please try the latest alpha? 1.5.1-alpha-521f8ddf.23
@dotansimha
Unable to load schema from file "/Users/josephweidinger/Desktop/temp/src/index.ts" due to import error: Cannot find module '../../../raw-archive/src'
much better error!
Fixed in 1.6.0.
Most helpful comment
@dotansimha
much better error!