Summary
Facebook Query Language (FQL) allows you to access numerous Facebook data structures, including user data, a list of the user's friends, those friends' details, links posted by the user, fan pages, and so on. To get these details, you have to construct an FQL query and execute it with the FB.Facebook.apiClient.fql_query() function call.
The fql_query function accepts two parameters: an FQL query string, and a callback function that's executed after the query results are returned from the server. The callback function has to check the length of the result set, as queries with no results pass an empty object to the callback function.
Invalid FQL queries cause a browser-side exception that cannot be readily caught with your JavaScript code. Thus, it's best to test the queries within the Facebook Test Console application before deploying them in your JavaScript code. Running various tests with the Test Console application will also allow you to spot discrepancies between the FQL documentation and the actual results returned by FQL queries.