From 8edcbed0d20ca07b532c299523b5835c030276b7 Mon Sep 17 00:00:00 2001 From: Pavel Denisjuk Date: Mon, 4 Mar 2019 20:46:16 +0100 Subject: [PATCH] fix: unset __runAtMostOnce flag in root schema resolver. (#472) --- packages/webiny-api/src/lambda/lambda.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/webiny-api/src/lambda/lambda.js b/packages/webiny-api/src/lambda/lambda.js index d22e753cbc4..ab16076285b 100644 --- a/packages/webiny-api/src/lambda/lambda.js +++ b/packages/webiny-api/src/lambda/lambda.js @@ -33,7 +33,12 @@ const createApolloHandler = async (config: Object) => { schema = applyMiddleware(schema, ...registeredMiddleware); } - addSchemaLevelResolveFunction(schema, async (root, args, context) => { + addSchemaLevelResolveFunction(schema, async (root, args, context, info) => { + // Make sure we do not block this resolver from processing subsequent requests! + // This is something that is baked into the graphql-tools and cannot be avoided another way. + delete info.operation['__runAtMostOnce']; + + // Process `graphql-context` plugins const ctxPlugins = getPlugins("graphql-context"); for (let i = 0; i < ctxPlugins.length; i++) { const ctxPlugin = ctxPlugins[i];