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.
This commit is contained in:
Robert Schäfer 2019-06-07 01:32:54 +02:00
parent 574b42a2a7
commit a978591843

View File

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