cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Relationships in @neo4j/graphql 3.6, using Movies database

Hi all, 

As I was following this tutorial https://neo4j.com/developer/graphql/, 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.
 
Cheers,
Chaka
2 REPLIES 2

sdfa

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