Pretty much most of the schema is generated in such a way that it becomes a minefield of nullable fields because no ! is aded anywhere.
Lets take a simple example
For the above, the following schema should be generated:
type Novel {
id: ID!
title: String!
originalTitle: String
description: Novel_description_Document
}
type Featured {
id: ID!
novels(where: NovelWhereInput! = {}, orderBy: [NovelOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: NovelWhereUniqueInput): [Novel!]!
novelsCount(where: NovelWhereInput! = {}): Int
}
but instead the following is generated:
type Novel {
id: ID!
title: String
originalTitle: String
description: Novel_description_Document
}
type Featured {
id: ID!
novels(where: NovelWhereInput! = {}, orderBy: [NovelOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: NovelWhereUniqueInput): [Novel!]
novelsCount(where: NovelWhereInput! = {}): Int
}
This is also the same for relationship fields, many relationships should create [Novel!]!, not [Novel!].
This means that the field (in this case Novel) cannot return null and that it must resolve to an array and that none of the individuals items inside that array can be null. This makes it much easier to query, as when there is no relation it just returns []
Pretty much most of the schema is generated in such a way that it becomes a minefield of nullable fields because no ! is aded anywhere. Lets take a simple example
Create two lists which are connected:
For the above, the following schema should be generated:
but instead the following is generated:
This is also the same for relationship fields,
many
relationships should create[Novel!]!
, not [Novel!]. This means that the field (in this case Novel) cannot return null and that it must resolve to an array and that none of the individuals items inside that array can be null. This makes it much easier to query, as when there is no relation it just returns[]