Too many DML Statements: 1

When this error occurs This error arises when a DML operation (like insert, update, or delete) is attempted inside an Apex method annotated with @AuraEnabled(cacheable=true). Since such methods are executed in a read-only context to enable client-side caching in Lightning components, any DML operation inside them results in a System.LimitException: Too many DML statements: 1. […]