From d7b1ea88c4dddd9de6df7cefdfb68e0ff2418038 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Tue, 5 Mar 2019 11:18:59 +0100 Subject: [PATCH] Fixed shouts and follows --- src/schema.graphql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/schema.graphql b/src/schema.graphql index e5a077f2d..f95bbb18a 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -13,9 +13,9 @@ type Mutation { "Shout the given Type and ID" shout(id: ID!, type: ShoutTypeEnum): String! @cypher(statement: """ - MATCH (n {id: $id}) + MATCH (n {id: $id}), (u:User {id: $cypherParams.currentUserId}) WHERE $type IN labels(n) - MERGE (:User {id: $cypherParams.currentUserId})-[r:SHOUTED]->(n) + MERGE (u)-[r:SHOUTED]->(n) RETURN COUNT(r) > 0 """) "Unshout the given Type and ID" @@ -28,9 +28,9 @@ type Mutation { "Follow the given Type and ID" follow(id: ID!, type: FollowTypeEnum): Boolean! @cypher(statement: """ - MATCH (n {id: $id}) + MATCH (n {id: $id}), (u:User {id: $cypherParams.currentUserId}) WHERE $type IN labels(n) AND NOT $id = $cypherParams.currentUserId - MERGE (:User {id: $cypherParams.currentUserId})-[r:FOLLOWS]->(n) + MERGE (u)-[r:FOLLOWS]->(n) RETURN COUNT(r) > 0 """) "Unfollow the given Type and ID"