-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to find Types based on prefix of parent nodes #620
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your example queries work really well 👍
It would be great to also support:
query GetAllItems {
types(filter: { pathPattern: "*" }) {
prefix
path
revisions {
revision
spec {
additionalRefs
}
}
}
}
Or, if that not easy to implement, at least return some user-friendly error (that this is not supported/implemented), because currently we have an exception returned:
{
"data": {},
"errors": [
{
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"code": "Neo.ClientError.Procedure.ProcedureCallFailed",
"name": "Neo4jError",
"stacktrace": [
"Neo4jError: Failed to invoke function `apoc.cypher.runFirstColumn`: Caused by: org.neo4j.exceptions.InvalidSemanticsException: Invalid Regex: Dangling meta character '*' near index 0",
"*",
"^",
"",
" at captureStacktrace (/app/node_modules/neo4j-driver-core/lib/result.js:239:17)",
" at new Result (/app/node_modules/neo4j-driver-core/lib/result.js:59:23)",
" at newCompletedResult (/app/node_modules/neo4j-driver-core/lib/transaction.js:375:12)",
" at Object.run (/app/node_modules/neo4j-driver-core/lib/transaction.js:229:20)",
" at Transaction.run (/app/node_modules/neo4j-driver-core/lib/transaction.js:101:34)",
" at _callee3$ (/app/node_modules/neo4j-graphql-js/dist/index.js:226:35)",
" at tryCatch (/app/node_modules/regenerator-runtime/runtime.js:63:40)",
" at Generator.invoke [as _invoke] (/app/node_modules/regenerator-runtime/runtime.js:294:22)",
" at Generator.next (/app/node_modules/regenerator-runtime/runtime.js:119:21)",
" at asyncGeneratorStep (/app/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js:5:24)"
]
}
},
"message": "Failed to invoke function `apoc.cypher.runFirstColumn`: Caused by: org.neo4j.exceptions.InvalidSemanticsException: Invalid Regex: Dangling meta character '*' near index 0\n*\n^",
"path": [
"types"
]
}
]
}
In general, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works flawlessly 👍
Description
Changes proposed in this pull request:
Add support to find Types based on prefix of parent nodes
Update
hub-js
development documentationPopulate additionalRefs to database, so it can be returned on GraphQL side
Add integration tests to test that Types are properly returned:
Fix bug that for current
main
version (43c7400) where no entries are returned for empty filter:Problem: The Go JSONMarshaler marshals nil
pathPattern
asnull
which was not handled properly in Cyper query.Testing
Integration test proves that it works.
To check that manually, you can test it directly with Public Hub:
Run Neo4j:
Populate database:
make build-tool-populator
NOTE: ensure that you use newly built populator!
Run Public Hub:
Run queries (e.g. use Insomnia):
Related issue(s)