graphql-code-generator
graphql-code-generator copied to clipboard
[cli] The --errorsOnly flag still produces non-error output
Describe the bug
While running the code generator with --errorsOnly it still produces output such as:
✔ Parse Configuration
✔ Generate outputs
Your Example Website or App
- Default minimal reproduction
Steps to Reproduce the Bug or Issue
- Open default minimal reproduction repository
- Run
npm run codgen --errorsOnly - Notice the output.
Expected behavior
Since there are no errors in the schema or generation, it should not print any output with the --errorsOnly flag.
For very large configurations that runs e.g. in CI environments the output can be quite large. It would be nice if we in those cases could only print the errors, if any.
Screenshots or Videos
No response
Platform
- OS: Linux
- NodeJS: 16.17.1
graphqlversion: 16.3.0@graphql-codegen/cliversion(s): 2.13.5
I am not sure if i follow the example here. Can you please share a reproduction?
This is reproducible with the default minimal reproduction. I'll clarify things a bit. But running npm run godegen and npm run codegen --errorsOnly will give the same output. I would expect that if there are no errors the second command would not produce any output.
It looks like it was removed here https://github.com/dotansimha/graphql-code-generator/pull/8005
Any movement on this? Would be really great to have this functionality back
Would be really helpful to have this fixed, especially since there doesn't seem to be a workaround.
I just came across this as well as we are trying to suppress output during builds.
@Tigge looks like you're using flag errorsOnly but it seems the actual flag is errors-only as seen here:
But even if you use the correct flag, the output is completely unaffected from what I am seeing.
Can someone create a reproduction using the latest version?
I'm labeling this according to our new Contribution Guide and issue flow to stage 0.
Now in order to advance to stage 1 we'll need a simple reproduction, maybe in code-sandbox?
Later to progress to stage 2, a failing test would be needed, would be great if someone could help progress the issues through the stages.
Thank you and sorry that this comment is not a complete solution (yet).
@Urigo the functionality was removed (by mistake I guess) in this pr and as @Tigge said
This is reproducible with the default minimal reproduction. I'll clarify things a bit. But running npm run godegen and npm run codegen --errorsOnly will give the same output. I would expect that if there are no errors the second command would not produce any output.
@marco2216 yes I understand, thank you even if its reproducible easily, we still would want a repo or a codesandbox with the latest version that clearly demonstrates this
It would then make it easier to create a test to track this, which later we'll use when we'll fix it
Right now seems output is either too verbose or too little, ideally codegen could say when it's started, and it's finished (with all generators), not spamming multiple started and successes for each generator.
re-implementing errorsOnly would be nice step, but maybe that's too far the other way? (not enough output, as it's good to know it's "working/done" states)
is there any workaround? it is unessecary verbose by default, but seeing errors would be crucial.
is someone working in this? It's a regression, right?