-
Notifications
You must be signed in to change notification settings - Fork 114
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
running generate with package_bindings causes an error (@main) #220
Comments
Weird! Something seems to think that your models are in a package named |
@benjaminjkraft it doesn't appear anywhere in the source code, but i was able to find a reference to that string in a vendor file - it seems to be coming from go itself https://github.com/golang/tools/blob/master/go/packages/golist.go#L344-L361 here's my
|
Whoa, weird, nice find! It took me a moment to notice but I think the problem here is that the value for That is, it should be: package_bindings:
- package: github.com/yourorg/yourrepo/path/to Does it work if you change it like that? (And if that's the issue, is there somewhere in the genqlient documentation you got that from, or that we could be clearer where you would have seen it? We should definitely look for this and give a better error, too!) |
fixed with using the correct thanks so much for your help! |
The entries under the new `package_bindings` field should be packages, but it's an easy mistake to put a file path instead (most of the other fields in `genqlient.yaml` are files). Due to some bizzare behavior from `go/packages` (described in #220), if you do that you get weird broken code that gives you no clue what is wrong. Instead, let's guess if what you gave us looks like a filename, and report a nice error if so. Test plan: crossed fingers
Great! #221 should give a better error here for the future. Let us know if you run into any other problems with |
The entries under the new `package_bindings` field should be packages, but it's an easy mistake to put a file path instead (most of the other fields in `genqlient.yaml` are files). Due to some bizzare behavior from `go/packages` (described in #220), if you do that you get weird broken code that gives you no clue what is wrong. Instead, let's guess if what you gave us looks like a filename, and report a nice error if so. Test plan: crossed fingers
Describe the bug
received the following error trying to generate code
To Reproduce
in
genqlient.yaml
, specify the path to your models.run
go run github.com/Khan/genqlient@main
with a defined query file.Expected behavior
Should not fail and should successfully generate the file reusing the project's existing models
genqlient version
github.com/Khan/genqlient@main
Additional context
Here's a snipped from what was printed on the command line:
The text was updated successfully, but these errors were encountered: