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.
Required scope
Section titled “Required scope”Both mutations require the lecturers:write scope.
Error reporting
Section titled “Error reporting”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
errorsarray. The machine-readable code is inextensions.error.code. - Model validation failures are returned in the payload’s
errorsfield as an array of human-readable messages, withlecturerset tonull.
Shared input fields
Section titled “Shared input fields”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.}createLecturer
Section titled “createLecturer”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.}Example
Section titled “Example”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 } }}updateLecturer
Section titled “updateLecturer”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.}Example
Section titled “Example”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 } }}Error codes
Section titled “Error codes”| Code | Mutation | Meaning |
|---|---|---|
LECTURER-001 | createLecturer, updateLecturer | Name is required (blank on create, or provided-but-blank on update). |
LECTURER-002 | createLecturer, updateLecturer | Slug must only contain lowercase letters, numbers, and hyphens. |
LECTURER-003 | updateLecturer | Lecturer not found (not in this school, or discarded). |
GENERAL-001 | both | An unexpected error occurred while processing the request. |
Coded errors are returned in the standard GraphQL errors array, with the code in extensions.error.code.
Related Resources
Section titled “Related Resources”For more information about the Teachify Admin API, please refer to the API Overview.