From bd44a4c6c4c69e9eb1f6f3514e8b8f6dfb14ce13 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 30 Apr 2021 15:59:40 -0700 Subject: [PATCH] usage reporting: fix typo in Buffer.byteLength argument (#5149) Fortunately, it appears that going back at least to Node 8, there's no difference between passing "utf8", "uft8" (the typo), or no encoding argument, so there's no bug here. But it's good to remove the typo (and later versions of `@types/node` consider this to be an error). --- .../src/plugin/usageReporting/defaultSendOperationsAsTrace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/apollo-server-core/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts b/packages/apollo-server-core/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts index 300a429d622..e40a7e21e04 100644 --- a/packages/apollo-server-core/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts +++ b/packages/apollo-server-core/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts @@ -23,7 +23,7 @@ export function defaultSendOperationsAsTrace() { // it. max: Math.pow(2, 20), length: (_val, key) => { - return (key && Buffer.byteLength(key, 'uft8')) || 0; + return (key && Buffer.byteLength(key)) || 0; }, });