@cedarjs/api-server 1.0.0-canary.13166 → 1.0.0-canary.13168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -500,27 +500,18 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
500
500
  }
501
501
  }
502
502
  const { yoga } = createGraphQLYoga(graphqlOptions);
503
- const graphQLYogaHandler = async (req, reply) => {
504
- const response = await yoga.handleNodeRequest(req, {
505
- req,
506
- reply,
507
- event: lambdaEventForFastifyRequest(req),
508
- requestContext: {}
509
- });
510
- for (const [name, value] of response.headers) {
511
- reply.header(name, value);
512
- }
513
- reply.status(response.status);
514
- reply.send(response.body);
515
- return reply;
516
- };
517
503
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
518
504
  const routePaths = ["", "/health", "/readiness", "/stream"];
519
505
  for (const routePath of routePaths) {
520
506
  fastify2.route({
521
507
  url: `${redwoodOptions.apiRootPath}${graphqlEndpoint}${routePath}`,
522
508
  method,
523
- handler: (req, reply) => graphQLYogaHandler(req, reply)
509
+ handler: (req, reply) => yoga.handleNodeRequestAndResponse(req, reply, {
510
+ req,
511
+ reply,
512
+ event: lambdaEventForFastifyRequest(req),
513
+ requestContext: {}
514
+ })
524
515
  });
525
516
  }
526
517
  fastify2.addHook("onReady", (done) => {
package/dist/cjs/bin.js CHANGED
@@ -516,27 +516,18 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
516
516
  }
517
517
  }
518
518
  const { yoga } = (0, import_graphql_server.createGraphQLYoga)(graphqlOptions);
519
- const graphQLYogaHandler = async (req, reply) => {
520
- const response = await yoga.handleNodeRequest(req, {
521
- req,
522
- reply,
523
- event: lambdaEventForFastifyRequest(req),
524
- requestContext: {}
525
- });
526
- for (const [name, value] of response.headers) {
527
- reply.header(name, value);
528
- }
529
- reply.status(response.status);
530
- reply.send(response.body);
531
- return reply;
532
- };
533
519
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
534
520
  const routePaths = ["", "/health", "/readiness", "/stream"];
535
521
  for (const routePath of routePaths) {
536
522
  fastify2.route({
537
523
  url: `${redwoodOptions.apiRootPath}${graphqlEndpoint}${routePath}`,
538
524
  method,
539
- handler: (req, reply) => graphQLYogaHandler(req, reply)
525
+ handler: (req, reply) => yoga.handleNodeRequestAndResponse(req, reply, {
526
+ req,
527
+ reply,
528
+ event: lambdaEventForFastifyRequest(req),
529
+ requestContext: {}
530
+ })
540
531
  });
541
532
  }
542
533
  fastify2.addHook("onReady", (done) => {
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/plugins/graphql.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBA8GtC"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/plugins/graphql.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;AAM3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBA+FtC"}
@@ -73,27 +73,18 @@ async function redwoodFastifyGraphQLServer(fastify, options) {
73
73
  }
74
74
  }
75
75
  const { yoga } = (0, import_graphql_server.createGraphQLYoga)(graphqlOptions);
76
- const graphQLYogaHandler = async (req, reply) => {
77
- const response = await yoga.handleNodeRequest(req, {
78
- req,
79
- reply,
80
- event: (0, import_awsLambdaFastify.lambdaEventForFastifyRequest)(req),
81
- requestContext: {}
82
- });
83
- for (const [name, value] of response.headers) {
84
- reply.header(name, value);
85
- }
86
- reply.status(response.status);
87
- reply.send(response.body);
88
- return reply;
89
- };
90
76
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
91
77
  const routePaths = ["", "/health", "/readiness", "/stream"];
92
78
  for (const routePath of routePaths) {
93
79
  fastify.route({
94
80
  url: `${redwoodOptions.apiRootPath}${graphqlEndpoint}${routePath}`,
95
81
  method,
96
- handler: (req, reply) => graphQLYogaHandler(req, reply)
82
+ handler: (req, reply) => yoga.handleNodeRequestAndResponse(req, reply, {
83
+ req,
84
+ reply,
85
+ event: (0, import_awsLambdaFastify.lambdaEventForFastifyRequest)(req),
86
+ requestContext: {}
87
+ })
97
88
  });
98
89
  }
