hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.1k stars 2.77k forks source link

Postgres bigint problem #9974

Open mrpotato3 opened 11 months ago

mrpotato3 commented 11 months ago

Version Information

Server Version: 2.33.4 CLI Version (for CLI related issue):

Environment

OSS

What is the current behaviour?

Query for "bigint" column with large number like "9223372036854775222" and gets "9223372036854775000".

What is the expected behaviour?

Query bigint column and get correct value.

How to reproduce the issue?

  1. Create bigint column
  2. Insert big number like "9223372036854775222".
  3. Query this column.
cpouldev commented 11 months ago

Check this https://hasura.io/docs/latest/schema/common-patterns/numeric-types/

This is not a bug but a limitation from js. To overcome this you can either return stringified numeric types or use the json-bigint package