-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Hi,
I'm currently using this lib which is really helpfull, however I am facing a problem.
When generating with this generator :
generator nestgraphql {
provider = "node node_modules/prisma-nestjs-graphql"
output = "../src/@generated"
reExport = Directories
combineScalarFilters = true
}
The generated enums are wrong because of the description field :
import { registerEnumType } from '@nestjs/graphql';
export enum ManufacturerUserRole {
USER = "USER",
MANAGER = "MANAGER"
}
registerEnumType(ManufacturerUserRole, { name: 'ManufacturerUserRole', description: undefined })
Here we got a TS error :
Argument of type '{ name: string; description: undefined; }' is not assignable to parameter of type 'EnumOptions<typeof ManufacturerUserRole>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'description' are incompatible.
Type 'undefined' is not assignable to type 'string'.ts(2379)
A workaround is to modify each file with a script after generating, but I guess this is not the best way to workaround, and this should be fixed in the generated files directly.
Metadata
Metadata
Assignees
Labels
No labels