99
90
  fastify.addHook("onReady", (done) => {
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBA8GtC"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/plugins/graphql.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;AAM3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAA;KAC7B,CAAA;CACF;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,iBA+FtC"}
@@ -40,27 +40,18 @@ async function redwoodFastifyGraphQLServer(fastify, options) {
40
40
  }
41
41
  }
42
42
  const { yoga } = createGraphQLYoga(graphqlOptions);
43
- const graphQLYogaHandler = async (req, reply) => {
44
- const response = await yoga.handleNodeRequest(req, {
45
- req,
46
- reply,
47
- event: lambdaEventForFastifyRequest(req),
48
- requestContext: {}
49
- });
50
- for (const [name, value] of response.headers) {
51
- reply.header(name, value);
52
- }
53
- reply.status(response.status);
54
- reply.send(response.body);
55
- return reply;
56
- };
57
43
  const graphqlEndpoint = trimSlashes(yoga.graphqlEndpoint);
58
44
  const routePaths = ["", "/health", "/readiness", "/stream"];
59
45
  for (const routePath of routePaths) {
60
46
  fastify.route({
61
47
  url: `${redwoodOptions.apiRootPath}${graphqlEndpoint}${routePath}`,
62
48
  method,
63
- handler: (req, reply) => graphQLYogaHandler(req, reply)
49
+ handler: (req, reply) => yoga.handleNodeRequestAndResponse(req, reply, {
50
+ req,
51
+ reply,
52
+ event: lambdaEventForFastifyRequest(req),
53
+ requestContext: {}
54
+ })
64
55
  });
65
56
  }
66
57
  fastify.addHook("onReady", (done) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "1.0.0-canary.13166+e1801296f",
3
+ "version": "1.0.0-canary.13168+e15dce70e",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -111,11 +111,11 @@
111
111
  "test:watch": "vitest watch"
112
112
  },
113
113
  "dependencies": {
114
- "@cedarjs/context": "1.0.0-canary.13166",
115
- "@cedarjs/fastify-web": "1.0.0-canary.13166",
116
- "@cedarjs/internal": "1.0.0-canary.13166",
117
- "@cedarjs/project-config": "1.0.0-canary.13166",
118
- "@cedarjs/web-server": "1.0.0-canary.13166",
114
+ "@cedarjs/context": "1.0.0-canary.13168",
115
+ "@cedarjs/fastify-web": "1.0.0-canary.13168",
116
+ "@cedarjs/internal": "1.0.0-canary.13168",
117
+ "@cedarjs/project-config": "1.0.0-canary.13168",
118
+ "@cedarjs/web-server": "1.0.0-canary.13168",
119
119
  "@fastify/multipart": "9.3.0",
120
120
  "@fastify/url-data": "6.0.3",
121
121
  "ansis": "4.2.0",
@@ -132,7 +132,7 @@
132
132
  "yargs": "17.7.2"
133
133
  },
134
134
  "devDependencies": {
135
- "@cedarjs/framework-tools": "1.0.0-canary.13166",
135
+ "@cedarjs/framework-tools": "1.0.0-canary.13168",
136
136
  "@types/aws-lambda": "8.10.159",
137
137
  "@types/dotenv-defaults": "^5.0.0",
138
138
  "@types/qs": "6.14.0",
@@ -145,7 +145,7 @@
145
145
  "vitest": "3.2.4"
146
146
  },
147
147
  "peerDependencies": {
148
- "@cedarjs/graphql-server": "1.0.0-canary.13166"
148
+ "@cedarjs/graphql-server": "1.0.0-canary.13168"
149
149
  },
150
150
  "peerDependenciesMeta": {
151
151
  "@cedarjs/graphql-server": {
@@ -155,5 +155,5 @@
155
155
  "publishConfig": {
156
156
  "access": "public"
157
157
  },
158
- "gitHead": "e1801296f29ca7951a6a5d2cce15be13e3eadc02"
158
+ "gitHead": "e15dce70ebd6c2cc120a2e53fa3082de85b9ec65"
159
159
  }