sst 2.8.24 → 2.8.25
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/constructs/Api.js +1 -0
- package/node/graphql/index.js +4 -1
- package/package.json +1 -1
package/constructs/Api.js
CHANGED
|
@@ -586,6 +586,7 @@ export class Api extends Construct {
|
|
|
586
586
|
}, postfixName);
|
|
587
587
|
const data = this.routesData[routeKey];
|
|
588
588
|
if (data.type === "function") {
|
|
589
|
+
data.function.addEnvironment("GRAPHQL_ENDPOINT", routeKey.split(" ")[1]);
|
|
589
590
|
this.routesData[routeKey] = {
|
|
590
591
|
...data,
|
|
591
592
|
type: "graphql",
|
package/node/graphql/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { createYoga } from "graphql-yoga";
|
|
2
2
|
import { Handler, useEvent, useLambdaContext } from "../../context/handler.js";
|
|
3
3
|
export function GraphQLHandler(options) {
|
|
4
|
-
const yoga = createYoga(
|
|
4
|
+
const yoga = createYoga({
|
|
5
|
+
graphqlEndpoint: process.env.GRAPHQL_ENDPOINT,
|
|
6
|
+
...options,
|
|
7
|
+
});
|
|
5
8
|
return Handler("api", async () => {
|
|
6
9
|
const event = useEvent("api");
|
|
7
10
|
const parameters = new URLSearchParams(event.queryStringParameters || {}).toString();
|