kodadot / stick

GraphQL service for Uniques and Assets on Asset Hubs
MIT License
4 stars 10 forks source link

collectionEntity orderby Id_desc #95

Open roiLeo opened 1 year ago

roiLeo commented 1 year ago

Describe the bug Order By id desc has a weird behavior on collectionEntity

To Reproduce

Expected behavior 107 > 101 > 97

Screenshots

Capture d’écran 2023-08-31 à 10 02 10 AM

Additional context I like sports

vikiival commented 1 year ago

I think it's the behaviour of psql we can do a resolver for that and map ids as numbers

roiLeo commented 1 year ago

I think it's the behaviour of psql we can do a resolver for that and map ids as numbers

Nah.. IMO it's because id are string instead of numbers, could be doable if we cast this column or change type to integer

vikiival commented 1 year ago

So it would mean that bsx and ah* will have numbers where rmrk and evm string?

roiLeo commented 1 year ago

So it would mean that bsx and ah* will have numbers where rmrk and evm string?

Oh... nvm, I've forgot we were talking about collectionId.

That doesn't mean we can't type id to integer only for bsx & ah*, best would be to have same type as the one declared in pallet.

roiLeo commented 1 year ago

I just thought we could solve this problem by sorting by block number, and we'll get the expected result.

vikiival commented 1 year ago

and guess since blockNumber is bigint it behaves like string in sortig?