cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

apoc functions and qraphql problem

dlyberis
Node Link

I have the following cypher query which works as expected when run from neo4j browser. Some of the data are returned as null when run from graphql query. Cypher query  includes custom apoc functions, which are not shown in the code below.  

profile call n10s.inference.nodesLabelled('Entity', {catNameProp: "label", catLabel: "Resource", subCatRel: "SCO" }) YIELD node 
unwind labels(node) as label
with collect(distinct label) as labels, localdatetime({timezone: 'Europe/Athens'}) as now
match (a)-[:hasSensor*0..1]-()-[:hasSensorProperty]->(b:SensorProperty)
where any(i in labels where i in labels(a))
AND (((b.name in ["no2","so2","o3"]) AND (LocalDateTime(b.timestamp) >= now-duration({hours:1}))) or ((b.name in ["pm2.5","pm10"]) AND (LocalDateTime(b.timestamp) >= now-duration({hours:24}))))
with a.name as Entity, b.name as measurement, avg(b.value) as value
with Entity, custom.AQI(measurement, value) as measurement_AQI
return {name:Entity, AQI:["Good","Fair","Moderate","Poor","Very Poor","Extremely Poor"][max(measurement_AQI)]}

Data returned from browser

[
 {
  "name": "Iot_Entity_1727202",
  "aqi": "Extremely Poor"
 },
 {
 "name": "Iot_Entity_1270095",
  "aqi": "Extremely Poor",
 }
]

Data return from graphql query

[
 {
	"name": "Iot_Entity_1727202",
	"aqi": null
 },
 {
	"name": "Iot_Entity_1270095",
	"aqi": null
 }
]

I use neo4j (4.4.15) and @neo4j/graphql (3.12.0).

Any help appreciated.

1 REPLY 1

IDK if these are related. I also get Different results when using APOC in GraphQL vs. Neo4j Browser. I'm using Aura.