Skip to content

Student Queries

Note: The Teachify Admin API is currently under development and not yet available for public use. This documentation is provided for preview purposes only.

Overview

The Students API allows you to retrieve information about students enrolled in your school. You can fetch individual students by ID or query multiple students with filtering and sorting options.

Available Queries

students

Returns a paginated list of students for the school.

Parameters:

  • first (Int, optional): Number of items to return (default: 20, max: 100)
  • after (String, optional): Cursor for pagination
  • filter (StudentFilter, optional): Filter criteria

Returns:

  • Connection object with:
    • nodes: Array of Student objects
    • pageInfo: Pagination metadata

Example:

query {
students(
first: 10,
filter: {
courseId: "course-123",
enrollmentStatus: ACTIVE
}
) {
nodes {
id
name
email
enrolledCourses {
id
name
}
}
pageInfo {
hasNextPage
endCursor
}
}
}

student

Returns a single student by ID.

Parameters:

  • id (ID!, required): The ID of the student

Returns:

  • Student object or null if not found

Example:

query {
student(id: "student-123") {
id
name
email
enrolledCourses {
id
name
}
assignments {
id
title
dueDate
status
}
}
}

Student Object

The Student object contains the following fields:

FieldTypeDescription
idIDUnique identifier for the student
nameStringFull name of the student
emailStringEmail address of the student
phoneNumberStringPhone number (if available)
enrollmentDateDateTimeWhen the student was first enrolled in the school
statusStudentStatusCurrent status (ACTIVE, INACTIVE, SUSPENDED)
enrolledCourses[Course]List of courses the student is enrolled in
assignments[Assignment]List of assignments assigned to the student
grades[Grade]List of grades received by the student
attendanceRecords[AttendanceRecord]List of attendance records for the student
createdAtDateTimeWhen the student record was created
updatedAtDateTimeWhen the student record was last updated

Filtering

The students query supports filtering through the filter parameter. The following filter fields are available:

Filter FieldDescription
idFilter by student ID
nameFilter by student name (case-insensitive, partial match)
emailFilter by student email (case-insensitive, partial match)
statusFilter by enrollment status (ACTIVE, INACTIVE, SUSPENDED)
courseIdFilter by enrollment in a specific course
enrollmentDateAfterFilter by enrollment date after specified date
enrollmentDateBeforeFilter by enrollment date before specified date
createdAtAfterFilter by creation date after specified date
createdAtBeforeFilter by creation date before specified date

Filter Examples

Find active students in a specific course:

query {
students(
filter: {
status: ACTIVE,
courseId: "course-123"
}
) {
nodes {
id
name
email
}
}
}

Find students enrolled after a certain date:

query {
students(
filter: {
enrollmentDateAfter: "2023-01-01"
}
) {
nodes {
id
name
enrollmentDate
}
}
}

Search for students by name:

query {
students(
filter: {
name: "Smith"
}
) {
nodes {
id
name
email
}
}
}