We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e06f585 commit 36f8ba8Copy full SHA for 36f8ba8
introspection/introspection.go
@@ -1,7 +1,7 @@
1
package introspection
2
3
import (
4
- "fmt"
+ "encoding/json"
5
"sort"
6
7
"github.com/neelance/graphql-go/internal/common"
@@ -259,7 +259,11 @@ func (r *InputValue) DefaultValue() *string {
259
if r.value.Default == nil {
260
return nil
261
}
262
- s := fmt.Sprint(r.value.Default)
+ b, err := json.Marshal(r.value.Default)
263
+ if err != nil {
264
+ panic("could not marshal default value: " + err.Error())
265
+ }
266
+ s := string(b)
267
return &s
268
269
0 commit comments