Update Course
The updateCourse
mutation allows you to update an existing course with new properties in your Teachify school.
Input Parameters
Field | Type | Description |
---|---|---|
id | String! | ID of the course to update |
input | AdminCourseInput! | Input object containing course update details |
AdminCourseInput Fields
Field | Type | Required | Description |
---|---|---|---|
name | String! | Yes | Course name |
slug | String! | Yes | URL slug for the course. Must contain only lowercase letters, numbers, and hyphens |
courseType | String! | Yes | Type of the course (paid, public_access, free_redeem, pre_order) |
description | String | No | Course description |
categoryIds | [String!] | No | IDs of categories to associate with this course |
tagList | [String!] | No | Tags to associate with this course |
Return Type
type AdminCourseUpdatePayload { # The updated course object, null if operation failed course: AdminCourse
# Array of error messages, if any occurred during the operation errors: [String!]}
Example
mutation UpdateCourse { updateCourse( id: "course_12345" input: { name: "Advanced GraphQL Fundamentals" slug: "advanced-graphql-fundamentals" courseType: "paid" description: "Learn advanced GraphQL concepts and patterns" categoryIds: ["cat_123", "cat_456"] tagList: ["graphql", "advanced", "api"] } ) { course { id name slug courseType description categories { id name } tags } errors }}
Sample Response
{ "data": { "updateCourse": { "course": { "id": "course_12345", "name": "Advanced GraphQL Fundamentals", "slug": "advanced-graphql-fundamentals", "courseType": "paid", "description": "Learn advanced GraphQL concepts and patterns", "categories": [ { "id": "cat_123", "name": "Programming" }, { "id": "cat_456", "name": "Web Development" } ], "tags": ["graphql", "advanced", "api"] }, "errors": [] } }}
Common Errors
Error | Description |
---|---|
Course not found | The specified course ID does not exist |
Name cannot be empty | The course name is required |
Slug already exists | The provided slug is already in use by another course |
Invalid course type | The courseType must be one of: paid, public_access, free_redeem, pre_order |
Category not found | One or more category IDs do not exist |
Related Resources
- Create Course - Create a new course
- Delete Course - Delete a course
- Course Management - Overview of course operations
For more information about the Teachify Admin API, please refer to the API Overview.