Studysets & Folders
Core Entities
Section titled “Core Entities”Studysets
Section titled “Studysets”Individual studysets are stored in the public.studysets table.
- ID: A unique UUID for the study set.
- Title: The name of the study set.
- Privacy: A
privateboolean flag. Private sets are only visible to the user who created them. - Draft Status: A
draftboolean flag. Drafts can be excluded from public search and views. - User ID: Links the study set to the user who created it (
auth.users). - Subject ID: References a category in the
public.subjectstable. - Timestamps: Tracks creation and last update.
Folders
Section titled “Folders”Folders help users categorize their studysets. They are stored in the public.folders table.
- ID: A unique UUID.
- Name: The user-defined folder name.
- User ID: Links the folder to the user who created it (
auth.users).
Relationships (Folders and Studysets)
Section titled “Relationships (Folders and Studysets)”The relationship between studysets and folders is managed by the public.folder_studysets join table.
- Folder ID: References a folder.
- Studyset ID: References a study set.
- User ID: Ensures each folder-set mapping is specific to a user.
Key Operations (GraphQL)
Section titled “Key Operations (GraphQL)”Studysets
Section titled “Studysets”Studysets are created and modified using GraphQL mutations:
createStudyset(studyset: StudysetInput!, draft: Boolean!, folderId: ID): StudysetupdateStudyset(id: ID!, studyset: StudysetInput, draft: Boolean!): StudysetdeleteStudyset(id: ID!): ID
Studysets can be retrieved via various queries:
studyset(id: ID!): Studysetstudysets(cursor: String, limit: Int): StudysetConnection(supports pagination)
Folders
Section titled “Folders”Folders are managed using dedicated mutations:
createFolder(name: String!): FolderrenameFolder(id: ID!, name: String!): FolderdeleteFolder(id: ID!): ID
A study set can be added to or removed from a folder:
setStudysetFolder(studysetId: ID!, folderId: ID!): BooleanremoveStudysetFromFolder(studysetId: ID!): Boolean
Saving Studysets
Section titled “Saving Studysets”Users can “save” studysets created by others, which adds them to their collection. This is tracked in the public.saved_studysets table and managed with:
saveStudyset(studysetId: ID!): BooleanunsaveStudyset(studysetId: ID!): Boolean