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 paginationfilter
(StudentFilter, optional): Filter criteria
Returns:
- Connection object with:
nodes
: Array of Student objectspageInfo
: 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:
Field | Type | Description |
---|---|---|
id | ID | Unique identifier for the student |
name | String | Full name of the student |
email | String | Email address of the student |
phoneNumber | String | Phone number (if available) |
enrollmentDate | DateTime | When the student was first enrolled in the school |
status | StudentStatus | Current 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 |
createdAt | DateTime | When the student record was created |
updatedAt | DateTime | When the student record was last updated |
Filtering
The students
query supports filtering through the filter
parameter. The following filter fields are available:
Filter Field | Description |
---|---|
id | Filter by student ID |
name | Filter by student name (case-insensitive, partial match) |
email | Filter by student email (case-insensitive, partial match) |
status | Filter by enrollment status (ACTIVE, INACTIVE, SUSPENDED) |
courseId | Filter by enrollment in a specific course |
enrollmentDateAfter | Filter by enrollment date after specified date |
enrollmentDateBefore | Filter by enrollment date before specified date |
createdAtAfter | Filter by creation date after specified date |
createdAtBefore | Filter 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 } }}