Skip to content
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

Missing closing brace in GQL input does not emit error #1897

Closed
lilyball opened this issue Apr 15, 2020 · 2 comments · Fixed by #1899
Closed

Missing closing brace in GQL input does not emit error #1897

lilyball opened this issue Apr 15, 2020 · 2 comments · Fixed by #1899

Comments

@lilyball
Copy link
Contributor

Intended outcome:

I took one of my input GQL files and deleted a closing brace, then re-ran apollo client:codegen. I expected it to produce an error.

Actual outcome:

It succeeded just as if I had no error, except it skipped outputting a .graphql.swift file corresponding to the input file I modified.

How to reproduce the issue:

  1. Take an existing project with multiple graphql input files
  2. Edit one of the files and delete a closing brace somewhere. I did it at the end of a query, but I also tried deleting an interior brace and got the same behavior.
  3. Run apollo client:codegen $outputDir --includes="*.graphql" --localSchemaFile=schema.json --target=swift

Versions

I've reproduced with both apollo/2.21.0 darwin-x64 node-v10.19.0 and a freshly-installed apollo/2.27.0 darwin-x64 node-v10.19.0.

@lilyball
Copy link
Contributor Author

Validation errors such as missing fields emit an error properly. My assumption is parsing errors are just being silently skipped, but I didn't attempt to introduce any other parse errors, just the missing brace.

@JakeDawkins
Copy link
Contributor

I believe #1899 should fix this! we were intentionally not erroring on syntax errors when setting up the project. I'm not 100% sure why we weren't, but I'm hesitant to change that now. Instead, I'm adding an error in the codegen command itself that should catch those errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants