Generate object types, inputs, args, etc. from prisma schema file for usage with @nestjs/graphql module.
-
output
Output folder relative to this schema file
-
outputFilePattern
File pattern (default: {feature}/{name}.{type}.ts
)
Possible tokens:
{feature}
- model name in dashed case or 'prisma' if unknown{name}
- dashed-case name of model/input/arg without suffix{type}
- short type name (model, input, args, output){plural.type}
- plural short type name (models, inputs, enums)
-
combineScalarFilters
- Combine nested/nullable scalar filters to single
(default: true
)
-
atomicNumberOperations
- Atomic number operations,
false
- disabled (default), true
- enabled
-
reExportAll
- create index.ts
files for each directory with re-export,
false
- disabled (default), true
- enabled
-
types_*
- flatten map of types
types_{type}_fieldType
- TypeScript type nametypes_{type}_fieldModule
- Module to importtypes_{type}_graphqlType
- GraphQL type nametypes_{type}_graphqlModule
- Module to import
Where {type}
is prisma type in schema
Example (Decimal):
types_Decimal_fieldType = "Decimal"
types_Decimal_fieldModule = "decimal.js"
types_Decimal_graphqlType = "GraphQLDecimal"
types_Decimal_graphqlModule = "graphql-type-decimal"
Generates field:
import { GraphQLDecimal } from 'graphql-type-decimal';
import { Decimal } from 'decimal.js';
...
@Field(() => GraphQLDecimal)
field: Decimal;
Example (DateTime):
types_DateTime_fieldType = "Date"
types_DateTime_graphqlType = "GraphQLISODateTime"
types_DateTime_graphqlModule = "@nestjs/graphql"
Generated fields:
@Field(() => GraphQLISODateTime)
field: Date;