Delete Post
The deletePost
mutation allows you to delete a post from your Teachify school. This is a soft delete operation, meaning the post data is retained but marked as deleted.
Input Parameters
Field | Type | Description |
---|---|---|
id | String! | ID of the post to delete |
Return Type
type AdminPostDeletePayload { # Array of error messages, if any occurred during the operation errors: [String!]
# Boolean indicating whether the deletion was successful success: Boolean}
Example
mutation DeletePost { deletePost(id: "post_12345") { success errors }}
Sample Response
{ "data": { "deletePost": { "success": true, "errors": [] } }}
Error Response
If the deletion fails, you might receive a response like this:
{ "data": { "deletePost": { "success": false, "errors": ["Post not found"] } }}
Common Errors
Error | Description |
---|---|
Post not found | The specified post ID does not exist |
Post already deleted | The post has already been deleted |
Insufficient permissions | You don’t have permission to delete this post |
Important Notes
- This is a soft delete operation - the post data is retained in the system but marked as deleted
- Deleted posts will not appear in regular queries
- The post can potentially be restored by system administrators if needed
- All associated data (comments, ratings, etc.) will also be hidden when the post is deleted
Related Resources
- Create Post - Create a new post
- Update Post - Update an existing post
- Post Management - Overview of post operations
For more information about the Teachify Admin API, please refer to the API Overview.