Skip to content

Commit 6abdf2a

Browse files
chilltempaaronpowell
authored andcommitted
add request to context function
1 parent a9980c1 commit 6abdf2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type { WithRequired } from '@apollo/utils.withrequired';
1515

1616
export interface AzureFunctionsContextFunctionArgument {
1717
context: Context;
18+
req: HttpRequest;
1819
}
1920

2021
export interface AzureFunctionsMiddlewareOptions<TContext extends BaseContext> {
@@ -46,7 +47,7 @@ export function startServerAndCreateHandler<TContext extends BaseContext>(
4647

4748
const { body, headers, status } = await server.executeHTTPGraphQLRequest({
4849
httpGraphQLRequest: normalizedRequest,
49-
context: () => contextFunction({ context }),
50+
context: () => contextFunction({ context, req }),
5051
});
5152

5253
if (body.kind === 'chunked') {

0 commit comments

Comments
 (0)