From 02a9b918dc89548b4b10e6fb52d570fd9677b3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Wed, 27 Aug 2025 09:06:15 +0200 Subject: [PATCH] Return named middleware function closes #34 --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 8624051..6b025cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,8 @@ export function expressMiddleware( const context: ContextFunction<[ExpressContextFunctionArgument], TContext> = options?.context ?? defaultContext; - return async (req, res) => { + // Return the middleware as a named function for observability. + return async function apolloGraphQL(req, res) { if (!('body' in req)) { // The json body-parser *always* initializes the `body` field on requests // when it runs. (body-parser@1 (included in Express v4 as