'Why using the count function in neo4j with graphql returns two values called low and high?
If I execute the following cypher in Neo4j browser returns the expected values
MATCH (n:Document)
RETURN {
year: n.year ,
countdocs : COUNT(n)
}
Result:
{"countdocs":3,"year":"2018"}
But If I execute the same cypher in neo4j-graphql
type Query {
totalActivityOverTime: [JSONObject] @cypher(statement: """
MATCH (n:Document)
RETURN {
year: n.year ,
countdocs : COUNT(n)
}
""")
}
returns :
{
"countdocs": {
"low": 3,
"high": 0
},
"year": "2018"
},
What means the values low and high?
Thanks!
Solution 1:[1]
Thanks to @Sbunzini and @stdob-- I found the solution:
Schema:
type Activity{
year: String
countdocs: Int
}
type Query {
totalActivityOverTime: [Activity] @cypher(statement: """
MATCH (n:Document)
RETURN {
year: n.year ,
countdocs : COUNT(n)
}
""")
}
GraphQL:
{
totalActivityOverTime{
year
countdocs
}
}
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | nguaman |
