Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-07-2022 10:03 PM
How can you filter a custom field?
Say i have a field in my type definition using @cypher directive:
type Ticket {
id: String
title: String
date: DateTime @cypher(statement: "RETURN datetime(this.timestamp)")
}
Querying this is fine, however, if I try to filter it:
tickets (where: {date_GT: $from_date}) {
title
date
}
I get "date_GT" is not defined by type "TicketWhere"
01-05-2023 04:07 PM
Cypher directive fields are not added to the generated where filter argument because the field values would need to be computed for each node in the database at query time which would be prohibitively expensive in most cases. You could potentially add a query field using the Cypher directive that has the filtering logic defined in Cypher to accomplish this.
All the sessions of the conference are now available online