Gqlgen: Getting Started Broken: `resolvergen: -: no matching versions for query "latest"`

Created on 14 Aug 2020  ยท  7Comments  ยท  Source: 99designs/gqlgen

What happened?

gqlgen-todos on ๎‚  master [โœ˜] on โ˜๏ธ  ap-southeast-2
โฏ go mod init github.com/lukekhamilton/gqlgen-todos
go: creating new go.mod: module github.com/lukekhamilton/gqlgen-todos

gqlgen-todos on ๎‚  master via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2
โฏ go get github.com/99designs/gqlgen
go: github.com/99designs/gqlgen upgrade => v0.12.1

gqlgen-todos on ๎‚  master [!?] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2 took 2s
โฏ git add .

gqlgen-todos on ๎‚  master [+] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2
โฏ gst
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   go.mod
    new file:   go.sum


gqlgen-todos on ๎‚  master [+] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2
โฏ gc -m "setup modules"
[master 18a4c8b] setup modules
 2 files changed, 84 insertions(+)
 create mode 100644 go.sum

gqlgen-todos on ๎‚  master [โ‡ก] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2
โฏ git remote -vv
origin  [email protected]:lukekhamilton/gqlgen-todos.git (fetch)
origin  [email protected]:lukekhamilton/gqlgen-todos.git (push)

gqlgen-todos on ๎‚  master [โ‡ก] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2
โฏ git push -u origin master
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 4.26 KiB | 4.26 MiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:lukekhamilton/gqlgen-todos.git
   5334d21..18a4c8b  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

gqlgen-todos on ๎‚  master via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2 took 8s
โฏ  go run github.com/99designs/gqlgen init
resolvergen: -: no matching versions for query "latest"
Exec "go run ./server.go" to start GraphQL server

gqlgen-todos on ๎‚  master [?] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2 took 26s
โฏ ls
go.mod  go.sum  gqlgen.yml  graph

gqlgen-todos on ๎‚  master [?] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2
โฏ go version
go version go1.15 darwin/amd64

gqlgen-todos on ๎‚  master [?] via ๐Ÿน v1.15 on โ˜๏ธ  ap-southeast-2
โฏ gqlgen version
v0.12.1

What did you expect?

Generate the todo code.

Most helpful comment

As a workaround until this is fixed. Run the go get for 0.11.3 version

go get github.com/99designs/[email protected]

then run the init command:

gqlgen init

Assuming you already have $HOME/go/bin in your shell path.

Finally, upgrade to latest gqlgen for your project:

go get github.com/99designs/gqlgen

All 7 comments

Just rolled back to go version 1.14.7:

~/Code/RnD on โ˜๏ธ  ap-southeast-2
โฏ rm -rf gqlgen-todos

~/Code/RnD on โ˜๏ธ  ap-southeast-2
โฏ mkdir gqlgen-todos

~/Code/RnD on โ˜๏ธ  ap-southeast-2
โฏ cd gqlgen-todos

Code/RnD/gqlgen-todos on โ˜๏ธ  ap-southeast-2
โฏ go mod init github.com/lukekhamilton/gqlgen-todos
go: creating new go.mod: module github.com/lukekhamilton/gqlgen-todos

Code/RnD/gqlgen-todos via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ git init
Initialized empty Git repository in /Users/lukeh/Code/RnD/gqlgen-todos/.git/

