GraphQL : Support for BigInt / 64 bits integer #5459
Labels
area/graphql
Issues related to GraphQL support on Dgraph.
kind/feature
Something completely new we should consider.
Hi Dgraph team, pretty new to Dgraph so excuse my potential incomprehensions.
Experience Report
I had a discussion with @pawanrawal on Slack over a efficient way to support 64 bits integer via the GraphQL endpoint, which isn't standard since the only "Int" type supported is 32 bits.
Storing it as a string would have been an option but I need to be able to index with this integer, and do simple operations like ascending / descending sorting or value comparisons, which is something impossible with a string.
What you wanted to do
As you did with
DateTime
or evenID
, storing a "custom type" could be done too, by returning an hex-coded string representing the 64 bits value as suggested Pawan, and still allow us to store the value efficiently and do database operations on it.Using Javascript's standard way of returning BigInt could be done too, by suffixing the value with
n
Any external references to support your case
https://caniuse.com/#feat=bigint
https://v8.dev/features/bigint
The text was updated successfully, but these errors were encountered: