Opinionated prisma generator.
ES6 class generator inspired by objection.js. It generates classes for your models, which can be extended with your custom classes.
For each of your models, this generates:
- Prisma base class - has static methods to call prisma queries and get results mapped to their respective types back
- Typegraphql Scalars class
- Typegraphql class with relations included
For examples, see fixtures
folder.
- handle instance methods properly for models without a primary key
make sure you have these to use this without TS compilation errors:
{
"compilerOptions": {
"strict": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"strictPropertyInitialization": false
}
}
easiest is to run jest in watch mode yarn w
and simultaneously run TSC watch yarn tsw
in another window.