public with sharing class MapDataController { @AuraEnabled(cacheable=true) public static List getAllLocations(){ List oppList; try { Map_data__c settings = Map_data__c.getInstance(); String filters = settings.QueryFilters__c; String query = ''+filters; oppList = (List) Database.query(query); } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return oppList; } }