From a978591843f4d66aa48560b479f2fd5caccd17c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Fri, 7 Jun 2019 01:32:54 +0200 Subject: [PATCH] Fix bug introduced in 6f0447515 @ulfgebhardt For the `deleted` and `disabled` flags I would be glad if we could take only one value, that is `true`, in case the post is considered disabled or deleted respectively. There might be more bugs like this now. Please keep in mind that these counts are also used as total limits for pagination and you break the pagination if you change the cypher statement. --- backend/src/schema/types/type/User.gql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index 6bfb9b986..6836f16fe 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -56,8 +56,7 @@ type User { contributionsCount: Int! @cypher( statement: """ MATCH (this)-[:WROTE]->(r:Post) - WHERE (NOT exists(r.deleted) OR r.deleted = false) - AND (NOT exists(r.disabled) OR r.disabled = false) + WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r) """ ) @@ -78,4 +77,4 @@ type User { badges: [Badge]! @relation(name: "REWARDED", direction: "IN") badgesCount: Int! @cypher(statement: "MATCH (this)<-[:REWARDED]-(r:Badge) RETURN COUNT(r)") -} \ No newline at end of file +}