Students
Query student records — list, search, and get by ID
Students
Access student records for your school. All queries require authentication and return only students belonging to your assigned school.
List Students
query {
students(limit: 20, offset: 0) {
id
code
fullName
classroomName
status
statusText
}
}Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | Int | 20 | Maximum number of results |
offset | Int | 0 | Number of results to skip (for pagination) |
search | String | — | Search across code, firstname, lastname, mobileNo, citizenId |
code | String | — | Filter by student code (partial match) |
firstname | String | — | Filter by first name (partial match) |
lastname | String | — | Filter by last name (partial match) |
mobileNo | String | — | Filter by mobile number |
citizenId | String | — | Filter by citizen ID |
Search Students
The search parameter searches across multiple fields simultaneously:
query {
students(search: "สมชาย", limit: 10) {
id
fullName
code
classroomName
}
}Get Student by ID
query {
student(id: 123) {
id
code
title
firstname
lastname
fullName
classroomName
orderNumber
gender
dob
mobileNo
citizenId
status
statusText
imageURI
}
}Student Fields
| Field | Type | Description |
|---|---|---|
id | Int | Unique student ID |
code | String | Student code |
title | String | Thai title (เด็กชาย, เด็กหญิง, นาย, นางสาว) |
firstname | String | First name |
lastname | String | Last name |
fullName | String | Full name with title (computed) |
firstnameEn | String | First name in English |
lastnameEn | String | Last name in English |
citizenId | String | Citizen ID number |
gender | String | Gender |
blood | String | Blood type |
dob | String | Date of birth |
address | String | Address |
telephone | String | Telephone number |
mobileNo | String | Mobile phone number |
status | Int | Status code |
statusText | String | Status in Thai text (computed) |
image | String | Profile image filename |
imageURI | String | Full profile image URL (computed) |
orderNumber | Int | Order number in current classroom (computed) |
classroomName | String | Current classroom name, e.g. "ม.1/1" (computed) |
createdAt | String | Creation timestamp |
updatedAt | String | Last update timestamp |
Status Codes
| Code | Thai | English |
|---|---|---|
| -1 | ไม่ใช้งาน | Inactive |
| 0 | สำเร็จการศึกษา | Graduated |
| 5 | เรียนต่อต่างประเทศ | Study abroad |
| 6 | ลาออก | Resigned |
| 7 | แขวนลอย | Suspended |
| 8 | พ้นสภาพนักศึกษา | Expelled |
| 9 | พักการศึกษา | Study leave |
| 10 | กำลังศึกษา | Currently studying |
| 11 | ยังไม่จบ | Not graduated |
| 12 | ย้ายสถานศึกษา | Transferred |
Example: Paginated List with Search
query {
students(limit: 20, offset: 0, search: "ม.6") {
id
fullName
classroomName
mobileNo
statusText
}
}