99designs / 99designs/gqlgen

Segfault: return root query

未关闭
#2,290 5 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
10.8k
派生
1.3k
平均合并
2 天 36 分钟
30 天内合并 PR
26

描述

### What happened?
[signal SIGSEGV: segmentation violation

### What did you expect?
Everything goes fine

Returning the root Query should work.

### Minimal graphql.schema and models to reproduce
```
type Query {
test: Query
}
```
### versions
- `go run github.com/99designs/gqlgen version`? => v0.17.12
- `go version`? go1.18.3

### Stacktrace
```
go run github.com/99designs/gqlgen --config qqlgen.yml

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1335dbb]

goroutine 1 [running]:
github.com/99designs/gqlgen/codegen/config.(*TypeReference).IsPtr(...)
/Users/aubin/go/pkg/mod/github.com/99designs/gqlgen@v0.17.12/codegen/config/binder.go:214
github.com/99designs/gqlgen/codegen.(*builder).buildField(0xc039db9828, 0xc025971880, 0xc0001ffc00)
/Users/aubin/go/pkg/mod/github.com/99designs/gqlgen@v0.17.12/codegen/field.go:76 +0x49b
github.com/99designs/gqlgen/codegen.(*builder).buildObject(0xc039db9828, 0xc00051c480)
/Users/aubin/go/pkg/mod/github.com/99designs/gqlgen@v0.17.12/codegen/object.go:75 +0x585
github.com/99designs/gqlgen/codegen.BuildData(0xc0001c2820)
/Users/aubin/go/pkg/mod/github.com/99designs/gqlgen@v0.17.12/codegen/data.go:113 +0x34b
github.com/99designs/gqlgen/api.Generate(0xc0001c2820, {0x0, 0x0, 0x100eac7?})
/Users/aubin/go/pkg/mod/github.com/99designs/gqlgen@v0.17.12/api/generate.go:86 +0x429
main.glob..func2(0xc00013ae00?)
/Users/aubin/go/pkg/mod/github.com/99designs/gqlgen@v0.17.12/main.go:146 +0xa5
github.com/urfave/cli/v2.(*App).RunContext(0xc00018c700, {0x1591198?, 0xc000134428}, {0xc00011c180, 0x3, 0x3})
/Users/aubin/go/pkg/mod/github.com/urfave/cli/v2@v2.11.0/app.go:386 +0xe9f
github.com/urfave/cli/v2.(*App).Run(...)
/Users/aubin/go/pkg/mod/github.com/urfave/cli/v2@v2.11.0/app.go:251
main.main()
/Users/aubin/go/pkg/mod/github.com/99designs/gqlgen@v0.17.12/main.go:186 +0x249
exit status 2
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。