Graphql query to return enrollments in a known course with a specific status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2021
10:02 AM
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
}
}
}
}
}
Solved! Go to Solution.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2021
06:31 AM
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?