From 63dc50fc65cd7b4a9df0e1de4ab6d6ee82dbeb5c Mon Sep 17 00:00:00 2001 From: Stijn Beauprez Date: Mon, 11 Dec 2023 22:14:41 +0100 Subject: [PATCH] Fix type of ApolloServerPluginUsageReporting reportTimer (#7799) Fixes #7798 In src/plugin/usageReporting/plugin.ts reportTimer is typed as NodeJS.Timer, it is actually a timeout, so using node 18> types it is incompatible with clearInterval() --- .changeset/fair-squids-unite.md | 5 +++++ packages/server/src/plugin/usageReporting/plugin.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/fair-squids-unite.md diff --git a/.changeset/fair-squids-unite.md b/.changeset/fair-squids-unite.md new file mode 100644 index 00000000000..c59eae8d947 --- /dev/null +++ b/.changeset/fair-squids-unite.md @@ -0,0 +1,5 @@ +--- +'@apollo/server': patch +--- + +Fix type of ApolloServerPluginUsageReporting reportTimer diff --git a/packages/server/src/plugin/usageReporting/plugin.ts b/packages/server/src/plugin/usageReporting/plugin.ts index 76038036aca..e241a5c9650 100644 --- a/packages/server/src/plugin/usageReporting/plugin.ts +++ b/packages/server/src/plugin/usageReporting/plugin.ts @@ -206,7 +206,7 @@ export function ApolloServerPluginUsageReporting( } | undefined; - let reportTimer: NodeJS.Timer | undefined; + let reportTimer: NodeJS.Timeout | undefined; if (!sendReportsImmediately) { reportTimer = setInterval( () => sendAllReportsAndReportErrors(),