99designs / 99designs/gqlgen

Autobind broken with go 1.20+

未關閉
#2,579 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
10.8k
分支
1.3k
平均合併
2 天 36 分鐘
30 天內合併 PR
26

描述

### What happened?

Creating a new project skeleton and re-generating it works.

```
$ go run github.com/99designs/gqlgen init
Creating gqlgen.yml
Creating graph/schema.graphqls
Creating server.go
Generating...

Exec "go run ./server.go" to start GraphQL server
$ go run github.com/99designs/gqlgen generate
```

The default autobind configuration is:
```
# gqlgen will search for any type names in the schema in these go packages
# if they match it will use them, otherwise it will generate them.
autobind:
# - "test/graph/model"
```

If autobind is uncommented like:

```
# gqlgen will search for any type names in the schema in these go packages
# if they match it will use them, otherwise it will generate them.
autobind:
- "test/graph/model"
```

Re-generating now fails.

```
$ go run github.com/99designs/gqlgen generate
generating core failed: unable to load test/graph/model - make sure you're using an import path to a package that exists
exit status 1
```

This works with Go 1.19.5.

### What did you expect?

The same behavior with Go 1.19.5 and Go 1.20.2.

### versions
- `go run github.com/99designs/gqlgen version`
`v0.17.26`
- `go version`
`go version go1.20.2 linux/amd64`

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。