Open
Description
Test case:
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/graphql-go/graphql"
)
type Value string
func main() {
s, err := graphql.NewSchema(graphql.SchemaConfig{
Query: graphql.NewObject(graphql.ObjectConfig{
Name: "RootQuery",
Fields: graphql.Fields{
"value": &graphql.Field{
Type: graphql.String,
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
v := Value("hello")
return &v, nil
},
},
},
}),
})
if err != nil {
log.Fatal(err)
}
result := graphql.Do(graphql.Params{
Schema: s,
RequestString: "query MyQuery { value } ",
Context: context.TODO(),
})
fmt.Printf("%#v\n", result.Data)
}
This prints
map[string]interface {}{"value":"0xc00000f500"}
instead of the expected:
map[string]interface {}{"value":"hello"}
Annoyingly, there's no way to work around this by implementing MarshalJSON
on Value
, since it seems graphql-go doesn't use it.
I'll see if I can create a PR.
Related to #199.
Metadata
Metadata
Assignees
Labels
No labels