type User {
userId: ID!
mail: String!
password: String! @private
meals: [Meal!] @relationship(type: "IN_MEALS", direction: OUT)
}
type Meal {
name: String!
createdBy: User! @relationship(type: "IN_MEALS", direction: IN)
}
The relationship is made in neo4j and when I query all users but when I use this custom query for the custom users, meals are defined as null I don't know why
type Query {
currentUser: User
@cypher(
statement: """
MATCH (u:User {userId: $auth.jwt.userId})
OPTIONAL MATCH (u)-[r:IN_MEALS]->(m:Meal)
RETURN u,r,m
"""
)
}
When I do this query in graphql
{
currentUser {
userId
mail
meals {
name
}
}
}
It tells me that meals are null but they are not ...
Hi! it's been a week struggling with this issue, I've posted twice on stack overflow and finally somobody advised me to report this as a bug since There's nothing that looks wrong https://stackoverflow.com/questions/69775011/how-to-query-relationships-of-neo4j-with-custom-query-with-cypher-using-grandsta/69779442?noredirect=1#comment123345818_69779442
So I have these models :
The relationship is made in neo4j and when I query all users but when I use this custom query for the custom users, meals are defined as null I don't know why
It tells me that meals are null but they are not ...
I know that by looking into my neo4j database and also because when I query all users
I can see the values in meals :
Thanks in advance and don't hesitate to ask for more informations