A query that works just fine in the neo4j desktop browser does not return the expected results when ran through graphql and apoc procedures.
Here is my schema in graphql
byParent(id: Int): [movie]
@cypher(
statement: "MATCH (movie:movie)-->(c:movie) WHERE ID(movie)=$id RETURN c"
)
Here is the graphql query
query {
byParent(id: 108) {
_id
}
}
Here is the generated apoc output in my console
WITH apoc.cypher.runFirstColumn("MATCH (movie:movie)-->(c:movie) WHERE ID(movie)=$id RETURN c", {id:$id}, True) AS x UNWIND x AS movie
RETURN movie {_id: ID(movie)} AS movie SKIP $offset
{ offset: 0, first: -1, id: 108 }
When ran through graphql I always get an empty array but the same query in the browser gives my the expected results (just swapping out the dynamic {id:$id}
for {id:108}
and changing WITH to RETURN)
RETURN apoc.cypher.runFirstColumn("MATCH (movie:movie)-->(c:movie) WHERE ID(movie)=$id RETURN c", {id:108}, True)
I am not sure if the error is with apoc, graphql or the way i am defining schema / writing the query but the fact I can run the generated query with some minor modification in the browser confuses me. I would love some clarification on this