apollo codegen:generate
simply ignores malformed queries
#1567
Labels
🤖 component - codegen
related to the codegen core packages
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 install
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
The text was updated successfully, but these errors were encountered: