エラーメッセージ:LWC LimitException: Too many DML statements: 1
number of DML statements:1 out of 0 ******* close to limit.
正常:number of DML statements:1 out of 150.
■実行時のパフォーマンスを改善するには、@AuraEnabled(cacheable=true) を設定してクライアントにメソッドの結果をキャッシュします。cacheable=true を設定するには、メソッドがデータの取得のみを行う必要があります。メソッドでデータを変更することはできません。
■LWCで呼び出すApexメソッドを作成します。
@Wireサービスで使用するApexには下記が必要です。
static
publicまたはglobal
@AuraEnabled(cacheable=true)