feat(websoc): support courseId query param#419
Closed
KevinWu098 wants to merge 2 commits into
Closed
Conversation
Allow filtering the WebSoc query by courseId and return courseId on each course in the response. Co-authored-by: Cursor <cursoragent@cursor.com>
HwijungK
requested changes
May 23, 2026
| type WebsocCourse @cacheControl(maxAge: 300) { | ||
| sections: [WebsocSection!]! | ||
| courseId: String! |
Collaborator
There was a problem hiding this comment.
Do we really need to give both courseId and dept + num as a field in the response. Maybe its good practice, but it feels redundant to me
Member
Author
There was a problem hiding this comment.
I think... it's nice because it will let us do less string concatenation in app land
Collaborator
There was a problem hiding this comment.
Nit: It makes good UX sense to put courseNumber right after department. Probably order ... dept, courseNum, courseId, courseTitle, ...
HwijungK
requested changes
May 23, 2026
| example: "I&C SCI", | ||
| }), | ||
| courseId: z.string().optional().openapi({ | ||
| description: "The course ID to query", |
Collaborator
There was a problem hiding this comment.
Docs change to reflect that user should use courseId OR Dept + name, as per Dante
Align field order across GraphQL and Zod schemas; keep courseId OpenAPI description minimal. Co-authored-by: Cursor <cursoragent@cursor.com>
HwijungK
approved these changes
May 24, 2026
Collaborator
HwijungK
left a comment
There was a problem hiding this comment.
I wont fight on the docs... this is an ok from me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds optional
courseIdto the WebSoc query endpoint (REST + GraphQL), filtering on the existing generatedwebsoc_course.course_idcolumn (REPLACE(dept_code, ' ', '') || course_number).Also returns
courseIdon each course in the response so clients can use the same identifier as catalogue, programs, and/websoc/syllabi.Related Issue
#416
Motivation and Context
Clients already identify courses by
courseId(e.g.I&CSCIH32) elsewhere in the API. The main WebSoc query previously requireddepartment+courseNumber; this adds a single-key filter aligned with the syllabi endpoint.For AntAlmanac, this allows better querying for collections of courses (which are more idiomatically identified by a courseId than a set of tuples which have to be serialized/deserialized between AA and AAPI).
How Has This Been Tested?
Not manually tested. Logic mirrors
getSyllabi(eq(websocCourse.courseId, …)); no DB migration.Screenshots (if appropriate):
Types of changes
Checklist: