99designs / 99designs/gqlgen

Option to use json.Number when unmarshalling dynamically typed scalars

Aperta
#2,844 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
10.8k
Fork
1.3k
Merge medio
2g 36m
PR unite (30g)
26

Descrizione

### What happened?
I have an input struct with a scalar field. When using a numerical input value, I got a run-time type of float64.

### What did you expect?
I expected json.Number which does not lose precision. I know that I used to get json.Number with a previous version of `gqlgen`. More importantly, I could not find any option to use to set this behavior.

### Minimal graphql.schema and models to reproduce

```
scalar Any
type MyStruct {
value: Any
}
```

### versions
- `go run github.com/99designs/gqlgen version`: v0.17.36
- `go version`: go version go1.21.1 darwin/arm64

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.