The removeStudentFromCourse mutation allows you to completely remove a student’s enrollment from a specified course. This action revokes the student’s access to course content and removes all enrollment records.
Input Parameters
Field
Type
Description
userId
String!
ID of the student (User) to remove from the course
courseId
String!
ID of the course to remove the student from
Return Fields
Field
Type
Description
success
Boolean!
Indicates whether the removal was successful
message
String
Additional information about the operation result
typeRemoveStudentFromCoursePayload {
success
message
}
Example
mutation {
removeStudentFromCourse(
userId: "a1b2c3d4-5678-90ef-ghij-klmnopqrstuv"
courseId: "ab6ee332-614d-475d-93b5-abc5ebb1fc84"
) {
success
message
}
}
Sample Response
{
"data": {
"removeStudentFromCourse": {
"message": "Student successfully removed from the course",