prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
Generate _count as always nullable:true
Is it possible to generate the _count property as always { nullable:true }? I couldn't find the generator option to do that.
There is no such option.
For what kind of generated class it should be null (model, input)? What is corresponding prisma expression which returns null instead of number?
Ref: #84
The problem with the _count property is, that it is automatically generated per default as nullable: false, but the default way of using prisma doesn't include the _count property meaning I always have to include it, which is counterintuitive to using prisma.
I dont understand the problem. If you have graphql client error about count property, it means that you must provide it. Using prisma for getting count is not supposing to return null.
How can i delete this field?, since this field its not in the type definition on the prisma client type as a part of the model.
@denes16 Since v17.1.0 you can hide field in graphql schema using configuration:
decorate_1_type = "ArticleCount" // outmatch pattern for graphql type
decorate_1_field = "_count"
decorate_1_name = "HideField"
decorate_1_from = "@nestjs/graphql"
decorate_1_arguments = "[]"
See https://github.com/unlight/prisma-nestjs-graphql#decorate
how to delete this field from generation or how can I add isAbstract in every @ObjectType({ isAbstract: true })