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

Ambiguous package names lead to incorrect import statements #207

Closed
tsuna opened this issue Jul 19, 2018 · 0 comments · Fixed by #365
Closed

Ambiguous package names lead to incorrect import statements #207

tsuna opened this issue Jul 19, 2018 · 0 comments · Fixed by #365
Labels
bug Something isn't working

Comments

@tsuna
Copy link

tsuna commented Jul 19, 2018

This is basically just re-opening #60. As mentioned there, as of commits abf85a1 / c0158f5 (the former doesn't build, so the last commit that works for me is a39c63a) that bug seems to have crept back into the code.

For example, say I have a package called foo/query and upon re-generating the code past that commit, I get the following diff:

--- a/foo/apigraphql/generated.go
+++ b/foo/apigraphql/generated.go
@@ -1,4 +1,4 @@
-// This file was generated by github.com/vektah/gqlgen, DO NOT EDIT
+// Code generated by github.com/vektah/gqlgen, DO NOT EDIT.
 
 package apigraphql
 
@@ -6,33 +6,154 @@ import (
        "bytes"
        context "context"
        apimodel "foo/apimodel"
-       query1 "foo/query"
+       query "foo/query"
        strconv "strconv"
 
        graphql "github.com/vektah/gqlgen/graphql"
        introspection "github.com/vektah/gqlgen/neelance/introspection"
-       query "github.com/vektah/gqlgen/neelance/query"
        schema "github.com/vektah/gqlgen/neelance/schema"
 )
 

as a result the code obviously doesn't compile anymore:

$ go test ./...
# foo/apigraphql
./generated.go:167:59: undefined: "foo/query".Operation
@vektah vektah added the bug Something isn't working label Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants