Graphql query to return enrollments in a known course with a specific status

Jump to solution
dtod
Community Contributor

I can write a query that returns all the enrollments in a known course (see below), but how would you write something that only returned enrollments whose status was "invited"? It should be possible, but I'm banging my head against a brick wall on this. 

query MyQuery {
  course(id: "179404") {
    enrollmentsConnection {
      nodes {
        state
        user {
          name
        }
      }
    }
  }
}

 

Labels (1)
0 Likes
1 Solution
werner_huysman1
Community Participant

Hi, I don't think it is possible to use state as a filter. I believe your only option is to filter the result while parsing the json response. Are you using the query in an application, or are just looking for a list of enrollments with the state invited?

View solution in original post

0 Likes