mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
trying last message prop in room
This commit is contained in:
parent
032bca1b64
commit
5376e171bd
@ -131,13 +131,17 @@ describe('Message', () => {
|
||||
})
|
||||
|
||||
describe('room is updated as well', () => {
|
||||
it('has last message at set', async () => {
|
||||
it('has last message set', async () => {
|
||||
await expect(query({ query: roomQuery() })).resolves.toMatchObject({
|
||||
errors: undefined,
|
||||
data: {
|
||||
Room: [
|
||||
expect.objectContaining({
|
||||
lastMessageAt: expect.any(String),
|
||||
lastMessage: expect.objectContaining({
|
||||
id: expect.any(String),
|
||||
content: 'Some nice message to other chatting user',
|
||||
})
|
||||
}),
|
||||
],
|
||||
},
|
||||
|
||||
@ -17,6 +17,8 @@ type Room {
|
||||
avatar: String! @cypher(statement: "MATCH (this)<-[:CHATS_IN]-(user:User) WHERE NOT user.id = $cypherParams.currentUserId RETURN user.avatar.url")
|
||||
|
||||
lastMessageAt: String
|
||||
|
||||
lastMessage: Message @cypher(statement: "MATCH (this)<-[:INSIDE]-(message:Message) RETURN message ORDER BY message.createdAt DESC LIMIT 1")
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user