graphprotocol / support

Community support for the Hosted Service of The Graph
https://thegraph.com/
10 stars 3 forks source link

Request feature: Find empty lists using where clauses #31

Open Amxx opened 5 years ago

Amxx commented 5 years ago

Let's say I have the following entries:

type Task @entity {
    id: ID!
    deal: Deal!
    ...
}
type Deal @entity {
    id: ID!
    tasks: [Task!]! @derivedFrom(field: "deal")
}

I would like to select all deals that don't have any tasks. I tried to do

deals(where: { tasks: [] }) { ... }

but it gives me "message": "Invalid value provided for argumentwhere: Object({\"tasks\": List([])})"

Would it be possible to use where clause to find empty lists, or (more powerfull) to be able to compare length like where: {tasks_length_lt: 10} (to get deals with less then 10 tasks)