Skip to content

Update Course

The updateCourse mutation allows you to update an existing course with new properties in your Teachify school.

Input Parameters

FieldTypeDescription
idString!ID of the course to update
inputAdminCourseInput!Input object containing course update details

AdminCourseInput Fields

FieldTypeRequiredDescription
nameString!YesCourse name
slugString!YesURL slug for the course. Must contain only lowercase letters, numbers, and hyphens
courseTypeString!YesType of the course (paid, public_access, free_redeem, pre_order)
descriptionStringNoCourse description
categoryIds[String!]NoIDs of categories to associate with this course
tagList[String!]NoTags 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

ErrorDescription
Course not foundThe specified course ID does not exist
Name cannot be emptyThe course name is required
Slug already existsThe provided slug is already in use by another course
Invalid course typeThe courseType must be one of: paid, public_access, free_redeem, pre_order
Category not foundOne or more category IDs do not exist

For more information about the Teachify Admin API, please refer to the API Overview.