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 

I am Sakthivel Madesh, a certified Salesforce Advanced Developer & Administrator working on Salesforce Technology since 2011. I am currently working in Techforce Services as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 15x Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead 5x Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply

Your email address will not be published. Required fields are marked *