Delete
Content: Delete
User Intent
Operation
TypeScript (Canonical)
import { Graphlit } from 'graphlit-client';
import { ContentTypes, EntityState, SearchTypes } from 'graphlit-client/dist/generated/graphql-types';
const graphlit = new Graphlit();
// Delete single content by ID
const response = await graphlit.deleteContent('content-id-here');
if (response.deleteContent?.id) {
console.log(`Deleted content: ${response.deleteContent.id}`);
}
// Delete multiple specific content items (by IDs)
const contentIds = ['id-1', 'id-2', 'id-3'];
const bulkResponse = await graphlit.deleteContents(
contentIds,
true // isSynchronous - wait for deletion to complete
);
console.log(`Deleted ${contentIds.length} content items`);
// Delete ALL content (use with caution!)
const deleteAllResponse = await graphlit.deleteAllContents(
true // isSynchronous
);
console.log('All content deleted');Delete single content (snake_case method)
Delete multiple content items
Delete all content
Parameters
deleteContent
deleteContents
deleteAllContents
Response
Developer Hints
Deletion is Permanent
Synchronous vs Asynchronous Deletion
🚨 deleteAllContents with Filters
⚡ Performance Considerations
Variations
1. Delete Content by Filter (Conditional Deletion)
2. Delete Old Content (Cleanup)
3. Delete Content from Specific Feed
4. Batch Delete with Progress Tracking
5. Safe Delete with Confirmation
6. Delete Test Data
7. Delete by Collection
Common Issues
Production Example
Last updated