graphql-go / graphql-go/graphql
Add pointer support to resolve struct
Open
- Dominant language
- Go
- Stars
- 10.1k
- Forks
- 845
- PR merge metrics
- No merged PRs in 30d
Description
Hi, what about pointers in struct, which resolves:
`type Todo struct {`
`Text *string 'json:"text"'`
`}`
`Resolve: func(params graphql.ResolveParams) (interface{}, error) {`
`var text = "text1"`
`return Todo{Text:&text}`
`}`
Now, graphql returns "pointer as string", because the serialize function looks:
`fmt.Sprintf("%v", value)`
I think, it is not the right way, what about this fix?
https://github.com/graphql-go/graphql/commit/d3df014b0d6417430740da6e4fd5b75cfa862ffe
Contributor guide
Assessment
This issue has not been assessed yet.