When running apollo codegen:generate, and there are some graphql-queries that contain syntax errors, the cli simply ignores the malformed query without any notice.
Intended outcome:
I would expect a warning about malformed queries, or even the whole operation to fail.
Actual outcome:
The apollo-clil just ignores the query and successfully generates code for all other queries it finds:
$ apollo codegen:generate --localSchemaFile src/common/__generated__/schema.json --globalTypesFile src/common/__generated__/globalSchemaTypes.ts --target typescript
✔ Loading Apollo Project
✔ Generating query files with 'typescript' target - wrote 10 files
How to reproduce the issue:
I forked the apollo-tutorial repo to showcase the issue:
git clone https://github.com/DeX3/fullstack-tutorial
- Go to the client directory:
- Install dependencies:
- Run
apollo codegen:generate:
$ npx apollo codegen:generate --target flow --includes src/sample-queries.js --localSchemaFile schema.json
✔ Loading Apollo Project
✔ Generating query files with 'flow' target - wrote 1 files
There are two queries defined in src/sample-queries.js, a valid one (which is correctly picked up by apollo-cli) and one with a syntax error, which is silently ignored - which might be a problem.
Versions
- apollo/2.19.0
- OS: darwin-x64
- Node: node-v12.10.0
When running
apollo codegen:generate, and there are some graphql-queries that contain syntax errors, the cli simply ignores the malformed query without any notice.Intended outcome:
I would expect a warning about malformed queries, or even the whole operation to fail.
Actual outcome:
The apollo-clil just ignores the query and successfully generates code for all other queries it finds:
How to reproduce the issue:
I forked the apollo-tutorial repo to showcase the issue:
git clone https://github.com/DeX3/fullstack-tutorial$ cd final/client$ yarn # or npm installapollo codegen:generate:$ npx apollo codegen:generate --target flow --includes src/sample-queries.js --localSchemaFile schema.json ✔ Loading Apollo Project ✔ Generating query files with 'flow' target - wrote 1 filesThere are two queries defined in
src/sample-queries.js, a valid one (which is correctly picked up by apollo-cli) and one with a syntax error, which is silently ignored - which might be a problem.Versions