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

[issue #1258] explicitly add gqlparser alias to vektah/gqlparser/v2 import #1262

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

sateeshpnv
Copy link
Contributor

Describe your PR and link to any relevant issues.

As described in #1258, generated.go doesn't compile with v0.11.3 (it used to work with v0.10.2). Compilation fails with:

/private/var/tmp/_bazel_sateesh/.../sandbox/darwin-sandbox/1531/execroot/__main__/bazel-out/darwin-fastbuild/bin/src/.../generated.go:4521:20: undefined: gqlparser

Special aspects of our environment:

  1. It is a bazel based project
  2. generation is invoked using api package

After debugging, realized that alias for github.com/vektah/gqlparser/v2 is computed as v2 while the generated!.gotpl uses gqlparser alias. Since v2 alias is not used, it does get imported the generated.go file. Couldn't really find why alias is computed wrongly in our setup. However, updating generated!.gotpl template to explicitly use gqlparser alias got us a working generated.go. Hence this PR.

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 66.223% when pulling 99fafc9 on sateeshpnv:gqlparser-alias into 0fbf293 on 99designs:master.

@mtibben mtibben merged commit fbfdd41 into 99designs:master Jul 23, 2020
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
[issue 99designs#1258] explicitly add gqlparser alias to vektah/gqlparser/v2 import
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 this pull request may close these issues.

3 participants