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