gqlgen-todos on ๎‚  master [?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ git remote add origin [email protected]:lukekhamilton/gqlgen-todos.git

gqlgen-todos on ๎‚  master [?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ gst
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    go.mod

nothing added to commit but untracked files present (use "git add" to track)

gqlgen-todos on ๎‚  master [?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ git add .

gqlgen-todos on ๎‚  master [+] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ gc -m "Updated doco"
[master (root-commit) fa732ab] Updated doco
 1 file changed, 3 insertions(+)
 create mode 100644 go.mod

gqlgen-todos on ๎‚  master via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ git push -uf origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 12 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 271 bytes | 271.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:lukekhamilton/gqlgen-todos.git
 + 6084920...fa732ab master -> master (forced update)
Branch 'master' set up to track remote branch 'master' from 'origin'.

gqlgen-todos on ๎‚  master via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2 took 8s
โฏ go get github.com/99designs/gqlgen
go: github.com/99designs/gqlgen upgrade => v0.12.1

gqlgen-todos on ๎‚  master [!?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2 took 13s
โฏ go run github.com/99designs/gqlgen init
resolvergen: -: no matching versions for query "latest"
Exec "go run ./server.go" to start GraphQL server

Looks like there is an issues in the new version 0.12.1

Just rolled back to version 0.11.3 and all is working;

gqlgen-issues on ๎‚  master [!?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ gqlgen version
v0.11.3

gqlgen-issues on ๎‚  master [!?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2
โฏ go run github.com/99designs/gqlgen init

Exec "go run ./server.go" to start GraphQL server

Version 0.12 works too:

gqlgen-issues on ๎‚  master [!?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2 took 37s
โฏ go run github.com/99designs/gqlgen init

resolvergen: -: no matching versions for query "latest"
Exec "go run ./server.go" to start GraphQL server

gqlgen-issues on ๎‚  master [!?] via ๐Ÿน v1.14.7 on โ˜๏ธ  ap-southeast-2 took 9s
โฏ gqlgen version
v0.12.0

Has this issue resolved? resolvergen: -: no matching versions for query "latest". I am not able to generate the code
I am using 0.12.1 version

Thanks to @lukekhamilton we can use git bisect to find the first commit that had this problem. My bisect-fu is weak, but I was able to sort it out:

$ ( mkdir test1283 && cd test1283 && go mod init github.com/$USER/gqlgen-issue1283 && git init . && git add . && git commit -m 'go mod init' )
go: creating new go.mod: module github.com/joshua/gqlgen-issue1283
Initialized empty Git repository in /Users/joshua/code/test1283/.git/
[master (root-commit) 544337f] go mod init
 1 file changed, 3 insertions(+)
 create mode 100644 go.mod
$ git clone https://github.com/99designs/gqlgen
Cloning into 'gqlgen'...
done.
$ cd gqlgen
$ git bisect start
$ git bisect bad v0.12.0
$ git bisect good v0.11.3
Bisecting: 49 revisions left to test after this (roughly 6 steps)
[d11f60218ccb4e5b17d702e736585f02978b69a4] Do not use pointers on named map types
$ function bisect { go build && ( cd ../test1283 && git clean -xdf && ../gqlgen/gqlgen init ) ; [ -f ../test1283/server.go ] && git bisect good || git bisect bad ; }

...and then I just ran bisect repeatedly until it gave me the first bad commit:

dbbda22ef42a921190cf52b3f23fa53b54726828 "go 1.14"

Could it be I'm using a too-old version of Go? It doesn't look like it:

$ go version
go version go1.14 darwin/amd64

As a workaround until this is fixed. Run the go get for 0.11.3 version

go get github.com/99designs/[email protected]

then run the init command:

gqlgen init

Assuming you already have $HOME/go/bin in your shell path.

Finally, upgrade to latest gqlgen for your project:

go get github.com/99designs/gqlgen

Here is what I did first :

go mod init github.com/AnnieTaylorCHEN/go-hackernews
go get github.com/99designs/gqlgen

then I got the message that says

go: github.com/99designs/gqlgen upgrade => v0.12.1

then I wrote

go get github.com/99designs/[email protected]
go run github.com/99designs/gqlgen init

then I got this:

resolvergen: -: no matching versions for query "latest"

And there was no server generated..... so I tried to downgrade it first

go get github.com/99designs/[email protected]
go run github.com/99designs/gqlgen init

And finally was able to run the server.... after that I repeated the above but changing it again to
go get github.com/99designs/[email protected] and I can run the server now.
Not sure if that's the right way to do that... but it solved my problem for the moment.

Reference: go version go1.15 linux/amd64

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itsbalamurali picture itsbalamurali  ยท  4Comments

msmedes picture msmedes  ยท  4Comments

kevinmbeaulieu picture kevinmbeaulieu  ยท  3Comments

sumanthakannantha picture sumanthakannantha  ยท  3Comments

jacksontj picture jacksontj  ยท  4Comments