room avatar is working (returns other users avatar image if present)

This commit is contained in:
Moriz Wahl 2023-07-17 15:58:46 +02:00
parent b8f0e1ef59
commit edeb22e70c

View File

@ -19,7 +19,12 @@ type Room {
roomId: String! @cypher(statement: "RETURN this.id")
roomName: String! @cypher(statement: "MATCH (this)<-[:CHATS_IN]-(user:User) WHERE NOT user.id = $cypherParams.currentUserId RETURN user.name")
avatar: String @cypher(statement: "MATCH (this)<-[:CHATS_IN]-(user:User) WHERE NOT user.id = $cypherParams.currentUserId RETURN user.avatar.url")
avatar: String @cypher(statement: """
MATCH (this)<-[:CHATS_IN]-(user:User)
WHERE NOT user.id = $cypherParams.currentUserId
OPTIONAL MATCH (:User)-[:AVATAR_IMAGE]->(image:Image)
RETURN image.url
""")
lastMessageAt: String