refactor(backend): fix is muted by me query (#8365)

* use EXISTS for isMutedByMe

* corrected query in gql

---------

Co-authored-by: mahula <lenzmath@posteo.de>
This commit is contained in:
Ulf Gebhardt 2025-04-15 18:17:13 +02:00 committed by GitHub
parent 2d8fe8a941
commit 4bd42009fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -440,7 +440,7 @@ export default {
},
boolean: {
isMutedByMe:
'MATCH (this)<-[:MUTED]-(related:User {id: $cypherParams.currentUserId}) RETURN COUNT(related) >= 1',
'MATCH (this) RETURN EXISTS( (this)<-[:MUTED]-(:User {id: $cypherParams.currentUserId}) )',
},
}),
},

View File

@ -42,9 +42,7 @@ type Group {
posts: [Post] @relation(name: "IN", direction: "IN")
isMutedByMe: Boolean!
@cypher(
statement: "MATCH (this)<-[m:MUTED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(m) >= 1")
isMutedByMe: Boolean! @cypher(statement: "MATCH (this) RETURN EXISTS( (this)<-[:MUTED]-(:User {id: $cypherParams.currentUserId}) )")
}