From bd9e3f9139d540027147e3741b552a3a6cd0d3fc Mon Sep 17 00:00:00 2001 From: David Glasser Date: Wed, 3 Aug 2022 15:50:24 -0700 Subject: [PATCH] Usage reporting: fix TS declaration of fieldLevelInstrumentation Note that the `const fieldLevelInstrumentation` which this got assigned to actually already inferred (roughly) the correct type because the type got merged with a number-returning function from another case. --- CHANGELOG.md | 2 +- .../apollo-server-core/src/plugin/usageReporting/options.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c343ffd8fef..cf006239b34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ The version headers in this history reflect the versions of Apollo Server itself ## vNEXT -- _Nothing yet! Stay tuned._ +- Fix the TypeScript declaration of the `fieldLevelInstrumentation` option to `ApolloServerPluginUsageReporting` to show that the function may return a number in addition to a boolean. This now matches the implementation and docs. [PR #6763](https://github.com/apollographql/apollo-server/pull/6763) ## v3.10.0 diff --git a/packages/apollo-server-core/src/plugin/usageReporting/options.ts b/packages/apollo-server-core/src/plugin/usageReporting/options.ts index 737be156d24..be070f521cc 100644 --- a/packages/apollo-server-core/src/plugin/usageReporting/options.ts +++ b/packages/apollo-server-core/src/plugin/usageReporting/options.ts @@ -120,7 +120,7 @@ export interface ApolloServerPluginUsageReportingOptions { | number | (( request: GraphQLRequestContextDidResolveOperation, - ) => Promise); + ) => Promise); /** * This option allows you to choose if a particular request should be