Skip to content

Commit

Permalink
Build pothos schema if route type is "graphql" (#2204)
Browse files Browse the repository at this point in the history
* Build pothos schema if route type is "graphql"

Pothos schema wouldn't be built if using the new 1.18 "graphql" route type.

* Sync

Co-authored-by: Frank <wangfanjie@gmail.com>
  • Loading branch information
estyrke and fwang committed Nov 22, 2022
1 parent 7cf4926 commit 0fff614
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/dry-dingos-search.md
@@ -0,0 +1,6 @@
---
"@serverless-stack/core": patch
"@serverless-stack/resources": patch
---

Api: fix pothos schema not built for "graphql" route type
2 changes: 1 addition & 1 deletion packages/core/src/cli/PothosBuilder.ts
Expand Up @@ -51,7 +51,7 @@ export function createPothosBuilder(opts: Opts) {
routes = evt.properties.metadata
.filter(c => c.type == "Api")
.flatMap(c => c.data.routes)
.filter(r => r.type === "pothos")
.filter(r => ["pothos", "graphql"].includes(r.type))
.filter(r => r.schema);
for (const route of routes) build(route);
});
Expand Down
1 change: 0 additions & 1 deletion packages/resources/src/Api.ts
Expand Up @@ -9,7 +9,6 @@ import * as apigIntegrations from "@aws-cdk/aws-apigatewayv2-integrations-alpha"
import * as elb from "aws-cdk-lib/aws-elasticloadbalancingv2";
import * as lambda from "aws-cdk-lib/aws-lambda";
import * as logs from "aws-cdk-lib/aws-logs";
import spawn from "cross-spawn";

import { App } from "./App.js";
import { Stack } from "./Stack.js";
Expand Down

0 comments on commit 0fff614

Please sign in to comment.