-
Notifications
You must be signed in to change notification settings - Fork 149
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
Generate filters for primitive/relational cypher fields #554
Labels
enhancement
New feature or request
Comments
Here is another example use case, currently not possible but seemingly common: type Design {
pv_count: Int @cypher(statement:"""
MATCH (this)-[:HAS_SYSTEM]->(p:PressureVessel)
RETURN count(p)
""")
} {
designs(where:{pv_count_GT:0}) {
pv_count
}
}
```
|
Is there an alternative we should do for these fields in the meantime? Would it help if we make those @ computed instead or use @ callback on fields or other nodes they require to update their values? |
Any updates on this since the cypher directive no longer relies on runFirstColumnMany? |
This was referenced Oct 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The library does not currently generate filters for cypher fields.
Given a simple schema like
A caller may want to filter authors by those whose most recent book year was later that a certain year, either based on the date on the Book returned by the "mostRecentBook" cypher statement, or the lastPublishedYear field which returns the year as a primitive.
Currently filters are not generated for cypher fields, requiring the
lastPublishedYear
value to be denormalized into a property on the parent Author(s) in order to have the graphQL filter generated.From looking at the code, it seems that cypher fields are evaluated in the final return statement whereas filters are evaluated as part of the initial MATCH against the type being queried. To support filtering on cypher queries, any cypher field which is being filtered against would need to be evaluated earlier in the executed query, and then included in the return result. It would be desirable to evaluate filter cypher fields to be evaluated as early as possible to stop further evaluation for matches which are filtered out.
Describe the solution you'd like
The library should generate GraphQL filters for both primitive and relational cypher fields as it does for non-cypher fields and relationships.
Describe alternatives you've considered
Currently the only solution I have found is to denormalize fields I wish to filter on into the related nodes and maintain these denormalized values every time the ground truth nodes are updated.
The text was updated successfully, but these errors were encountered: