From 342e3464895be25d2722f8b9261ad35d35acf651 Mon Sep 17 00:00:00 2001
From: Niklas Mollenhauer <nikeee@outlook.com>
Date: Fri, 6 Dec 2024 00:33:12 +0100
Subject: [PATCH] chore(deps): Use `crypto.randomUUID()` instead of `uuid`
 module

The `crypto` global is available in all supported Node.js versions as well as [in all major browsers](https://caniuse.com/mdn-api_crypto_randomuuid).
The uuid module is rendered unnecessary for uuidv4.
---
 packages/graphql/lib/utils/generate-token.util.ts | 4 +---
 packages/graphql/package.json                     | 1 -
 yarn.lock                                         | 5 -----
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/packages/graphql/lib/utils/generate-token.util.ts b/packages/graphql/lib/utils/generate-token.util.ts
index d96933a29..4589f9fec 100644
--- a/packages/graphql/lib/utils/generate-token.util.ts
+++ b/packages/graphql/lib/utils/generate-token.util.ts
@@ -1,3 +1 @@
-import { v4 } from 'uuid';
-
-export const generateString = () => v4();
+export const generateString = () => crypto.randomUUID();
diff --git a/packages/graphql/package.json b/packages/graphql/package.json
index 4dd8e965b..4adaa4292 100644
--- a/packages/graphql/package.json
+++ b/packages/graphql/package.json
@@ -30,7 +30,6 @@
     "normalize-path": "3.0.0",
     "subscriptions-transport-ws": "0.11.0",
     "tslib": "2.8.1",
-    "uuid": "11.0.3",
     "ws": "8.18.0"
   },
   "devDependencies": {
diff --git a/yarn.lock b/yarn.lock
index 114d85a31..71352f8c6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -10797,11 +10797,6 @@ utils-merge@1.0.1:
   resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz"
   integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==
 
-uuid@11.0.3:
-  version "11.0.3"
-  resolved "https://registry.yarnpkg.com/uuid/-/uuid-11.0.3.tgz#248451cac9d1a4a4128033e765d137e2b2c49a3d"
-  integrity sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==
-
 uuid@^10.0.0:
   version "10.0.0"
   resolved "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz"