Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

gqlgen init or generate command exits 1 on go 1.24.0 #3531

Closed
skaji opened this issue Feb 13, 2025 · 4 comments
Closed

gqlgen init or generate command exits 1 on go 1.24.0 #3531

skaji opened this issue Feb 13, 2025 · 4 comments

Comments

@skaji
Copy link
Contributor

skaji commented Feb 13, 2025

It seems that gqlgen init or generate command exits 1 on go 1.24.0

steps to reproduce

test.sh

#!/bin/bash

set -ex

go version
rm -rf example
mkdir example
cd example
go mod init example
printf '//go:build tools\npackage tools\nimport (_ "github.com/99designs/gqlgen"\n _ "github.com/99designs/gqlgen/graphql/introspection")' | gofmt > tools.go
go mod tidy
go run github.com/99designs/gqlgen init --verbose
go mod tidy
go run server.go
❯ bash test.sh
+ go version
go version go1.24.0 darwin/arm64
+ rm -rf example
+ mkdir example
+ cd example
+ go mod init example
go: creating new go.mod: module example
+ printf '//go:build tools\npackage tools\nimport (_ "github.com/99designs/gqlgen"\n _ "github.com/99designs/gqlgen/graphql/introspection")'
+ gofmt
+ go mod tidy
go: finding module for package github.com/99designs/gqlgen/graphql/introspection
go: finding module for package github.com/99designs/gqlgen
go: found github.com/99designs/gqlgen in github.com/99designs/gqlgen v0.17.64
go: found github.com/99designs/gqlgen/graphql/introspection in github.com/99designs/gqlgen v0.17.64
+ go run github.com/99designs/gqlgen init --verbose
Creating gqlgen.yml
Creating graph/schema.graphqls
Creating server.go
Generating...
exit status 1

environment

  • go 1.24.0
  • gqlgen v0.17.64
  • macOS 15.2, arm64
@skaji skaji changed the title gqlgen init or run command exits 1 on go 1.24.0 gqlgen init or generate command exits 1 on go 1.24.0 Feb 13, 2025
@skaji
Copy link
Contributor Author

skaji commented Feb 13, 2025

It seems that if we upgrade golang.org/x/tools, then gqlgen init will exit successfully:

go version
go version go1.24.0 darwin/arm64git clone https://github.com/99designs/gqlgen
Cloning into 'gqlgen'...
...cd gqlgen

#### fail....go run . init
Creating gqlgen.yml
Creating graph/schema.graphqls
Creating server.go
Generating...
exit status 1

#### cleanupgit clean -xfd
Removing gqlgen.yml
Removing graph/

#### upgrade golang.org/x/toolsgo get -u golang.org/x/tools && go mod tidy
go: upgraded golang.org/x/mod v0.20.0 => v0.23.0
go: upgraded golang.org/x/net v0.33.0 => v0.35.0
go: upgraded golang.org/x/sys v0.29.0 => v0.30.0
go: upgraded golang.org/x/tools v0.24.0 => v0.30.0go run . init
Creating gqlgen.yml
Creating graph/schema.graphqls
Creating server.go
Generating...

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

#### success!echo $?
0

@skaji
Copy link
Contributor Author

skaji commented Feb 13, 2025

This issue should be fixed by #3528

@StevenACoffman
Copy link
Collaborator

Can you please see if #3537 fixes your issue (included in v0.17.65)?

@skaji
Copy link
Contributor Author

skaji commented Feb 15, 2025

@StevenACoffman #3537 fixes this issue. Thank you!

@skaji skaji closed this as completed Feb 15, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants