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?
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