-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphql): add optional cursor pagination to GraphQL backend serv…
…ice (#1153) * feat: GraphQL add cursor pagination --------- Co-authored-by: Ronald Van Ryswyk <ronald.van.ryswyk@positivecircularity.com>
- Loading branch information
1 parent
bd132c5
commit 29579b2
Showing
14 changed files
with
706 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/common/src/interfaces/cursorPageInfo.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface CursorPageInfo { | ||
/** Do we have a next page from current cursor position? */ | ||
hasNextPage: boolean; | ||
|
||
/** Do we have a previous page from current cursor position? */ | ||
hasPreviousPage: boolean; | ||
|
||
/** What is the last cursor? */ | ||
endCursor: string; | ||
|
||
/** What is the first cursor? */ | ||
startCursor: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/common/src/interfaces/paginationCursorChangedArgs.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { PaginationChangedArgs } from './paginationChangedArgs.interface'; | ||
|
||
export interface PaginationCursorChangedArgs extends PaginationChangedArgs { | ||
/** Start our page After cursor X */ | ||
after?: string; | ||
|
||
/** Start our page Before cursor X */ | ||
before?: string; | ||
|
||
/** Get first X number of objects */ | ||
first?: number; | ||
|
||
/** Get last X number of objects */ | ||
last?: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.