From 54503cf3e4049fb03dd657ca94fc95acac0b4386 Mon Sep 17 00:00:00 2001 From: Chang Wang Date: Mon, 3 Jun 2019 12:22:52 -0400 Subject: [PATCH] set registeredOperation and forbiddenOperation on requestContext Those fields were added by https://github.com/apollographql/apollo-server/pull/2768 --- .../src/ApolloServerPluginOperationRegistry.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/apollo-server-plugin-operation-registry/src/ApolloServerPluginOperationRegistry.ts b/packages/apollo-server-plugin-operation-registry/src/ApolloServerPluginOperationRegistry.ts index a99a2a5dfd7..cf071ddf621 100644 --- a/packages/apollo-server-plugin-operation-registry/src/ApolloServerPluginOperationRegistry.ts +++ b/packages/apollo-server-plugin-operation-registry/src/ApolloServerPluginOperationRegistry.ts @@ -152,6 +152,9 @@ export default function plugin(options: Options = Object.create(null)) { logger.debug( `${logHash}: Permitting operation found in local registry.`, ); + if (!options.dryRun) { + requestContext.metrics.registeredOperation = true; + } return; } @@ -210,6 +213,7 @@ export default function plugin(options: Options = Object.create(null)) { ); if (!options.dryRun) { + requestContext.metrics.forbiddenOperation = true; throw new ForbiddenError('Execution forbidden'); } else { logger.debug(