99designs / gqlgen

go generate based graphql server library

Home Page:https://gqlgen.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to use json.Number when unmarshalling dynamically typed scalars

akeustis opened this issue · comments

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