Salesforce Certified Platform Developer II — Question 70

A developer must perform a complex SOQL query that joins two objects in a Lightning component.
How can the Lightning component execute the query?

Answer options

Correct answer: A

Explanation

The correct answer is A because invoking an Apex class with an @AuraEnabled method is the appropriate way to perform SOQL queries in Lightning components. Option B is incorrect as the Streaming API is meant for real-time data updates, not for executing queries. Option C is not suitable since Process Builder is not designed for executing SOQL queries directly. Option D is also incorrect as it suggests an unnecessary complexity by wrapping the query in another component.