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.
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?
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?
List of enrollments with the state invited. I know the REST API does this well and I could use an SIS file, but I was hoping to start using the graphql API more since that's the direction that they're going, and also I could perhaps do a mutation (that's my intent, i.e. set people as active rather than invited).
In order to get this list, I would paste the json result of your query in a json2csv converter like https://konklone.io/json/ and filter on the state.