GraphQL Error

Current version of grandstack, neo4j 4.0.3 community edition

When I try to call a listing page, I get this error message (in the browser):

react_devtools_backend.js:6 [GraphQL error]: Message: LIMIT: Invalid input. '10.0' is not a valid value. Must be a non-negative integer., Location: [object Object], Path: Artikel

Seems to be a driver error, but hard to track down. The API doesn't mention an error, the generated query is:

MATCH (`user`:`User`) WITH `user` ORDER BY user.name ASC RETURN `user` { .id , .name ,avgStars: apoc.cypher.runFirstColumn("MATCH (this)-[:WROTE]->(r:Review) RETURN toFloat(avg(r.stars))", {this: user}, false),numReviews: apoc.cypher.runFirstColumn("MATCH (this)-[:WROTE]->(r:Review) RETURN COUNT(r)", {this: user}, false)} AS `user` LIMIT $first
{
  "offset": 0,
  "first": 10,
  "filter": {}
}

The $first (int) argument is obviously converted to a string further down the line.
How can I avoid this error?

TIA, best regards,
Christoph

1 Like

I also have the same issue , can anybody help?

I was reading and i found this https://github.com/neo4j/neo4j-javascript-driver/issues/547 , i think that we need to put

LIMIT neo4j.int($first)

, I tried but i dont work, im' doing this on schema.grapql

@pingelsan I Did an

npm update

on the API folder and the error was solved.

Thank you, I'll give it a try! Hopefully it's so easy. (The error appeared a day or two after I did npm install, so that's a little weird.)