Skip to content

Commit 0450f9e

Browse files
Version Packages (#114)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 71c94df commit 0450f9e

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

.changeset/funny-chefs-shake.md

-5
This file was deleted.

.changeset/giant-rats-rhyme.md

-36
This file was deleted.

CHANGELOG.md

+41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# @as-integrations/aws-lambda
22

3+
## 3.0.0
4+
5+
### Major Changes
6+
7+
- [#110](https://github.com/apollo-server-integrations/apollo-server-integration-aws-lambda/pull/110) [`e76fc08`](https://github.com/apollo-server-integrations/apollo-server-integration-aws-lambda/commit/e76fc08da5152f1bfb9bae3e29033d714474fd33) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Drop support for Node v14
8+
9+
### Minor Changes
10+
11+
- [#91](https://github.com/apollo-server-integrations/apollo-server-integration-aws-lambda/pull/91) [`71c94df`](https://github.com/apollo-server-integrations/apollo-server-integration-aws-lambda/commit/71c94dfc96aa6f3a3d08928162f7480be375a31e) Thanks [@BlenderDude](https://github.com/BlenderDude)! - ## Short circuit middleware execution
12+
13+
You can now opt to return a Lambda result object directly from the middleware. This will cancel the middleware chain, bypass GraphQL request processing, and immediately return the Lambda result.
14+
15+
Example
16+
17+
```ts
18+
export const handler = startServerAndCreateLambdaHandler(
19+
server,
20+
handlers.createAPIGatewayProxyEventV2RequestHandler(),
21+
{
22+
context: async () => {
23+
return {};
24+
},
25+
middleware: [
26+
async (event) => {
27+
const psk = Buffer.from('SuperSecretPSK');
28+
const token = Buffer.from(event.headers['X-Auth-Token']);
29+
if (
30+
psk.byteLength !== token.byteLength ||
31+
crypto.timingSafeEqual(psk, token)
32+
) {
33+
return {
34+
statusCode: '403',
35+
body: 'Forbidden',
36+
};
37+
}
38+
},
39+
],
40+
},
41+
);
42+
```
43+
344
## 2.0.1
445

546
### Patch Changes

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@as-integrations/aws-lambda",
33
"description": "An Apollo Server integration for hosting on AWS Lambda",
4-
"version": "2.0.1",
4+
"version": "3.0.0",
55
"author": "Michael Watson & Daniel Abdelsamed",
66
"license": "MIT",
77
"repository": {

0 commit comments

Comments
 (0)