subql
subql copied to clipboard
add support for null ordering in 'order by' query (#2387)
Description
adds support for null ordering in 'order by' query
Fixes #2387
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
Checklist
- [ ] I have tested locally
- [X] I have performed a self review of my changes
- [ ] Updated any relevant documentation
- [X] Linked to any relevant issues
- [x] I have added tests relevant to my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [X] My code is up to date with the base branch
- [x] I have updated relevant changelogs. We suggest using chan
@stwiname @jiqiang90 hey are the test suites broken (some pass, others fail) ? Was trying to add a test case in packages\query\src\graphql\graphql.test.ts file. Can you help with running the tests (any specific set of commands etc.)
anyways up for a review..
@stwiname @jiqiang90 hey are the test suites broken (some pass, others fail) ? Was trying to add a test case in packages\query\src\graphql\graphql.test.ts file. Can you help with running the tests (any specific set of commands etc.)
@abhishek818 because its an integration test it needs a DB to connect to. You can either run postgres yourself or yarn test:docker but you would probably want to change it to just run that test.
These changes look good but tests are still needed,
Added the tests, Up for review..
test-1 | PASS packages/query/src/graphql/graphql.test.ts (863 MB heap size)
There is a failing test
GraphqlHistorical › to filter historical items when ordering, this is a change in behaviour as if the nulls order is not specified then it should be default.As the Postgres docs say
ASCandDESCchange the default null behaviour. This should be retained if null order isn't specified.
Thanks for pointing this out. Have fixed this. Up for a review now..
I am force pushing the commits everytime to keep it as 1 commit (was not sure due to changelog file changes), let me know if its alright or I can push changes in separate commits.