how to Use refreshApex in Lightning Web Components (LWC)

For this blog post described about to use the refreshApex in Lightning Web Components Controller file.

Today received the error “Refresh failed because resolved configuration is not available” in Lightning Web Component and here is the work around to use with refreshApex in Lightning Web Components (LWC).

import { refreshApex } from ‘@salesforce/apex’;

wiredProperty is A property or method annotated with @wire.

Here is Simple Example to Use refreshApex in Lightning Web Components (LWC):

import { LightningElement, track, api, wire } from 'lwc';
import getAccountList from '@salesforce/apex/AccountController.getAccount';
import saveAccount from '@salesforce/apex/AccountController.insertAccount';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { refreshApex } from '@salesforce/apex';

export default class PremiumQuoteAlteration extends NavigationMixin(LightningElement) {


// retrieving the data using wire service
accountList(result) {
this.wiredAccountResults = result;
if ( {
this.accountData =;
this.error = undefined;

} else if (result.error) {
this.error = result.error;
this.accountData = undefined;

//to Save the altered Quote payload
saveAccount() {
.then(result => {

//console.log('alteration result::'+result.Id);
new ShowToastEvent({
title: 'Success',
message: 'Account Saved Successfully {0} ',
variant: 'success',
messageData: [{
url: '/'+result.Id,
label: 'Click Here',

return refreshApex(this.wiredAccountResults);
.catch(error => {
this.error = error;


Written by 

3x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published.