Subscription use channel of pointer of model, may cause thread-unsafe issue?
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
### What happened?
The generated subscription, like
```go
func (r *subscriptionResolver) StatusUpdated(ctx context.Context, udid string) (<-chan *model.Status, error) {
...
}
```
using type of channel of <- chan *model.Status,
when passing pointer of model.Status to multiple goroutine, I think it may cause thread-unsafe problem.
### What did you expect?
`<-chan *model.Status` to `<- chan model.Status`
```go
func (r *subscriptionResolver) StatusUpdated(ctx context.Context, id string) (<-chan model.Status, error) {
...
}
```
### Minimal graphql.schema and models to reproduce
```
type Subscription {
statusUpdated(id: String!) : Status!
}
```
### versions
- `gqlgen version`?
v0.11.3-dev
- `go version`?
go version go1.14.3 linux/amd64
- dep or go modules?
go modules
Contributor guide
Assessment
This issue has not been assessed yet.