prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
How to hide an entire model? (hide enum)
I have a model that I don't want to expose to my graphql schema at all. The below does not work. Is there an existing solution?
/// @HideField({input: true, output: true})
model JobLog {
id Int
data JSON
}
Okay just realized it works with
/// @ObjectType({abstract: true})
model JobLog {
id Int
data JSON
}
But it does not work for enums.
I'm not sure that understand the reason to hide enum. Making model abstract make sense if you want extends and override some fields, but how you will extend enum and how it will work with enum in prisma?
I dont want to extend my enum, I just want to remove it from my schema entirely. Right now, its being added to my graphql schema which I don't want.
Are you removed all fields from all models with this enum type?
Yes i did
I added @HideField({ input: true, model: true, output: true }) to my example
https://github.com/unlight/prisma-nestjs-graphql/blob/4f2cb69b349fda560b5a83780778ad2f8d7594c6/prisma/schema.prisma#L59
And enum Role is disappeared from schema, despite @generated/prisma/role.enum.ts in requiring during application start and registerEnumType(Role, { name: 'Role', description: undefined }); is definitely called.
@IgnisDa Could you check this again in your project