is it possible to take a count from a nested query...
# prisma-whats-new
r
is it possible to take a count from a nested query with 2 filters?
a
Yes, it should. Can you share the query?
r
just a sec
Copy code
query {
  User(id: "cj87egci6m7140120ajyq2bje") {
  	firstName
    lastName
    profilePicture
    updates(last: 10) {
      id
      text
      challenge {
        id
      }
    }
    completed: updates(filter: {
    status: Completed}){
      challenge {
        difficulty
      }
    }
  }
}
I would like in the completed section to filter the challenges on status
so count the updates that have status completed
and from those, take the count of those who have a linked challenge of difficulty 'easy' for example
if that makes sense 🙂
a
Not really, I'm sorry
r
so I have a user who has different updates
a
Could you post this on https://graph.cool/forum along with your schema?
r
Ill try to explain it here before I post it tho, I have a user who has many updates. These updates all have a status (enum) and all have a challenge entity linked to them. This challenge also has an enum called difficulty. For one user, I would like to see how many updates have the status of 'Completed' and have a challenge with status 'Easy' for example.
So it's nested in 2 levels I guess
does that make more sense? 🙂