Where does the output from graphql-codegen go, if not stderr or stdout? #7725
Replies: 2 comments
-
Well, I made a little bit of progress here, I have a theory, which is that graphql-codegen uses listr and listr suppresses all output for the individual commands. Well "suppresses"... it still manages to appear in the console, which I don't understand. But it suppresses it ever making it to stdout or stderr. I guess my next step is to try to duplicate that behavior with a small listr demo. |
Beta Was this translation helpful? Give feedback.
-
Ayyy! Found a workaround! I still have no understanding of why this is happening in the first place. I did see there's a custom Lister renderer in https://github.com/dotansimha/graphql-code-generator/blob/master/packages/graphql-codegen-cli/src/utils/listr-renderer.ts. Which probably has something to do with it? But the workaround is to use the Linux
That creates an entire new shell, runs the command in it, and allows you to capture the output. Nice! Seems like this might work with pm2. I will try to write a script that silently starts up the Edit: Even easier than that, I can just pipe the command to
So all I need to do in my pm2 config is run |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Probably a stupid question, and I'm missing something totally basic about how shells work, but this is really baffling me!
I'm trying to use graphql-codegen with pm2, but when capturing lots pm2 expects output to go to stderr or stdout. The output from graphql-codegen seems to go... somewhere else?
Like, if I run the raw command, I get a nice error message that tells me "Please make sure that your codegen config file contains the "generates" field":
But if I try to capture that output I don't get any of that info:
What's going on here? I don't understand how that output is showing up in the shell if its not going through stderr or stdout?
Beta Was this translation helpful? Give feedback.
All reactions