Disable shouting of own content

This commit is contained in:
Grzegorz Leoniec 2019-03-05 14:18:22 +01:00
parent c27204d56e
commit 45a004662f
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377

View File

@ -13,8 +13,8 @@ type Mutation {
"Shout the given Type and ID"
shout(id: ID!, type: ShoutTypeEnum): String! @cypher(statement: """
MATCH (n {id: $id}), (u:User {id: $cypherParams.currentUserId})
WHERE $type IN labels(n)
MATCH (n {id: $id})<-[:WROTE]-(wu:User), (u:User {id: $cypherParams.currentUserId})
WHERE $type IN labels(n) AND NOT wu.id = $cypherParams.currentUserId
MERGE (u)-[r:SHOUTED]->(n)
RETURN COUNT(r) > 0
""")