Moved from GitHub dgraph/5459
Posted by Miaourt:
Hi Dgraph team, pretty new to Dgraph so excuse my potential incomprehensions.
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 even
ID, 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.