Change blockchain IDs types from string to number #120
ipapandinas
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description of what the problem is
Currently all blockchain IDs are recorded as string inside the database.
This design was driven by the forked concepts from the subquery project.
However this leads to an unwanted side effet when sorting with
orderBy
.For example if you want to sort NFT by ascendant nftId you will face this bad behaviour:
Why there is no a simple solution?
Since
MAX_SAFE_INTEGER= 9007199254740991
, common javascript numbers could be used instead strings.However this change inside the GraphQL shema conducts to an inconstancy on nested entities (e.g.
collection: CollectionEntity
insideNftEntity
).In fact, database item ID
collectionId
conflicts withcollectionId
item from blockchain data.We end up with inconsistencies of this kind depending on the entity used 👇
Submitted query on nftEntities
Submitted query on collectionEntities
As you can
collectionId
is an string innftEntities
but a number incollectionEntities
. We want to avoid this inconsistency.Beta Was this translation helpful? Give feedback.
All reactions