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

GraphQL : Support for BigInt / 64 bits integer #5459

Closed
Miaourt opened this issue May 18, 2020 · 2 comments
Closed

GraphQL : Support for BigInt / 64 bits integer #5459

Miaourt opened this issue May 18, 2020 · 2 comments
Labels
area/graphql Issues related to GraphQL support on Dgraph. kind/feature Something completely new we should consider.

Comments

@Miaourt
Copy link

Miaourt commented May 18, 2020

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 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.

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

@lgalatin lgalatin added the area/graphql Issues related to GraphQL support on Dgraph. label May 26, 2020
@pawanrawal
Copy link
Contributor

Thanks. We have added this into our internal discussions. I'll repost here when we pick it up and start further scoping of this feature.

@pawanrawal pawanrawal added the kind/feature Something completely new we should consider. label May 27, 2020
@minhaj-shakeel
Copy link
Contributor

Github issues have been deprecated.
This issue has been moved to discuss. You can follow the conversation there and also subscribe to updates by changing your notification preferences.

drawing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph. kind/feature Something completely new we should consider.
Development

No branches or pull requests

4 participants