From 45a004662f1fad9d206fc3ddf4fd7b5c3b0c614f Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Tue, 5 Mar 2019 14:18:22 +0100 Subject: [PATCH] Disable shouting of own content --- src/schema.graphql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schema.graphql b/src/schema.graphql index f95bbb18a..e6e2088f1 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -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 """)