graphql
graphql copied to clipboard
Add INCLUDES-SOME, -ALL, -NONE and -SINGLE filter for scalar-arrays fields
Given the following schema:
type Movie {
id: ID
test: [String!]
}
the following additional where-fields should get generated:
input MovieWhere {
test_INCLUDES_SOME: [String!]
test_INCLUDES_ALL: [String!]
test_INCLUDES_NONE: [String!]
test_INCLUDES_SINGLE: [String!]
// already existing filters
test: [String!]
test_NOT: [String!]
test_INCLUDES: String @deprecated(reason : "Use `test_INCLUDES_SOME` instead.")
test_NOT_INCLUDES: String @deprecated(reason : "Use `test_INCLUDES_NONE` instead.")
// rest of the where fields ...
}
The following cypher will be generated:
INCLUDES_SOME
... WHERE any(x IN movie.test WHERE x IN $param0) ...
INCLUDES_ALL
... WHERE all(x IN movie.test WHERE x IN $param0) ...
INCLUDES_NONE
... WHERE none(x IN movie.test WHERE x IN $param0) ...
INCLUDES_SINGLE
... WHERE single(x IN movie.test WHERE x IN $param0) ...
This would align array fields to be handled in the same way as relations.
the following fields can be marked deprecated or kept as convenience fields:
- test_INCLUDES: String -> Use
test_INCLUDES_SOME
instead - test_NOT_INCLUDES: String Use
test_INCLUDES_NONE
instead
see also: https://github.com/neo4j-graphql/neo4j-graphql-java/pull/285