Graphql-code-generator: errors still being swallowed

Created on 9 Aug 2019  路  4Comments  路  Source: dotansimha/graphql-code-generator

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.

bug core waiting-for-release

Most helpful comment

@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!

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dotansimha picture dotansimha  路  3Comments

jagregory picture jagregory  路  3Comments

edorivai picture edorivai  路  3Comments

rogerg93 picture rogerg93  路  3Comments

quolpr picture quolpr  路  3Comments