Skip to content

Commit d9369ff

Browse files
authored
feat: Bump dependencies (#401)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Chores - Upgraded many dependencies across framework, ORM/ODM, GraphQL, linting, and build/tooling; added/synchronized dev tools for compatibility and stability. - Features / Behavior - Refined "fetch all with negative limit" paging: when limit = -1 and offset = 0, both limit and offset are omitted to enable full-fetch behavior. - Tests - Made test cleanup more explicit and added conditional DB-specific test suites for Postgres/MySQL. - Documentation - Minor comment punctuation and wording refinements. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 28f4950 + 9fc783f commit d9369ff

File tree

7 files changed

+4659
-2656
lines changed

7 files changed

+4659
-2656
lines changed

examples/fetch-all-with-negative/e2e/todo-offset-fetch-all-enable.resolver.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ describe('TodoItemResolver (offset pagination - fetch all with negative enabled)
6363

6464
expect(nodes).toEqual(todoItems)
6565
}))
66+
6667
describeIf(process.env.NESTJS_QUERY_DB_TYPE == 'postgres')('postgres', () => {
6768
it('should return all the nodes after the given offset', () =>
6869
request(app.getHttpServer())
@@ -90,6 +91,7 @@ describe('TodoItemResolver (offset pagination - fetch all with negative enabled)
9091
expect(nodes).toEqual(todoItems.slice(2))
9192
}))
9293
})
94+
9395
describeIf(process.env.NESTJS_QUERY_DB_TYPE == 'mysql')('mysql', () => {
9496
it('should return an error when fetching all the nodes after the given offset', () =>
9597
request(app.getHttpServer())

package.json

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,48 @@
1515
"@apollo/subgraph": "2.2.3"
1616
},
1717
"dependencies": {
18-
"@m8a/nestjs-typegoose": "12.0.0",
19-
"@nestjs/common": "11.0.16",
20-
"@nestjs/core": "11.0.9",
21-
"@nestjs/graphql": "^13.0.2",
18+
"@m8a/nestjs-typegoose": "12.0.1",
19+
"@nestjs/common": "11.1.6",
20+
"@nestjs/core": "11.1.6",
21+
"@nestjs/graphql": "^13.2.0",
2222
"@nestjs/jwt": "11.0.0",
23-
"@nestjs/mongoose": "11.0.1",
23+
"@nestjs/mongoose": "11.0.3",
2424
"@nestjs/passport": "11.0.5",
25-
"@nestjs/platform-express": "11.0.9",
25+
"@nestjs/platform-express": "11.1.6",
2626
"@nestjs/sequelize": "11.0.0",
2727
"@nestjs/typeorm": "^11.0.0",
2828
"class-validator": "0.14.1",
29-
"mongoose": "^8.10.0",
29+
"mongoose": "8.10.1",
3030
"reflect-metadata": "^0.2.2",
31-
"sequelize": "6.37.5",
31+
"sequelize": "6.37.7",
3232
"sequelize-typescript": "2.1.6",
3333
"tslib": "^2.8.1",
34-
"typeorm": "0.3.17"
34+
"typeorm": "0.3.27"
3535
},
3636
"devDependencies": {
3737
"@actions/core": "^1.11.1",
3838
"@apollo/federation": "0.38.1",
39-
"@apollo/gateway": "2.10.1",
39+
"@apollo/gateway": "2.11.2",
4040
"@apollo/server": "^4.11.3",
41-
"@apollo/subgraph": "2.9.3",
41+
"@apollo/subgraph": "2.11.2",
42+
"@as-integrations/express5": "^1.1.2",
4243
"@commitlint/cli": "19.7.1",
4344
"@commitlint/config-conventional": "^19.7.1",
44-
"@docusaurus/core": "3.5.2",
45-
"@docusaurus/module-type-aliases": "3.5.2",
46-
"@docusaurus/preset-classic": "3.5.2",
47-
"@jscutlery/semver": "5.6.0",
48-
"@nestjs/apollo": "^13.0.2",
49-
"@nestjs/cli": "11.0.2",
50-
"@nestjs/schematics": "11.0.0",
51-
"@nestjs/testing": "^11.0.9",
45+
"@docusaurus/core": "3.9.1",
46+
"@docusaurus/module-type-aliases": "3.9.1",
47+
"@docusaurus/preset-classic": "3.9.1",
48+
"@jscutlery/semver": "5.7.1",
49+
"@nestjs/apollo": "^13.2.1",
50+
"@nestjs/cli": "11.0.10",
51+
"@nestjs/schematics": "11.0.8",
52+
"@nestjs/testing": "^11.1.6",
5253
"@nx-extend/docusaurus": "^2.0.1",
5354
"@nx/eslint": "19.6.1",
5455
"@nx/eslint-plugin": "19.6.1",
5556
"@nx/jest": "19.6.1",
5657
"@nx/js": "19.6.1",
5758
"@nx/node": "19.6.1",
58-
"@typegoose/typegoose": "^12.11.0",
59+
"@typegoose/typegoose": "12.11.0",
5960
"@types/express": "4.17.21",
6061
"@types/jest": "29.5.14",
6162
"@types/lodash.escaperegexp": "4.1.9",
@@ -67,9 +68,9 @@
6768
"@types/passport-jwt": "4.0.1",
6869
"@types/passport-local": "1.0.38",
6970
"@types/pluralize": "0.0.33",
70-
"@types/supertest": "6.0.2",
71+
"@types/supertest": "6.0.3",
7172
"@types/uuid": "9.0.8",
72-
"@types/ws": "8.5.14",
73+
"@types/ws": "8.18.1",
7374
"@typescript-eslint/eslint-plugin": "7.18.0",
7475
"@typescript-eslint/parser": "7.18.0",
7576
"class-transformer": "0.5.1",
@@ -81,39 +82,39 @@
8182
"eslint-config-airbnb-typescript": "18.0.0",
8283
"eslint-config-prettier": "9.1.0",
8384
"eslint-import-resolver-typescript": "3.7.0",
84-
"eslint-plugin-import": "2.31.0",
85+
"eslint-plugin-import": "2.32.0",
8586
"eslint-plugin-jest": "28.11.0",
86-
"eslint-plugin-prettier": "5.2.3",
87+
"eslint-plugin-prettier": "5.5.4",
8788
"eslint-plugin-simple-import-sort": "^12.1.1",
8889
"eslint-plugin-tsdoc": "0.2.17",
89-
"graphql": "16.10.0",
90-
"graphql-query-complexity": "1.0.0",
90+
"graphql": "16.11.0",
91+
"graphql-query-complexity": "1.1.0",
9192
"graphql-subscriptions": "^3.0.0",
92-
"graphql-tools": "9.0.13",
93+
"graphql-tools": "9.0.20",
9394
"husky": "9.1.7",
9495
"jest": "29.7.0",
9596
"jest-extended": "4.0.2",
9697
"mongodb-memory-server": "9.3.0",
97-
"mysql2": "3.12.0",
98+
"mysql2": "3.15.1",
9899
"nx": "19.6.1",
99100
"passport": "0.7.0",
100101
"passport-jwt": "4.0.1",
101102
"passport-local": "1.0.0",
102-
"pg": "8.13.3",
103-
"prettier": "3.5.0",
103+
"pg": "8.16.3",
104+
"prettier": "3.6.2",
104105
"react": "^18.3.1",
105106
"react-dom": "^18.3.1",
106-
"sql-formatter": "^15.4.10",
107+
"sql-formatter": "^15.6.10",
107108
"sqlite3": "^5.1.7",
108-
"supertest": "7.0.0",
109-
"ts-jest": "29.2.5",
110-
"ts-loader": "9.5.2",
109+
"supertest": "7.1.4",
110+
"ts-jest": "29.4.4",
111+
"ts-loader": "9.5.4",
111112
"ts-mockito": "2.6.1",
112113
"ts-morph": "^22.0.0",
113114
"ts-node": "10.9.2",
114115
"tsconfig-extends": "1.0.1",
115116
"tsconfig-paths": "4.2.0",
116-
"typescript": "^5.7.3"
117+
"typescript": "^5.9.3"
117118
},
118119
"packageManager": "yarn@4.4.0"
119120
}

packages/query-graphql/__tests__/integration/federation-n1/fixtures/test-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { TodoList } from '../entities/todo-list.entity'
66

77
export const createTestData = async (dataSource: DataSource) => {
88
// Clear existing data
9-
await dataSource.getRepository(TodoItem).delete({})
10-
await dataSource.getRepository(TodoList).delete({})
9+
await dataSource.getRepository(TodoItem).deleteAll()
10+
await dataSource.getRepository(TodoList).deleteAll()
1111

1212
// Create 5 TodoLists (matching your demo scenario)
1313
const todoLists: TodoList[] = []

packages/query-graphql/src/types/connection/cursor/pager/strategies/limit-offset.pager-strategy.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,26 @@ export class LimitOffsetPagerStrategy<DTO> implements PagerStrategy<DTO> {
3030
if (includeExtraNode && (!this.enableFetchAllWithNegative || opts.limit !== -1)) {
3131
// Add 1 to the limit so we will fetch an additional node
3232
paging.limit += 1
33-
// if paging backwards remove one from the offset to check for a previous page.
33+
// if paging backwards, remove one from the offset to check for a previous page.
3434
if (isBackward) {
3535
paging.offset -= 1
3636
}
3737
if (paging.offset < 0) {
38-
// if the offset is < 0 it means we underflowed and that we cant have an extra page.
38+
// if the offset is < 0, it means we underflow and that we can't have an extra page.
3939
paging.offset = 0
4040
paging.limit = opts.limit
4141
}
4242
}
43-
if (this.enableFetchAllWithNegative && paging.limit === -1) delete paging.limit
43+
44+
if (this.enableFetchAllWithNegative && paging.limit === -1) {
45+
delete paging.limit
46+
47+
// Delete the offset if it is 0.
48+
if (paging.offset === 0) {
49+
delete paging.offset
50+
}
51+
}
52+
4453
return { ...query, paging }
4554
}
4655

packages/query-graphql/src/types/connection/offset/pager/pager.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,16 @@ export class OffsetPager<DTO> implements Pager<DTO, OffsetPagerResult<DTO>> {
6969
private createQuery<Q extends OffsetQueryArgsType<DTO>>(query: Q, pagingMeta: OffsetPagingMeta<DTO>): Q {
7070
const { limit, offset } = pagingMeta.opts
7171
const paging = { limit: limit + 1, offset }
72-
if (this.enableFetchAllWithNegative && limit === -1) delete paging.limit
72+
73+
if (this.enableFetchAllWithNegative && limit === -1) {
74+
delete paging.limit
75+
76+
// Delete the offset if it is 0.
77+
if (offset === 0) {
78+
delete paging.offset
79+
}
80+
}
81+
7382
return { ...query, paging }
7483
}
7584

packages/query-typeorm/src/services/typeorm-query.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ export class TypeOrmQueryService<Entity>
254254
this.ensureIdIsNotPresent(update)
255255
let updateResult: UpdateResult
256256

257-
// If the update has relations then fetch all the id's and then do an update on the ids returned
257+
// If the update has relations, then fetch all the id's and then do an update on the ids returned
258258
if (this.filterQueryBuilder.filterHasRelations(filter)) {
259259
const builder = this.filterQueryBuilder.select({ filter }).distinct(true)
260260

261-
const distinctRecords = await builder.addSelect(`${builder.alias}.id`).getRawMany()
261+
const distinctRecords = await builder.select(`${builder.alias}.id AS id`).getRawMany()
262262

263263
const ids: unknown[] = distinctRecords.map(({ id }) => id as unknown)
264264
const idsFilter = { id: { in: ids } } as unknown as Filter<Entity>

0 commit comments

Comments
 (0)