You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to use filter that says "where an array field is non-empty"? For example this schema:
type Person {
name: String!
friends: [Person!]! @relation(name:"knows",direction:OUT)
pets: [Pet!] @relation(name:"knows",direction:OUT)
}
type Pet {
name: String!
}
I'm struggling to come up with a filter that only returns the Persons that have at least one [:knows]-(:Person) relationship. Based on the generated cypher It seems like friends_not: null is the intended way to do this:
MATCH (`person`:`Person`)
WHERE ( (`person`)-[:`knows`]->())
RETURN graphql.labels(`person`) AS `_labels`,
`person`.`name` AS `name`,
[ (`person`)-[:`knows`]->(`person_friends`:`Person`) | `person_friends` {`_labels` : graphql.labels(`person_friends`), .`name`}] AS `friends`,
[ (`person`)-[:`knows`]->(`person_pets`:`Pet`) | `person_pets` {`_labels` : graphql.labels(`person_pets`), .`name`}] AS `pets`
The key being WHERE ( (person)-[:knows]->()) but since the second node doesn't have a label the following query:
{
Person (filter: { friends_not: null}) {
name
friends {
name
}
pets {
name
}
}
}
Similar to neo4j-graphql-java#27.
Is it possible to use
filter
that says "where an array field is non-empty"? For example this schema:on a db with:
I'm struggling to come up with a
filter
that only returns thePerson
s that have at least one[:knows]-(:Person)
relationship. Based on the generated cypher It seems likefriends_not: null
is the intended way to do this:The key being
WHERE ( (person)-[:knows]->())
but since the second node doesn't have a label the following query:gives me:
The text was updated successfully, but these errors were encountered: