Node.js ORM written in TypeScript for type lovers.

View the Project on GitHub twinlogix/typetta

Config Reference

Typetta relies on a configuration file named typetta.yml or typetta.json to manage all possible options, input, and output document types. The CLI automatically detects the defined config file and generates code accordingly.

In addition, you can also define a path to your config file with the –config options, like so:

npx typetta generate --config ./custom/config.yml

typetta.yml format

Here’s an example for a minimal configuration file:

schema: src/**/**.typedefs.ts
outputDir: src/generated

By default all the generators are enabled and generate in the given output directory. You can define different options for each generator creating a more complex configuration file like the following:

schema: 
  - src/typedefs/user.ts
  - src/typedefs/post.ts
generateTypes:
  output: src/types.generated.ts
generateORM:
  output: src/typetta.generated.ts
generateGraphQLOperations:
  operations: false
  resolvers: false
  resolversTypes:
    output: src/resolvers.generated.ts
scalars:
  Date: Date
  URL: string

Configuration options

Here are the supported options that you can define in the config file: