Use sql.NullString & Co. declaring them in gqlgen.yml config file
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
### What happened?
I'm trying to avoid pointers as my structs fields.
But `gqlgen` generates struct like:
```go
type User struct {
ID uint64 `json:"id"`
Nickname string `json:"lastname"`
Img *string `json:"img"`
}
```
with `*string` as you can see.
### What did you expect?
I would like to use something like this in `gqlgen.yml` config file:
```yml
models:
String:
model:
- github.com/99designs/gqlgen/graphql.String
- github.com/99designs/gqlgen/graphql.NullString
# or maybe also:
- database/sql.NullString
```
So to have this instead:
```go
type User struct {
ID uint64 `json:"id"`
Nickname string `json:"lastname"`
Img sql.NullString `json:"img"`
}
```
Contributor guide
Assessment
This issue has not been assessed yet.