Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Support for Neo4j v3.4.0 #53

Closed
cooperka opened this issue May 29, 2018 · 6 comments
Closed

Support for Neo4j v3.4.0 #53

cooperka opened this issue May 29, 2018 · 6 comments

Comments

@cooperka
Copy link
Contributor

cooperka commented May 29, 2018

I just upgraded to Neo4j v3.4.0 and some queries no longer work. It looks like this lib is already being tested on v3.4.0 but tests are failing with the same error I'm getting. It seems related to the use of @cypher directives.

Example errors, taken from my own app as well as the CI tests here:

My schema:

currRequests: [Request]! @cypher(statement: "MATCH (u:User {id: $id})-[:REQUESTED]->(r:Request) RETURN r")

Leads to:

Error: GraphQL error: Type mismatch: expected List<T> but was Any (line 1, column 159 (offset: 158))
"WITH apoc.cypher.runFirstColumn("MATCH (u:User {id: $id})-[:REQUESTED]->(r:Request) RETURN r", {id:"53514f78-fa7c-4e67-810f-ed9e39d9fff3"}, True) AS x UNWIND x AS request"
                                                                                                                                                               ^

integration › Handle @cypher directive on QueryType:

Error: GraphQL error: Type mismatch: expected List<T> but was Any (line 1, column 154 (offset: 153))
"WITH apoc.cypher.runFirstColumn("MATCH (g:Genre) WHERE toLower(g.name) CONTAINS toLower($substring) RETURN g", {substring:"Children"}, True) AS x UNWIND x AS genre"
                                                                                                                                                          ^

integration › GraphQL query with @cypher directive:

Error: GraphQL error: Type mismatch: expected List<T> but was Any (line 1, column 185 (offset: 184))
"MATCH (movie:Movie {title:"River Runs Through It, A"}) RETURN movie { .title ,actors: [(movie)<-[:ACTED_IN]-(movie_actors:Actor) | movie_actors { .name }] ,similar: [ movie_similar IN apoc.cypher.runFirstColumn("WITH {this} AS this MATCH (this)--(:Genre)--(o:Movie) RETURN o LIMIT {limit}", {this: movie, first: 3, offset: 0, limit: 5}, true) | movie_similar { .title }][..3] } AS movie SKIP 0"
                                                                                                                                                                                         ^
@johnymontana
Copy link
Contributor

Thanks for reporting @cooperka

This seems to be a bug in APOC and will need to be fixed there. I've opened this issue in APOC to track: neo4j-contrib/neo4j-apoc-procedures#819

@cooperka
Copy link
Contributor Author

cooperka commented Jun 6, 2018

Thanks @johnymontana! Sadly those issues doesn't look very active at all 😿 Is there anywhere (e.g. README) that documents the current Neo4j version supported by this lib? Might be good to point this out so new users aren't confounded.

@Yuri2b
Copy link

Yuri2b commented Jun 24, 2018

I just upgraded to 3.4.1 in Neo4j Desktop and with APOC 3.4.0.1, and this type of @cypher directive is working as expected, without "Type mismatch: expected List"

@cooperka
Copy link
Contributor Author

cooperka commented Jun 24, 2018

Thanks for the update @Yuri2b! It looks like CircleCI is already using APOC v3.4.0.1 and still failing with the same error (see APOCH_VERSION in https://github.com/neo4j-graphql/neo4j-graphql-js/blob/master/.circleci/config.yml). I'm not sure what the disparity might be.

Edit: It's on Neo4j 3.4.0; I submitted a PR to upgrade that so we'll see.

@cooperka
Copy link
Contributor Author

Verified successful. I'll let that PR automatically close this issue on merge. Thanks again @Yuri2b.

@johnymontana
Copy link
Contributor

I hadn't realized this was resolved in Neo4j 3.4.1 - we were planning a workaround fix in APOC, but great to see it resolved in Neo4j. It seems one unrelated 3.4 integration test is still failing (which I'll fix tomorrow), but the others look good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants