Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gqlgen not compliant with graphql spec for Int type #3214

Open
roeest opened this issue Aug 9, 2024 · 0 comments
Open

Gqlgen not compliant with graphql spec for Int type #3214

roeest opened this issue Aug 9, 2024 · 0 comments

Comments

@roeest
Copy link
Contributor

roeest commented Aug 9, 2024

What happened?

Gqlgen treats the Int graphql type as a golang 64 bit integer. The graphql spec states that the Int graphql type represents a 32 bit integer. This causes issues with clients that assume the underlying type of an integer is 32 bits either by overflowing them or by making them error out altogether.

What did you expect?

Behavior that matches the graphql spec

  1. Error when specifying an Int input that overflows 32bit integers
  2. Truncate Int results that overflow or even better return an indicative error

Minimal graphql.schema and models to reproduce

Any schema with an Int in an input or a regular type

versions

  • go run github.com/99designs/gqlgen version? v0.17.49
  • go version? go version go1.22.4 darwin/arm64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant