diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 383192b3b..9e29073d4 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -73,7 +73,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: 16.x - - run: npm install -g ts-node prettier typescript + - run: npm install -g ts-node prettier typescript @swc/core @swc/cli - run: | cd ts npm ci diff --git a/.github/workflows/go_ci.yml b/.github/workflows/go_ci.yml index 545730f0e..6f6baa2c1 100644 --- a/.github/workflows/go_ci.yml +++ b/.github/workflows/go_ci.yml @@ -75,7 +75,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: 16.x - - run: npm install -g ts-node prettier typescript + - run: npm install -g ts-node prettier typescript @swc/core @swc/cli - run: | cd ts npm ci diff --git a/examples/simple/src/ent/contact.ts b/examples/simple/src/ent/contact.ts index ecc6715cd..f4e16c02f 100644 --- a/examples/simple/src/ent/contact.ts +++ b/examples/simple/src/ent/contact.ts @@ -1,3 +1,4 @@ +import { GraphQLString } from "graphql"; import { ContactBase } from "./internal"; import { PrivacyPolicy, @@ -19,7 +20,10 @@ export class Contact extends ContactBase { rules: [new AllowIfViewerIsRule("userID"), AlwaysDenyRule], }; - @gqlField() + @gqlField({ + type: GraphQLString, + name: "fullName", + }) get fullName(): string { return this.firstName + " " + this.lastName; } diff --git a/examples/simple/src/ent/user.ts b/examples/simple/src/ent/user.ts index 2b0ea4d7b..d1c123fcd 100644 --- a/examples/simple/src/ent/user.ts +++ b/examples/simple/src/ent/user.ts @@ -22,7 +22,10 @@ export class User extends UserBase { ], }; - @gqlField() + @gqlField({ + type: GraphQLString, + name: "fullName", + }) get fullName(): string { return this.firstName + " " + this.lastName; } diff --git a/internal/schema/input/parse_ts.go b/internal/schema/input/parse_ts.go index 30f2dfd58..1ad78ac09 100644 --- a/internal/schema/input/parse_ts.go +++ b/internal/schema/input/parse_ts.go @@ -49,6 +49,7 @@ func GetRawSchema(dirPath string, fromTest bool) ([]byte, error) { cmdArgs = append( cmdArgs, + "--swc", util.GetPathToScript("scripts/read_schema.ts", fromTest), "--path", schemaPath,