Users & Participants

Institution and course owner

Users exist in a variety of levels in Eduflow. Institutions and courses allow direct access to their owner. In GraphQL, these are associated with the User object type.

Institution owner

Query
Response
Query
{
institution {
name
owner {
name
email
}
}
}
Response
{
"data": {
"institution": {
"name": "Dunder Mifflin",
"owner": {
"name": "Michael Scott",
"email": "[email protected]"
}
}
}
}

Course owner

Query
Response
Query
{
course(id: "00000000-5945-95c7-65fd-a9747b200320") {
owner {
name
email
}
}
}
Response
{
"data": {
"course": {
"owner": {
"name": "John Smith",
"email": "[email protected]"
}
}
}
}

Course participants

In courses, users are queried through a pageable connection: Course.participants. Since course users have course-specific context associated them (their participant type and status), their User objects are wrapped in Participant.

Participant types: Owner (creator of course), Admins, Instructors, Assistants and Students.

Query
Response
Query
{
course(id: "00000000-5944-95c7-65fc-a9747b200320") {
participants(first: 5) {
edges {
node {
participantType
participantStatus
user {
name
email
}
}
}
}
}
}
Response
{
"data": {
"course": {
"participants": {
"edges": [
{
"node": {
"participantType": "Owner",
"participantStatus": "ACTIVE",
"user": {
"name": "Michael Scarn",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Teacher",
"participantStatus": "ACTIVE",
"user": {
"name": "John Doe",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Teacher",
"participantStatus": "ACTIVE",
"user": {
"name": "Gyro",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Assistant",
"participantStatus": "ACTIVE",
"user": {
"name": "Dwight Schrute",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Student",
"participantStatus": "ACTIVE",
"user": {
"name": "Jim Halpert",
"email": "[email protected]"
}
}
}
]
}
}
}
}

Searching by username

Query
Result
Query
{
course(id: "00000000-5945-95c7-65fc-a9747b2003210") {
participants(first: 1, searchTerm: "Angela") {
edges {
node {
participantType
participantStatus
user {
name
email
}
}
}
}
}
}
Result
{
"data": {
"course": {
"participants": {
"edges": [
{
"node": {
"participantType": "Student",
"participantStatus": "ACTIVE",
"user": {
"name": "Angela Martin",
"email": "[email protected]"
}
}
}
]
}
}
}
}

Searching by participant type:

Query
Response
Query
{
course(id: "00000000-5945-95c7-65fc-a9747b200120") {
participants(first: 5, participantTypeFilter: Student) {
edges {
node {
participantType
participantStatus
user {
name
email
}
}
}
}
}
}
Response
{
"data": {
"course": {
"participants": {
"edges": [
{
"node": {
"participantType": "Student",
"participantStatus": "ACTIVE",
"user": {
"name": "Pam Beesly",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Student",
"participantStatus": "ACTIVE",
"user": {
"name": "Ryan Howard",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Student",
"participantStatus": "ACTIVE",
"user": {
"name": "Kevin Malone",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Student",
"participantStatus": "ACTIVE",
"user": {
"name": "Andy Bernard",
"email": "[email protected]"
}
}
},
{
"node": {
"participantType": "Student",
"participantStatus": "ACTIVE",
"user": {
"name": "Phyllis Smith",
"email": "[email protected]"
}
}
}
]
}
}
}
}

Individual participant lookup

Query
Response
Query
{
course(id: "00000000-5943-95c7-65fc-a9747b200320") {
participant(id: "UGAydGljaXBhbnQ6MTgzMjY2OTYtMDVhYy00NTdiLTkw") {
participantType
participantStatus
user {
name
email
}
}
}
}
Response
{
"data": {
"course": {
"owner": {
"name": "Pam Beesly",
"email": "[email protected]"
}
}
}
}