sam-goodwin / punchcard

Type-safe AWS infrastructure.
Apache License 2.0
506 stars 20 forks source link

[WIP] AppSync - type-safe Velocity Template and GraphQL schemas #119

Closed sam-goodwin closed 4 years ago

sam-goodwin commented 4 years ago

This is a Punchcard abstraction for AWS AppSync that unifies GraphQL, Velocity Templates and AppSync Resolvers into a single, type-safe environment. Developers write simple TypeScript code which then generates the GraphQL Schema, VTL templates and CDK configuration for an AWS AppSync API.

What I really love about this change is that it lets Punchcard abstract over AppSync's managed VTL execution engine. Effective use of these templates and resolvers can rapidly increase the reliability of a service - a developer has even less to manage than lambda.

Punchcard also brings type-safety to an otherwise annoying programming environment - VTL. The VTL DSL makes use of TypeScript's compiler to statically check that an API definition is sound.

https://github.com/punchcard/punchcard/blob/f3d6d8208208dc4b0aad84f0519ba18d26f96419/examples/lib/graphql.ts#L9-L188