Skip to content

Commit

Permalink
fix introspection of default value
Browse files Browse the repository at this point in the history
Fixes #65
  • Loading branch information
neelance committed Mar 14, 2017
1 parent e06f585 commit 36f8ba8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions introspection/introspection.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package introspection

import (
"fmt"
"encoding/json"
"sort"

"github.com/neelance/graphql-go/internal/common"
Expand Down Expand Up @@ -259,7 +259,11 @@ func (r *InputValue) DefaultValue() *string {
if r.value.Default == nil {
return nil
}
s := fmt.Sprint(r.value.Default)
b, err := json.Marshal(r.value.Default)
if err != nil {
panic("could not marshal default value: " + err.Error())
}
s := string(b)
return &s
}

Expand Down

0 comments on commit 36f8ba8

Please sign in to comment.