Skip to content

Commit

Permalink
docs: Update lambda.mdx (#7540)
Browse files Browse the repository at this point in the history
Section "using event information" should include second argument when
calling `startServerAndCreateLambdaHandler()`.
  • Loading branch information
xzecakular committed May 2, 2023
1 parent c54b028 commit 5602bf8
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions docs/source/deployment/lambda.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,20 @@ const server = new ApolloServer<MyContext>({
});
// This final export is important!
export const graphqlHandler = startServerAndCreateLambdaHandler(server, {
// highlight-start
context: async ({ event, context }) => {
return {
lambdaEvent: event,
lambdaContext: context,
};
},
// highlight-end
});
export const graphqlHandler = startServerAndCreateLambdaHandler(
server,
handlers.createAPIGatewayProxyEventV2RequestHandler(),
{
// highlight-start
context: async ({ event, context }) => {
return {
lambdaEvent: event,
lambdaContext: context,
};
},
// highlight-end
}
);
```

</MultiCodeBlock>
Expand Down

0 comments on commit 5602bf8

Please sign in to comment.