Comments (6)
While it's theoretically possible to modify the Hasura console such that large numbers are propagated unchanged, doing so would not eliminate surprising behaviour because any producer or consumer of the JSON would be entitled to truncate numeric JSON columns.
The recommendation in RFC 8259 on good interoperability is to expect no more precision or range than double precision IEEE754.
For wide numeric types at database column level, Hasura provides the stringify-numeric-types option. Of course, this option does not exist within JSONB columns because Hasura has no way to infer a schema from arbitrary JSON.
We would recommend that you change the format of your provided JSON to use a string representation of the large number. This will ensure that your representation of numeric data will be properly portable, respected by all potential producers and consumers.
from graphql-engine.
Hey I am OP here thanks for filing.
I have used golang/pgx to insert my data. In golang this field was a uint64.
from graphql-engine.
Hey folks, thanks for reporting. The underlying issue here is that most json implementations implement numbers as IEE-754, and as such big integers that go beyond the supported range can be truncated at various occasions, such as browsers parsing json:
Screencast.from.2024-02-14.16-54-16.webm
Specifically what's going on here is that the browser encodes and decodes these big int values outside of graphql engine.
from graphql-engine.
So what are issues that can be used to solve this? Would it be possible to have an option in engine to transform jsonb so that numbers are converted as strings?
from graphql-engine.
Would it be possible to have this fixed in cloud.hasura graphiql?
from graphql-engine.
I got such mixed results with my experiments. Manual insertion via Dbeaver worked fine, insertion via a mutation worked fine, it was only when I used the data tab to insert the row that this happened. @bjartek is using a data structure that should be able to handle that many digits, but something, somewhere is getting lost in the sauce.
from graphql-engine.
Related Issues (20)
- Duplicate naming in generation of API fields (Relationships + root) HOT 5
- 🚀 Join us for Hasura Dev Day 🚀
- Include Functionality for Hashicorp Vault
- console performance HOT 7
- server: failing web hook cache making requests timeout
- Need to see complete GraphQL query in the OTEL trace logs HOT 2
- Improved Info Security Practices
- Support addition of another graphql endpoint to DDN subgraph (remote schema) HOT 1
- Improved Documentation for Snowflake
- Include SQL query in span tags for PostgreSQL Connector
- Support for conditional logic during the emission of event triggers
- Hasura action return type defined as string, but returning an object
- Passwordless authentication using IAM authentication to RDS for self-hosted / hybrid hasura plans
- Inconsistency between "Dynamic" routing and "static" graphQL types
- Support for GROUP BY/HAVING
- Version Control to avoid Database conflicts
- Improving access control: granting specific permissions to functions in databases
- Hasura Admin UI can be very slow when run inside minikube / Kubernetes
- Native query and logical model added using the hasura console (graphql) is not added to metata on disk HOT 1
- setting "hasura.tracecontext" is not allowed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-engine.