Skip to content

Lecturer Mutations

Lecturer mutations let you create and edit instructor profiles for your school. A lecturer profile holds a name, slug, bio fields, social links, and a skill list.

Both mutations share the same input shape. On createLecturer, name is required. On updateLecturer, every field is optional and only the fields you provide are changed.

Both mutations require the lecturers:write scope.

These mutations report failures in two ways:

  • Coded errors (e.g. a missing name, an invalid slug, or a lecturer that cannot be found) are raised into the standard GraphQL errors array. The machine-readable code is in extensions.error.code.
  • Model validation failures are returned in the payload’s errors field as an array of human-readable messages, with lecturer set to null.

Both mutations accept the same input object:

input LecturerInput {
name: String # Full name. Required on create; optional on update (must not be blank if provided).
slug: String # URL-friendly identifier: lowercase letters, numbers, hyphens. Defaults to a slug of the name.
headline: String # Brief professional headline.
description: String # Detailed background and expertise.
skills: [String] # List of skills (replaces the existing list).
isAvailable: Boolean # Whether the lecturer is available for meetings (default: false on create).
education: String # Educational background.
experience: String # Professional experience.
profession: String # Current profession or job title.
certification: String # Professional certifications.
twitterUrl: String
linkedinUrl: String
instagramUrl: String
facebookPageUrl: String
youtubeUrl: String
websiteUrl: String
}

The returned payload type is the same for both mutations:

type AdminLecturer {
id: String!
slug: String
name: String!
headline: String
description: String
education: String
experience: String
profession: String
certification: String
avatar: String # Profile picture URL.
skills: [String]
isAvailable: Boolean!
position: Int!
coursesCount: Int! # Number of active courses.
contactInformation: ContactInformation # Social media and contact links.
createdAt: Int! # Unix timestamp.
updatedAt: Int! # Unix timestamp.
}

Creates a new lecturer. name is required. When slug is omitted or blank, it defaults to a slugified version of the name.

createLecturer(input: LecturerInput!): AdminLecturerCreatePayload!
type AdminLecturerCreatePayload {
lecturer: AdminLecturer # The created lecturer. null when errors is present.
errors: [String] # Model validation messages, or null on success.
}
mutation {
createLecturer(
input: {
name: "Jane Doe"
headline: "Senior Instructor"
skills: ["Design", "Illustration"]
isAvailable: true
}
) {
lecturer {
id
slug
name
skills
isAvailable
}
errors
}
}
{
"data": {
"createLecturer": {
"lecturer": {
"id": "lecturer-123",
"slug": "jane-doe",
"name": "Jane Doe",
"skills": ["Design", "Illustration"],
"isAvailable": true
},
"errors": null
}
}
}

Updates an existing lecturer. This is a partial update — only fields present in input are changed. If name is provided it must not be blank, and if slug is provided it must match the slug format.

updateLecturer(
id: String! # Required. ID of the lecturer to update.
input: LecturerInput!
): AdminLecturerUpdatePayload!
type AdminLecturerUpdatePayload {
lecturer: AdminLecturer # The updated lecturer. null when errors is present.
errors: [String] # Model validation messages, or null on success.
}
mutation {
updateLecturer(id: "lecturer-123", input: { headline: "Lead Instructor", isAvailable: false }) {
lecturer {
id
headline
isAvailable
}
errors
}
}
{
"data": {
"updateLecturer": {
"lecturer": {
"id": "lecturer-123",
"headline": "Lead Instructor",
"isAvailable": false
},
"errors": null
}
}
}
CodeMutationMeaning
LECTURER-001createLecturer, updateLecturerName is required (blank on create, or provided-but-blank on update).
LECTURER-002createLecturer, updateLecturerSlug must only contain lowercase letters, numbers, and hyphens.
LECTURER-003updateLecturerLecturer not found (not in this school, or discarded).
GENERAL-001bothAn unexpected error occurred while processing the request.

Coded errors are returned in the standard GraphQL errors array, with the code in extensions.error.code.

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