A developer is creating a Lightning web component that displays a list of records in a lightning-datatable. After saving a new record to the database, the list is not updating.

What should the developer change in the code above for this to happen?
A developer is creating a Lightning web component that displays a list of records in a lightning-datatable. After saving a new record to the database, the list is not updating.
What should the developer change in the code above for this to happen?
Isn't it D? Because records is a wire function and assigns the result to this.data. So, this.data is the variable currently holding the displayed data.
It should be D. https://bobbuzzard.blogspot.com/2022/01/refreshapex-and-lightning-web-components.html https://developer.salesforce.com/docs/platform/lwc/guide/apex-result-caching.html
go through carefully. It should be C
C is correct. The "data" variable only stores the "data" part of "result". However, following the same link everyone posted here, salesforce docs clearly say that the wired function should use the entire "result" parameter in a wired function. Hence, we need to store "result" in a new variable and then call refreshApex on it.
https://developer.salesforce.com/docs/platform/lwc/guide/apex-result-caching.html
C is correct, you have to send whole result into refreshApex to get latest data.