-
Notifications
You must be signed in to change notification settings - Fork 153
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
Neo4jError: Invalid input 'WHERE': expected when using auth in specific scenarios - 2 #5497
Comments
Many thanks for raising this bug report @khoi-fish. 🐛 We will now attempt to reproduce the bug based on the steps you have provided. Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:
If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket. Thanks again! 🙏 |
Repo is here: https://github.com/khoi-fish/neo4j-graphql-where-bug Didn't want to deal with secrets so the DB credentials are just plain text variables in the repo settings. @mjfwebb I've added you as a collaborator. I can add others as needed. If anyone has any issues getting things up and running, please let me know. |
We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @khoi-fish! 🙏 We will now prioritise the bug and address it appropriately. |
Minimal reproduction for testing: No data required. Type definitions: type JWT @jwt {
roles: [String!]!
}
type User
@authorization(
validate: [
{ operations: [CREATE, DELETE], where: { jwt: { roles_INCLUDES: "admin" } } }
{ operations: [READ, UPDATE], where: { node: { id: "$jwt.sub" } } }
]
filter: [{ where: { node: { id: "$jwt.sub" } } }]
) {
id: ID!
cabinets: [Cabinet!]! @relationship(type: "HAS_CABINET", direction: OUT)
}
type Cabinet @authorization(filter: [{ where: { node: { user: { id: "$jwt.sub" } } } }]) {
id: ID! @id
categories: [Category!]! @relationship(type: "HAS_CATEGORY", direction: OUT)
user: User! @relationship(type: "HAS_CABINET", direction: IN)
}
type Category @authorization(filter: [{ where: { node: { cabinet: { user: { id: "$jwt.sub" } } } } }]) {
id: ID! @id
files: [File!]! @relationship(type: "HAS_FILE", direction: OUT)
cabinet: Cabinet! @relationship(type: "HAS_CATEGORY", direction: IN)
}
type File {
id: ID! @unique
category: Category @relationship(type: "HAS_FILE", direction: IN)
} Mutation: mutation ($fileId: ID!, $newCategoryId: ID) {
updateFiles(
where: { id: $fileId }
disconnect: {
category: { where: { node: { NOT: { id: $newCategoryId } } } }
}
connect: { category: { where: { node: { id: $newCategoryId } } } }
) {
info {
relationshipsDeleted
relationshipsCreated
}
}
} |
Hey team. I pulled in @angrykoala 's patch into my local env and confirmed that the issue has been fixed. Thanks all 🙏 |
Type definitions
Test data
I've created an AuraDB instance with a throwaway account. Credentials are provided in the repo under Settings -> Secrets and variables -> Actions -> "Variables" tab
Steps to reproduce
https://github.com/khoi-fish/neo4j-graphql-where-bug
How to run dev mode
Create a
.env
file with the following contentsAll variables can be found under this project's Settings -> Secrets and variables -> Actions -> "Variables" tab
Be on Node 20
Run
npm install
Run
npm run dev
a. (optional) Run
npm run dev:debug
to get Cypher outputReproducing the error
localhost:4000/graphql
"Invalid input 'WHERE': expected 'FOREACH', 'CALL' ..."
What happened
Basically the same as #5023. Seems like the original fix didn't catch all cases.
Expected behaviour
Disconnecting
category
fromfile
should not error outVersion
"@neo4j/graphql": "^5.6.0",
Database version
AuraDB Neo4J Version 5
Relevant log output
The text was updated successfully, but these errors were encountered: