Skip to content

Commit 8445a0b

Browse files
committed
fix(examples): add top level await
1 parent 0513a19 commit 8445a0b

31 files changed

+41
-30
lines changed

examples/typegraphs/authentication.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
55

66
// skip:end
77

8-
typegraph({
8+
await typegraph({
99
name: "authentication",
1010
// skip:next-line
1111
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/backend-for-frontend.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { HttpRuntime } from "@typegraph/sdk/runtimes/http.js";
44

55
// skip:end
66

7-
typegraph({
7+
await typegraph({
88
name: "backend-for-frontend",
99
// skip:next-line
1010
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },
@@ -31,3 +31,5 @@ typegraph({
3131
).withPolicy(pub),
3232
});
3333
});
34+
35+
console.error("HLLO THERE");

examples/typegraphs/basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
55

66
// skip:end
77

8-
typegraph({
8+
await typegraph({
99
name: "basic-authentication",
1010
// skip:next-line
1111
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/cors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RandomRuntime } from "@typegraph/sdk/runtimes/random.js";
44

55
// skip:end
66

7-
typegraph({
7+
await typegraph({
88
name: "auth",
99
// highlight-next-line
1010
cors: {

examples/typegraphs/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Policy, t, typegraph } from "@typegraph/sdk/index.js";
66
// highlight-next-line
77
import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
88

9-
typegraph({
9+
await typegraph({
1010
name: "database",
1111
// skip:next-line
1212
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/deno.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
44

55
// skip:end
66

7-
typegraph({
7+
await typegraph({
88
name: "deno",
99
// skip:next-line
1010
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/example_rest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Policy, t, typegraph } from "@typegraph/sdk/index.js";
22
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
33

4-
typegraph({
4+
await typegraph({
55
name: "example-rest",
66
dynamic: false,
77
}, (g) => {

examples/typegraphs/execute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
44
import { Auth } from "@typegraph/sdk/params.js";
55
import * as effects from "@typegraph/sdk/effects.js";
66

7-
typegraph({
7+
await typegraph({
88
// skip:start
99
name: "roadmap-execute",
1010
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/faas-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PythonRuntime } from "@typegraph/sdk/runtimes/python.js";
55

66
// skip:end
77

8-
typegraph({
8+
await typegraph({
99
name: "faas-runner",
1010
// skip:next-line
1111
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/files-upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Policy, t, typegraph } from "@typegraph/sdk/index.js";
22
import { S3Runtime } from "@typegraph/sdk/providers/aws.js";
33

4-
typegraph({
4+
await typegraph({
55
name: "retrend",
66
// skip:next-line
77
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/first-typegraph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Policy, t, typegraph } from "@typegraph/sdk/index.js";
22
import { RandomRuntime } from "@typegraph/sdk/runtimes/random.js";
33

4-
typegraph({
4+
await typegraph({
55
name: "first-typegraph",
66
// skip:next-line
77
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Auth } from "@typegraph/sdk/params.js";
66
import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
77
// skip:end
88

9-
typegraph({
9+
await typegraph({
1010
// skip:start
1111
name: "roadmap-func",
1212
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/graphql-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { HttpRuntime } from "@typegraph/sdk/runtimes/http.js";
44

55
// skip:end
66

7-
typegraph({
7+
await typegraph({
88
name: "graphql-server",
99
// skip:next-line
1010
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
77
// highlight-next-line
88
import { GraphQLRuntime } from "@typegraph/sdk/runtimes/graphql.js";
99

10-
typegraph({
10+
await typegraph({
1111
name: "graphql",
1212
// skip:next-line
1313
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/iam-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function getEnvOrDefault(key: string, defaultValue: string) {
1414
}
1515
// skip:end
1616

17-
typegraph({
17+
await typegraph({
1818
name: "iam-provider",
1919
// skip:next-line
2020
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { HttpRuntime } from "@typegraph/sdk/runtimes/http.js";
77

88
// skip:end
99

10-
typegraph({
10+
await typegraph({
1111
name: "homepage",
1212
// skip:start
1313
rate: { windowLimit: 2000, windowSec: 60, queryLimit: 200, localExcess: 0 },

examples/typegraphs/jwt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
55

66
// skip:end
77

8-
typegraph({
8+
await typegraph({
99
name: "jwt-authentication",
1010
// skip:next-line
1111
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/math.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Policy, t, typegraph } from "@typegraph/sdk/index.js";
22
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
33

4-
typegraph({
4+
await typegraph({
55
name: "math",
66
}, (g) => {
77
// we need a runtime to run the functions on

examples/typegraphs/microservice-orchestration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function getEnvOrDefault(key: string, defaultValue: string) {
1515
}
1616
// skip:end
1717

18-
typegraph({
18+
await typegraph({
1919
name: "team-a",
2020
// skip:next-line
2121
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/oauth2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
55

66
// skip:end
77

8-
typegraph({
8+
await typegraph({
99
name: "oauth2-authentication",
1010
// skip:next-line
1111
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/policies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RandomRuntime } from "@typegraph/sdk/runtimes/random.js";
66

77
// skip:end
88

9-
typegraph({
9+
await typegraph({
1010
name: "policies",
1111
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },
1212
}, (g) => {

examples/typegraphs/prisma-runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
55

66
// skip:end
77

8-
typegraph({
8+
await typegraph({
99
name: "prisma-runtime",
1010
cors: {
1111
// skip:start

examples/typegraphs/prisma.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Policy, t, typegraph } from "@typegraph/sdk/index.js";
22
import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
33

4-
typegraph({
4+
await typegraph({
55
name: "roadmap-prisma",
66
// skip:next-line
77
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/programmable-api-gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
55

66
// skip:end
77

8-
typegraph({
8+
await typegraph({
99
name: "programmable-api-gateway",
1010
// skip:next-line
1111
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/random.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RandomRuntime } from "@typegraph/sdk/runtimes/random.js";
44
// skip:next-line
55
/* eslint-disable @typescript-eslint/no-unused-vars */
66

7-
typegraph({
7+
await typegraph({
88
name: "roadmap-random",
99
// skip:next-line
1010
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/rate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RandomRuntime } from "@typegraph/sdk/runtimes/random.js";
44

55
// skip:end
66

7-
typegraph({
7+
await typegraph({
88
name: "rate",
99
// highlight-next-line
1010
rate: {

examples/typegraphs/reduce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Auth } from "@typegraph/sdk/params.js";
33
import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
44
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
55

6-
typegraph({
6+
await typegraph({
77
name: "roadmap-reduce",
88
// skip:next-line
99
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/rest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Auth } from "@typegraph/sdk/params.js";
33
import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
44
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
55

6-
typegraph({
6+
await typegraph({
77
name: "roadmap-rest",
88
// skip:next-line
99
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/roadmap-policies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Auth } from "@typegraph/sdk/params.js";
33
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";
44
import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";
55

6-
typegraph({
6+
await typegraph({
77
name: "roadmap-policies",
88
// skip:next-line
99
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },

examples/typegraphs/triggers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { HttpRuntime } from "@typegraph/sdk/runtimes/http.js";
44

55
// skip:end
66

7-
typegraph({
7+
await typegraph({
88
name: "triggers",
99
}, (g) => {
1010
// skip:start

typegraph/python/typegraph/graph/typegraph.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,15 @@ def serialize_with_artifacts(
227227
raise Exception(tg_json.value)
228228
return tg_json.value
229229

230+
# TODO: remove
231+
# print(serialize_with_artifacts(config=ArtifactResolutionConfig(
232+
# dir=".",
233+
# prisma_migration=MigrationConfig(
234+
# action=MigrationAction(create=True, reset=True),
235+
# migration_dir="."
236+
# )
237+
# )))
238+
230239
return lambda: TypegraphOutput(name=tg.name, serialize=serialize_with_artifacts)
231240

232241
return decorator

0 commit comments

Comments
 (0)