7258722754
## What Upgrades the NestJS GraphQL stack to clear the High **`ws`** alert (GHSA-3h5v-q93c-6h6q) and modernize off two heavily-patched majors. `@nestjs/graphql@13` pulls `ws@8.20.1` (was 8.16.0). This had to be a **coordinated** upgrade: `@ptc-org/nestjs-query@4.2.0` doesn't support `@nestjs/graphql@13`, so all three move together. | Package | From → To | |---|---| | `@nestjs/config` | 3.3.0 → ^4.0.4 | | `@nestjs/graphql` | 12.1.1 → ^13.4.2 | | `@ptc-org/nestjs-query-{core,graphql,typeorm}` | 4.x → ^9.4.0 | ## The tricky bits - **Re-ported the custom `@nestjs/graphql` patch onto v13.** v13 rewrote the schema builder and added its *own* native multi-schema support (`includeModules`, native `clear()`). Twenty's patch (`resolverSchemaScope` + `computeReachableTypes` — the core/metadata/admin split) is re-merged into v13's new `generate(options, includeModules, reachableTypes)` flow, with a link-preserving `storage.clear()` so cross-schema `resolveType` closures keep working. - **Re-ported the `@ptc-org` patch onto 9.4.0**: removes the `@shareable` federation directive from built-in connection/response types, **and** adds a `.js` extension to its extensionless deep import of `@nestjs/graphql` internals — which v13's new `"exports"` map otherwise rejects at runtime (this was the boot blocker). - **`AppTokenService`**: nestjs-query 9 requires custom services to inject their repo and `super(repo)` it (added an `@InjectRepository` constructor). - **`gridPosition` input fields**: dropped the `deprecationReason` (a *required* input field can't be `@deprecated` under the upgraded graphql) — fields keep their original nullability, so the **schema is unchanged**. - **Service specs**: nestjs-query 9's `TypeOrmQueryService` reads the repo's driver/metadata at construction, so the mocked repos now include `manager`/`metadata`. ## Verification - `nx typecheck twenty-server`: **0 errors**; lint clean - Server boots; **all 3 GraphQL schemas** (`/graphql`, `/metadata`, `/admin-panel`) generate and respond `200` - `graphql:generate` for all 3 schemas is **byte-identical** to before the upgrade (the reachable-types re-port is faithful) - **108 service unit tests pass** (incl. all 6 `TypeOrmQueryService` services) - `ws@8.16.0` gone (now 8.17.1 + 8.18.0); `yarn install --immutable` clean ## Note on lodash `lodash@4.17.21` still remains via `zapier-platform-core` (runtime) and `@stoplight/spectral`, so the lodash alert is **reduced but not fully cleared** by this PR — it needs those separate sources addressed (or a resolution).
74 lines
4.4 KiB
Diff
74 lines
4.4 KiB
Diff
diff --git a/src/common/external.utils.js b/src/common/external.utils.js
|
|
index 1b4ee1bae8436551447e3b03c9f749f172962539..d00a94b0ce38c13cb09423c1dc72c9101b02cba1 100644
|
|
--- a/src/common/external.utils.js
|
|
+++ b/src/common/external.utils.js
|
|
@@ -5,7 +5,7 @@ exports.getGraphqlObjectMetadata = getGraphqlObjectMetadata;
|
|
exports.getGraphqlObjectName = getGraphqlObjectName;
|
|
exports.getGraphqlEnumMetadata = getGraphqlEnumMetadata;
|
|
const graphql_1 = require("@nestjs/graphql");
|
|
-const lazy_metadata_storage_1 = require("@nestjs/graphql/dist/schema-builder/storages/lazy-metadata.storage");
|
|
+const lazy_metadata_storage_1 = require("@nestjs/graphql/dist/schema-builder/storages/lazy-metadata.storage.js");
|
|
const type_errors_1 = require("../types/type.errors");
|
|
/**
|
|
* @internal
|
|
diff --git a/src/types/connection/cursor/page-info.type.js b/src/types/connection/cursor/page-info.type.js
|
|
index 00d836d0b67fba6daae736e4e99d5af2903d1258..c73dd1304611b61f938b75c01f18dbb1edd9ecb4 100644
|
|
--- a/src/types/connection/cursor/page-info.type.js
|
|
+++ b/src/types/connection/cursor/page-info.type.js
|
|
@@ -39,7 +39,6 @@ const getOrCreatePageInfoType = () => {
|
|
tslib_1.__metadata("design:type", String)
|
|
], PageInfoTypeImpl.prototype, "endCursor", void 0);
|
|
PageInfoTypeImpl = tslib_1.__decorate([
|
|
- (0, graphql_1.Directive)('@shareable'),
|
|
(0, graphql_1.ObjectType)('PageInfo'),
|
|
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean, String, String])
|
|
], PageInfoTypeImpl);
|
|
diff --git a/src/types/connection/offset/offset-connection.type.js b/src/types/connection/offset/offset-connection.type.js
|
|
index e89e5ab573572325aaad024827193e7d06f4e5ba..2878acae20c1367622530c4ea96a76062a84cada 100644
|
|
--- a/src/types/connection/offset/offset-connection.type.js
|
|
+++ b/src/types/connection/offset/offset-connection.type.js
|
|
@@ -64,7 +64,6 @@ function getOrCreateOffsetConnectionType(TItemClass, opts) {
|
|
tslib_1.__metadata("design:paramtypes", [])
|
|
], AbstractConnection.prototype, "totalCount", null);
|
|
AbstractConnection = AbstractConnection_1 = tslib_1.__decorate([
|
|
- (0, graphql_1.Directive)('@shareable'),
|
|
(0, graphql_1.ObjectType)(connectionName),
|
|
tslib_1.__metadata("design:paramtypes", [Object, Array, Function])
|
|
], AbstractConnection);
|
|
diff --git a/src/types/connection/offset/offset-page-info.type.js b/src/types/connection/offset/offset-page-info.type.js
|
|
index 480330653efc3def8423adbc95d1009d02aa9778..ea55bcf2e45a05a2ba32d0f4185a15abac59d478 100644
|
|
--- a/src/types/connection/offset/offset-page-info.type.js
|
|
+++ b/src/types/connection/offset/offset-page-info.type.js
|
|
@@ -25,7 +25,6 @@ const getOrCreateOffsetPageInfoType = () => {
|
|
tslib_1.__metadata("design:type", Boolean)
|
|
], PageInfoTypeImpl.prototype, "hasPreviousPage", void 0);
|
|
PageInfoTypeImpl = tslib_1.__decorate([
|
|
- (0, graphql_1.Directive)('@shareable'),
|
|
(0, graphql_1.ObjectType)('OffsetPageInfo'),
|
|
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean])
|
|
], PageInfoTypeImpl);
|
|
diff --git a/src/types/delete-many-reponse.type.js b/src/types/delete-many-reponse.type.js
|
|
index 4de72de3822d9c23c6637bbec0f0be081cc82675..1663e6f62991153f89db08ab966cdef8e01b262f 100644
|
|
--- a/src/types/delete-many-reponse.type.js
|
|
+++ b/src/types/delete-many-reponse.type.js
|
|
@@ -16,7 +16,6 @@ const DeleteManyResponseType = () => {
|
|
tslib_1.__metadata("design:type", Number)
|
|
], DeleteManyResponseTypeImpl.prototype, "deletedCount", void 0);
|
|
DeleteManyResponseTypeImpl = tslib_1.__decorate([
|
|
- (0, graphql_1.Directive)('@shareable'),
|
|
(0, graphql_1.ObjectType)('DeleteManyResponse')
|
|
], DeleteManyResponseTypeImpl);
|
|
deleteManyResponseType = DeleteManyResponseTypeImpl;
|
|
diff --git a/src/types/update-many-response.type.js b/src/types/update-many-response.type.js
|
|
index c525d1419e27d3714e7a75b4852e605b83bd4b39..a067b5f60922b7e92e985487c7128efe31162b24 100644
|
|
--- a/src/types/update-many-response.type.js
|
|
+++ b/src/types/update-many-response.type.js
|
|
@@ -16,7 +16,6 @@ const UpdateManyResponseType = () => {
|
|
tslib_1.__metadata("design:type", Number)
|
|
], UpdateManyResponseTypeImpl.prototype, "updatedCount", void 0);
|
|
UpdateManyResponseTypeImpl = tslib_1.__decorate([
|
|
- (0, graphql_1.Directive)('@shareable'),
|
|
(0, graphql_1.ObjectType)('UpdateManyResponse')
|
|
], UpdateManyResponseTypeImpl);
|
|
updateManyResponseType = UpdateManyResponseTypeImpl;
|