diff --git a/backend/src/schema/types/type/Room.gql b/backend/src/schema/types/type/Room.gql index 76823d364..9950407b7 100644 --- a/backend/src/schema/types/type/Room.gql +++ b/backend/src/schema/types/type/Room.gql @@ -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