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 """)