field_every: FilterCondition # condition must be true for all nodes
field_some: FilterCondition # condition must be true for at least 1 node
field_none: FilterCondition # condition must be false for all nodes
field_is_null: Boolean # is the relation field null
# Get all Friends that are not in Group A and not in Group B and attend Event X
User(id: me){
friends(filter:{AND: [
{groups_every: {id_not: "group-a-id"}},
{groups_every: {id_not: "group-b-id"}},
{attended_some: {id: "event-x-id"}}
]})
}
# Get all Users that are in two groups A and B where the current user is also a member of A and B
allUsers(filter:{AND:[
{groups_every: {id: "group-a-id", members_some: {id_neq: "current-user-id"}}},
{groups_every: {id: "group-v-id", members_some: {id_neq: "current-user-id"}}}
]})
# All pictures where the author is not my friend.
allPictures(filter: { author { friends_every: { id_not: “my_id” } } })
# All pictures without author.
allPictures(filter: { author_is_null: true })
# All pictures with author.
allPictures(filter: { author_is_null: false })
Thanks Phil!
Your "missing" requirement is a little cumbersome to do with GraphQL, but is clearly possible as long as you accept a limit to the nesting. To get 5 levels you could make this query: