Skip to content

Commit

Permalink
⚡ asc nulls last in order by (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival authored and eldargab committed May 1, 2024
1 parent dc48545 commit 3dab2c4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@subsquid/graphql-server",
"comment": "add ASC_NULLS_LAST and DESC_NULLS_FIRST for graphql sorting",
"type": "minor"
}
],
"packageName": "@subsquid/graphql-server"
}
10 changes: 10 additions & 0 deletions common/changes/@subsquid/openreader/patch-1_2024-04-26-11-29.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@subsquid/openreader",
"comment": "add ASC_NULLS_LAST and DESC_NULLS_FIRST for graphql sorting",
"type": "minor"
}
],
"packageName": "@subsquid/openreader"
}
10 changes: 0 additions & 10 deletions common/changes/@subsquid/ss58-codec/master_2024-04-09-00-25.json

This file was deleted.

2 changes: 1 addition & 1 deletion graphql/openreader/src/ir/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ export interface OrderBy {
}


export type SortOrder = 'ASC' | 'DESC' | 'ASC NULLS FIRST' | 'DESC NULLS LAST'
export type SortOrder = 'ASC' | 'DESC' | 'ASC NULLS FIRST' | 'ASC NULLS LAST' | 'DESC NULLS FIRST' | 'DESC NULLS LAST'
3 changes: 2 additions & 1 deletion graphql/openreader/src/opencrud/orderBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ function buildOrderByMapping(model: Model, typeName: string, depth: number): Ope
m.set(key + '_ASC', { [key]: 'ASC' })
m.set(key + '_DESC', { [key]: 'DESC' })
m.set(key + '_ASC_NULLS_FIRST', { [key]: 'ASC NULLS FIRST' });
m.set(key + '_ASC_NULLS_LAST', { [key]: 'ASC NULLS LAST' });
m.set(key + '_DESC_NULLS_FIRST', { [key]: 'DESC NULLS FIRST' });
m.set(key + '_DESC_NULLS_LAST', { [key]: 'DESC NULLS LAST' });

}
break
case 'object':
Expand Down

0 comments on commit 3dab2c4

Please sign in to comment.