-
Notifications
You must be signed in to change notification settings - Fork 1k
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
gql typegen messaging updates #4491
Conversation
I've created an issue report with Let's see what they say before we decide on next steps here. |
Some notes from looking into this The original issue had these reproduction steps:
Instead of A good entry-point for this in RW code is node_modules/@redwoodjs/internal/dist/generate/generate.js. We're interested in the call to
I'll try and see if I can call Will continue tomorrow |
Alternative (better, imo) solution over here: #4728 |
@Tobbe seems like this one is now ok to close out, correct? |
Yes |
Fixes #4393
To recap, this is the error we're printing
The "Unable to find..." error message comes from here: https://github.com/ardatan/graphql-tools/blob/2207fbcdacf708ee9836ee72d0c0f92dba0d0942/packages/load/src/load-typedefs.ts#L120
The "Error: Could not generate..." message is our own.
With
errorsOnly: false
we get a better idea of what's going on:@graphql-codegen
is using Listr, and as you can see there are two tasks that fail with the same error message, that's why we get duplicated output. We get it for both "Load GraphQL documents" and "Generate /Users/tobbe/tmp/typegen/web/types/graphql.d.ts".The first of those two is here: https://github.com/dotansimha/graphql-code-generator/blob/1e3d37a349a1d6748f235465a8bb78c66e0d1edf/packages/graphql-codegen-cli/src/codegen.ts#L261 and the other one is right after. And because they have
exitOnError: true
configured, as soon as the first of those two fails, so does the other one. And apparently the error carries over. If I switch it toexitOnError: false
I only get one error output:But that's not something I can control, so we'll have to live with duplicated output from
@graphql-codegen