-
Notifications
You must be signed in to change notification settings - Fork 154
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
Why ALL is used instead of ANY when converting where query filters to cypher? #190
Comments
Hey @morningcloud, thanks for raising this, and with so much detail to reproduce. I'm still taking in all of the information, but there's definitely something to investigate here. Going to create a branch and make some test cases around the information you've provided, and I'll take it from there. |
So I've created a PR containing the very simple fix for this problem, validated by test cases using the data provided in this issue. Need to get some eyes on it to ensure that this is indeed the appropriate solution for the problem, please feel free to take a look. If we agree to merge, I'm going to recommend we do a patch release containing this fix, as we obviously want to be returning expected data from our library. |
Replace ALL with ANY in whilst querying relationship equality
Now released in 1.0.1: https://github.com/neo4j/graphql/releases/tag/%40neo4j%2Fgraphql%401.0.1 🙂 |
Thank you @darrellwarde, I can confirm that the behaviour is as expected with the latest release 👍🏻 |
@darrellwarde Hey, a bit late to the party, but I think the same behaviour should apply to With the following schema: type User {
id: ID! @id
name: String!
}
type Chat {
id: ID! @id
title: String @readonly
description: String @readonly
users: [User] @relationship(type: "HAS_USER", direction: OUT)
}
extend type Chat
@auth(rules: [
{ operations: [CREATE, READ, UPDATE, DELETE], where: { users: { id: "$jwt.sub" } } }
]) How can I get all On the other hand, I think type Chat {
user: User @relationship(type: "HAS_USER", direction: OUT)
} |
Describe the bug
I have a use case where one node (e.g. User) is linked to multiple nodes of the same label (e.g. User Demographics), each User can be linked to one or more different types of demographics depending on the client the users are under. I wanted to write a query to fetch users that have specific demographic data. But the results I am getting for the related queries is not expected. Below explains the use case and the result I am getting and what I actually expected.
Type definitions
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected to see the result shown in step 6 to be returned when running the query in step 3. I also expected to see all users listed as a result of the query in step 5 since there is an OR operation
System Details:
Additional context
When running server with Debug Logging
DEBUG=@neo4j/graphql:* node src/index.js
I can see the generated cypher for the query is using ALL when I replace ALL with ANY and run the same cypher query in neo4j browser, I get the expected result for both queries. Is it done intentionally? From my perspective it doesn't seem intuitive and I don't feel it would be right to list all the possible demographic types when doing the query as this list can change per client and can get updated over time.The text was updated successfully, but these errors were encountered: