From ae2d16d553e264c813ac65d78eacab3d7a2efeae Mon Sep 17 00:00:00 2001 From: Laurin Quast Date: Mon, 10 Feb 2025 17:02:06 +0100 Subject: [PATCH] fix: uuid generation on old Node.js (#6494) --- .changeset/two-dryers-float.md | 6 ++++++ packages/libraries/core/src/client/http-client.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/two-dryers-float.md diff --git a/.changeset/two-dryers-float.md b/.changeset/two-dryers-float.md new file mode 100644 index 000000000..65f5b2331 --- /dev/null +++ b/.changeset/two-dryers-float.md @@ -0,0 +1,6 @@ +--- +'@graphql-hive/core': patch +--- + +Replace usage of `crypto.randomUUID()` with a custom UUID generation for better backwards +compatability. diff --git a/packages/libraries/core/src/client/http-client.ts b/packages/libraries/core/src/client/http-client.ts index f2572a1ab..249086560 100644 --- a/packages/libraries/core/src/client/http-client.ts +++ b/packages/libraries/core/src/client/http-client.ts @@ -1,5 +1,5 @@ import asyncRetry from 'async-retry'; -import { fetch, URL } from '@whatwg-node/fetch'; +import { crypto, fetch, URL } from '@whatwg-node/fetch'; import type { Logger } from './types.js'; interface SharedConfig {