Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site maintenance this Wednesday, February 1. Disruptions expected as we migrate the forums.

Relationships in @neo4j/graphql 3.6, using Movies database

Node Link

Hi all, 

As I was following this tutorial, I noticed something in the latest JavaScript graphql driver. Namely, when I change the relation definitions on the Movies ACTED_IN relationship in the typeDef from "actors: [Person!]!" to "actors: [Person]", I get the error message: 

Error: List type relationship fields must be non-nullable and have non-nullable entries, please change type of Movie.actors to [Person!]!
However, when I try to create a movie (using the required [Person!]! in the typeDef) without a "ACTED_IN" relationship in the GraphQL playground, using the auto-generated createMovies mutation, that seems to work fine. This is also confirmed in Neo4j Browser.
This is actually my preferred behavior, but am I correct to see that this is a deviation from the normally strictly strongly typed GraphQL convention (e.g. forcing fields denoted by ! to be required at all times)? Is this because it has the @relationship directive, or does this have a different reason?
Love the package, trying to understand it more deeply.

Node Link


Node Link

@William_Lyon It's been some time ago that I commented the above. Do you perhaps have some input on this? Really wondering!