On main, there is no error if the schema file cannot be found #146
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Issues that anyone could pick up and implement if useful to them
Describe the bug
In v0.3.0 if you point to a schema file that does not exist you will be given an error:
Past v0.3.0, you get a confusing error that the types are not known:
To Reproduce
genqlient.yaml
contains a schema path that does not exist:schema: graph/nonexistent.graphqls
go run github.com/Khan/genqlient
Expected behavior
genqlient version
v0.3.1-0.20211022224026-a4aa6d9bb0f4
The problem cannot be reproduced on
v0.3.0
.Additional context
I believe the behavior was introduced in this commit: 59b6df6
Since we are globbing, we end up with an empty list of files to iterate. Since we don't try to load any files, we never return an error that they can't be loaded.
I'm not sure the best fix here - perhaps try to detect if a line is a glob or not, and only call the glob function if it is? Or maybe a glob pattern that returns no results should result in an error - or warning.
The text was updated successfully, but these errors were encountered: