Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-10-2020 04:53 AM
Hello,
I'm running a very simple graphql query via the graphql cli tool.
I get the error: "Cannot read property 'isInt' of undefined".
Any idea why?
query test($name: String) {
Person(name: $name) {
first,
last
}
}
Thanks
03-10-2020 04:55 AM
Hello Eric, I see you're using a function with parameters are you correctly passing those in via the graphiql tools? You might want to try manually passing the parameter to ensure that it's working that way.
03-10-2020 04:58 AM
I invoke the cli tool as follow:
graphql query test "Joe smith"
It's working fine using the grahpql service in a browser.
03-10-2020 05:14 AM
What does your GraphQL Schema look like? I'm assuming:
type Person {
firstName: String,
lastName: String
}
If that's the case you need to have a corresponding variable in your query, with what you currently have it I think it would be:
query test($name: String){
Person(first: $name){
first,
last}
}
I'm not sure your schema is quite matching up with your query.
03-10-2020 05:21 AM
The query matches the schema. It works using the graphql service in a browser but not with the cli tool. It seems something is not configured properly with the cli tool. That's the stacktrace I get:
"TypeError: Cannot read property 'isInt' of undefined",
" at /app/node_modules/neo4j-graphql-js/dist/utils.js:224:25",
" at baseClone (/app/node_modules/neo4j-graphql-js/node_modules/lodash/lodash.js:2627:67)",
" at Function.cloneDeepWith (/app/node_modules/neo4j-graphql-js/node_modules/lodash/lodash.js:11121:14)",
" at extractQueryResult (/app/node_modules/neo4j-graphql-js/dist/utils.js:223:31)",
" at _callee$ (/app/node_modules/neo4j-graphql-js/dist/index.js:114:76)",
" at tryCatch (/app/node_modules/@babel/runtime-corejs2/node_modules/regenerator-runtime/runtime.js:45:40)",
" at Generator.invoke [as _invoke] (/app/node_modules/@babel/runtime-corejs2/node_modules/regenerator-runtime/runtime.js:271:22)",
" at Generator.prototype. [as next] (/app/node_modules/@babel/runtime-corejs2/node_modules/regenerator-runtime/runtime.js:97:21)",
" at asyncGeneratorStep (/app/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js:5:24)",
" at _next (/app/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js:27:9)"
03-10-2020 05:31 AM
How are you passing the variable? Here's an example from a project I've worked on so it won't match your query of course:
03-10-2020 07:01 AM
Thanks for your replies. I figured it out. I needed to clear the npm cache and reinstall core-js. It's working now
03-10-2020 08:31 AM
Glad you got it working.
All the sessions of the conference are now available online