Skip to content

Commit

Permalink
Fix type of ApolloServerPluginUsageReporting reportTimer (#7799)
Browse files Browse the repository at this point in the history
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()
  • Loading branch information
stijnbe committed Dec 11, 2023
1 parent a7ecbba commit 63dc50f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-squids-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@apollo/server': patch
---

Fix type of ApolloServerPluginUsageReporting reportTimer
2 changes: 1 addition & 1 deletion packages/server/src/plugin/usageReporting/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function ApolloServerPluginUsageReporting<TContext extends BaseContext>(
}
| undefined;

let reportTimer: NodeJS.Timer | undefined;
let reportTimer: NodeJS.Timeout | undefined;
if (!sendReportsImmediately) {
reportTimer = setInterval(
() => sendAllReportsAndReportErrors(),
Expand Down

0 comments on commit 63dc50f

Please sign in to comment.