mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Added followedByCurrentUser and shoutedByCurrentUser
This commit is contained in:
parent
257183ac3f
commit
f39e27c47c
@ -92,6 +92,12 @@ type User {
|
|||||||
followedBy: [User]! @relation(name: "FOLLOWS", direction: "IN")
|
followedBy: [User]! @relation(name: "FOLLOWS", direction: "IN")
|
||||||
followedByCount: Int! @cypher(statement: "MATCH (this)<-[:FOLLOWS]-(r:User) RETURN COUNT(DISTINCT r)")
|
followedByCount: Int! @cypher(statement: "MATCH (this)<-[:FOLLOWS]-(r:User) RETURN COUNT(DISTINCT r)")
|
||||||
|
|
||||||
|
"Is the currently logged in user following that user?"
|
||||||
|
followedByCurrentUser: Boolean! @cypher(statement: """
|
||||||
|
MATCH (this)<-[:FOLLOWS]-(u:User {id: $cypherParams.currentUserId})
|
||||||
|
RETURN COUNT(u) >= 1
|
||||||
|
""")
|
||||||
|
|
||||||
#contributions: [WrittenPost]!
|
#contributions: [WrittenPost]!
|
||||||
#contributions2(first: Int = 10, offset: Int = 0): [WrittenPost2]!
|
#contributions2(first: Int = 10, offset: Int = 0): [WrittenPost2]!
|
||||||
# @cypher(
|
# @cypher(
|
||||||
@ -150,6 +156,12 @@ type Post {
|
|||||||
|
|
||||||
shoutedBy: [User]! @relation(name: "SHOUTED", direction: "IN")
|
shoutedBy: [User]! @relation(name: "SHOUTED", direction: "IN")
|
||||||
shoutedCount: Int! @cypher(statement: "MATCH (this)<-[:SHOUTED]-(r:User) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(DISTINCT r)")
|
shoutedCount: Int! @cypher(statement: "MATCH (this)<-[:SHOUTED]-(r:User) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(DISTINCT r)")
|
||||||
|
|
||||||
|
"Has the currently logged in user shouted that post?"
|
||||||
|
shoutedByCurrentUser: Boolean! @cypher(statement: """
|
||||||
|
MATCH (this)<-[:SHOUTED]-(u:User {id: $cypherParams.currentUserId})
|
||||||
|
RETURN COUNT(u) >= 1
|
||||||
|
""")
|
||||||
}
|
}
|
||||||
|
|
||||||
type Comment {
|
type Comment {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user