Skip to content

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.

FieldTypeDescription
idString!ID of the post to delete
type AdminPostDeletePayload {
# Array of error messages, if any occurred during the operation
errors: [String!]
# Boolean indicating whether the deletion was successful
success: Boolean
}
mutation DeletePost {
deletePost(id: "post_12345") {
success
errors
}
}
{
"data": {
"deletePost": {
"success": true,
"errors": []
}
}
}

If the deletion fails, you might receive a response like this:

{
"data": {
"deletePost": {
"success": false,
"errors": ["Post not found"]
}
}
}
ErrorDescription
Post not foundThe specified post ID does not exist
Post already deletedThe post has already been deleted
Insufficient permissionsYou don’t have permission to delete this post
  • 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

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