Repository navigation
feat(relay)!: make pagination ORM-independent - #2202
Merged
Merged
Conversation
Move database access into the page loader and use the built-in SQLite module in the example. BREAKING CHANGE: Pass connection arguments and a page loader to findAndPaginate. The example and workspace require Node.js 22.13 or newer.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Code Metrics Report
Details | | main (8d0b896) | #2202 (a5e015d) | +/- |
|---------------------|----------------|-----------------|-------|
+ | Coverage | 96.6% | 97.0% | +0.3% |
| Files | 22 | 22 | 0 |
| Lines | 603 | 600 | -3 |
- | Covered | 583 | 582 | -1 |
- | Test Execution Time | 1s | 2s | +1s |Code coverage of files in pull request scope (97.8% → 100.0%, patch 100.0%)
Reported by octocov |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nestjs-graphql-relaypagination ORM-independent. The page loader receives an offset and limit and returns the page rows and total match count.node:sqliteand remove TypeORM, the SQLite npm add-on, and the test-time rebuild step.Breaking change and migration
findAndPaginate(condition, args, repository)becomesfindAndPaginate(args, loadPage). TypeORM applications can move their existingfindAndCountcall into the loader and declare their ORM dependencies directly. The package README includes a migration example.This change targets the next major release. The scheduled version bump is minor, so the release needs to use the manual major bump. The workspace and example now require Node.js 22.13 or later.
Addresses #2201 by removing the TypeORM dependency.
Validation
日本語
nestjs-graphql-relayは、ページの行と総件数を取得する関数を受け取り、Relay connection を組み立てます。旧 API の利用者はリポジトリのクエリをその関数へ移してください。README に TypeORM からの移行例があります。サンプルは
node:sqliteへ移行し、既存形式の DB ファイルを引き続き読み込みます。開発とサンプルの最低対応版は Node.js 22.13 です。公開 API の変更は次のメジャーリリース向けです。Node.js 26 でビルド、型チェック、全 29 テスト、Node.js 22.13.0 で関連 6 テストが通過しました。ORM を含まない環境で npm パッケージからの動作も確認しました。