[Bug Report]subscription returns null if query contains certain field
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
### What happened?
```graphql
type Mutation {
post(text: String!): Message!
}
type Subscription {
messageAdded: Message!
}
type Message {
id: ID!
text: String!
testMessage: String!
}
```
``` golang
type Message struct {
ID string `json:"id" gorm:"primary_key:true;type:char(36);column:id"`
Text string `json:"text"`
TestMessage *string `json:"test_message"`
}
```
As schema file shows, post messages will show up in "messageAdded" subscription.
But if subscription queried with `testMessage` field, the result will return `null` as below

And if subscription queried without `testMessage` field, the result seems to be normal

### Minimal graphql.schema and models to reproduce
I made an example project to debug
https://github.com/fredliang44/debug-gqlgen
### versions
- `gqlgen version`?
v0.11.3
- `go version`?
go1.14.1
- dep or go modules?
go mod
Contributor guide
Assessment
This issue has not been assessed yet.