Skip to content

GraphQL API Reference

Nut Pinyo edited this page Aug 13, 2022 · 7 revisions

Table of Contents

Queries

course

course(courseNo: String!, courseGroup: CourseGroupInput!): Course!

Find a course and returns it

Type: Course!

Arguments

Name Type Description
courseNo String! Course no. to find.
courseGroup CourseGroupInput! The CourseGroupInput this course belongs to.

courseNos

courseNos: CourseNosOutput

Returns a list of all course nos.

search

search(filter: FilterInput!, courseGroup: CourseGroupInput!): [Course!]!

Search courses using the given course filters. Supports pagination with limit and offset fields in FilterInput.

Type: [Course!]!

Arguments

Name Type Description
filter FilterInput! Filters for searching courses. Courses are excluded from the result if it fails ANY of the filters.
courseGroup CourseGroupInput! The CourseGroup the resulting courses must belong to.

Mutations

Types

Course

Fields

Name Type Description
studyProgram StudyProgram! Study program of this course.
semester String! Semester of this course.
academicYear String! Academic year of this course.
courseNo String! Course no. of this course.
courseDescTh String Course description in Thai.
courseDescEn String Course description in English.
abbrName String! Abbreviated name of the course.
courseNameTh String! Full course name in Thai.
courseNameEn String! Full course name in English.
faculty String! Faculty this course belongs to.
department String! Department this course belongs to.
credit Float! Credit of this course.
creditHours String! Credit hours of this course.
courseCondition String! Condition for enrolling in this course.
genEdType GenEdType! GenEdType of this course. If this course is not a GenEd course, the value will be NO.
midterm ExamPeriod Exam period for midterm.
final ExamPeriod Exam period of final.
sections [Section!]! Sections detail of this course.
rating String Average rating of this course. This value comes from all reviews for this course.
courseDesc String (DEPRECATED) Use courseDescTh or courseDescEn instead.

ExamPeriod

Fields

Name Type Description
date String! Date of the exam. The value is formatted as ISO8601 representation: YYYY-MM-DDThh:mm:ss.SSSZ
period Period! Period of the exam.

Period

Fields

Name Type Description
start String! Start time of the period. Format is xx:xx.
end String! End time of the period. Format is xx:xx.

Section

Fields

Name Type Description
sectionNo String! Number of this section.
closed Boolean! True if this section is closed. False, otherwise.
capacity Capacity! Capacity of this section.
note String Note of this section.
classes [Class!]! List of Classes in this section.
genEdType GenEdType! GenEdType of this section. If this section is not classified as GenEd, the value will be NO.

Capacity

Fields

Name Type Description
current Int! Current number of students in this course.
max Int! Maximum number of students this course can take.

Class

Fields

Name Type Description
type String! Type of this class.
dayOfWeek DayOfWeek DayOfWeek in which this class is taught.
period Period Period in which this class is taught.
building String Building in which this class is taught.
room String Room in which this class is taught.
teachers [String!]! List of teachers that teach this class.

CourseNosOutput

Fields

Name Type Description
S [String!]! List of course nos. in studyProgram S.
T [String!]! List of course nos. in studyProgram T.
I [String!]! List of course nos. in studyProgram I.

Inputs

CourseGroupInput

Input fields

Name Type Description
studyProgram StudyProgram! StudyProgram of this course.
semester String! Semester of this Course.
academicYear String! Academic year of this course.

FilterInput

Input fields

Name Type Description
keyword String Keyword to search for courses. This filter is passed IF any of courseNo, abbrName, courseNameTh, or courseNameEn contains the keyword as a substring (except for courseNo which checks if value starts with the keyword).
genEdTypes [GenEdType!] List of GenEdTypes. This filter is passed IF the course's genEdType matches ANY of the GenEdTypes in the list.
dayOfWeeks [DayOfWeek!] List of DayOfWeeks. This filter is passed IF ANY of the course's sections have class in ANY of the DayOfWeeks in the list.
periodRange PeriodRangeInput Range of the classes' period. This filter is passed IF ANY of the course's sections have class that intersects with the periodRange.
limit Int Number of courses to return in this query. Used for pagination.
offset Int Number of courses to skip through. Used for pagination.

PeriodRangeInput

Input fields

Name Type Description
start String! Start time of the range. Format is xx:xx.
end String! End time of the range. Format is xx:xx.

Enums

StudyProgram

Values

Name Description
S Semester (ทวิภาค)
T Trimester (ตรีภาค)
I International (ทวิภาค-นานาชาติ)

GenEdType

Values

Name Description
SO Social (สังคม)
HU Humanitarian (มนุษย์)
SC Science-Mathematics (วิทยาศาสตร์)
IN Interdisciplinary (สหศึกษา)
NO Not GenEd

DayOfWeek

Name Description
MO Monday
TU Tuesday
WE Wednesday
TH Thursday
FR Friday
SA Saturday
SU Sunday
IA Individually Arranged (Different for each student)
AR To be Arranged (Faculty will announce later)

Scalars