cancel
Showing results for 
Search instead for 
Did you mean: 
Surveyor

Get all users per enrollment type via GraphQL API

Hey guys,

I'd like to take a paginated list of users associated with my account filtered by enrollment type. With the REST API, I've been using /api/v1/accounts/:account_id/users?enrollment_type[]={type}. Could you please assist me to get the same result with your GraphQL API?

Thanks

Tags (2)
0 Kudos
2 Replies
Surveyor II

It looks like you can only get a list of users for a course from GraphQL.  The Account object currently has no users connection.

Surveyor II

You cannot use enrollment_type as an argument, but you can retrieve the users with enrollment_type via the courses of an account:

query MyQuery {
  account(id: "5") {
    coursesConnection {
      nodes {
        enrollmentsConnection {
          nodes {
            type
            user {
              email
            }
          }
        }
      }
    }
  }
}