Schema file and codegen
The schema fileschema.graphql uses a GraphQL dialect to model the target entities and entity relations. The tooling around the schema file is then used to:
- Generate TypeORM entities (with
squid-typeorm-codegen(1), see below) - Generate the database schema from the TypeORM entities (see db migrations)
- Optionally, the schema can be used to present the target data with a GraphQL API.
TypeORM codegen
Thesquid-typeorm-codegen(1) tool is used to generate TypeORM entity classes from the schema defined in schema.graphql. Invoke it with
src/model/generated.
Example
AFoo entity defined in the schema file:
schema.graphql
Foo entity with TypeORM decorators:
src/model/generated/foo.ts

