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

Getting Started Broken: resolvergen: -: no matching versions for query "latest" #1283

Closed
utx0 opened this issue Aug 14, 2020 · 7 comments · Fixed by #1294
Closed

Getting Started Broken: resolvergen: -: no matching versions for query "latest" #1283

utx0 opened this issue Aug 14, 2020 · 7 comments · Fixed by #1294

Comments

@utx0
Copy link

utx0 commented Aug 14, 2020

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.

@utx0
Copy link
Author

utx0 commented Aug 14, 2020

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

@utx0
Copy link
Author

utx0 commented Aug 14, 2020

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

@utx0
Copy link
Author

utx0 commented Aug 14, 2020

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

@rkunhi
Copy link

rkunhi commented Aug 15, 2020

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

@jtacoma
Copy link

jtacoma commented Aug 15, 2020

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:

dbbda22 "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

@osdevisnot
Copy link

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

@AnnieTaylorCHEN
Copy link

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

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 a pull request may close this issue.

5 participants