function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Web Dev 43Web Dev 43 

Wire not calling the Apex controller

I’m using @wire to get the getMenuStructure  from es_get_Menu_Items,
When I call es_get_Menu_Items. getMenuStructure(  'a0u0C000009cXeIQAU')
from a debug window it returns a list
When I call it from an aura component I get data,
its the wire that’s not working, rather than the apex code
when I run the below it returns undefined.
Can you see what I am doing wrong ?

/*JS*/
import { LightningElement, api, wire, track } from 'lwc';
import getMenuStructure from '@salesforce/apex/es_get_Menu_Items.getMenuStructure';


export default class ChildComponent extends LightningElement {
    @api authStatuses;
    @api error;

    @wire(getMenuStructure  , {questionsetUserId: 'a0u0C000009cXeIQAU'})

    getMenuStructure({data,error}){
        alert('success ' + data);  
        if (data) {
            this.menuStructure = data;
            this.error = undefined;

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

Jalagam KumarJalagam Kumar
Use   @auraEnabled(cacheable=true)  on top of your apex method. Hope it helps.