Skip to content

Commit

Permalink
decode http gql response numbers properly
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf committed Sep 20, 2024
1 parent cf52fed commit 2535659
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package client

import (
"bytes"
"context"
"encoding/json"

Expand Down Expand Up @@ -318,8 +319,10 @@ type gqlResult struct {
}

func (res *GQLResult) UnmarshalJSON(data []byte) error {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.UseNumber()
var out gqlResult
if err := json.Unmarshal(data, &out); err != nil {
if err := dec.Decode(&out); err != nil {
return err
}
res.Data = out.Data
Expand Down

0 comments on commit 2535659

Please sign in to comment.