neo4j-graphql-js
neo4j-graphql-js copied to clipboard
Response type for autogenerated queries should be non-null array on non-null types
The autogenerated queries are currently returning nullable lists of nullable types. For example, if I've defined the following type:
type Song {
id: ID!
name: String!
artists: [Artist!]! @relation(name: "BY_ARTIST", direction: "OUT")
albums: [Album!]! @relation(name: "IN_ALBUM", direction: "OUT")
}
The following query would be generated:
Song(
id: ID
name: String
_id: String
first: Int
offset: Int
orderBy: _SongOrdering
): [Song]
However, the return type should instead be [Song!]! since it will always return a non-null array, and the items in the array will always be of non-null type Song.
https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608