Testing Your Queries in the JavaScript Test Console
To test your FQL, Facebook provides a Test Console in which you can place your queries and see what they return. It was built to test old-style JavaScript REST API calls, but this is a great way to see what your query returns before formulating it into any sort of code.
To get to the FQL Test Console (see Figure 10-9), go to
developers.facebook.com/docs/reference/rest/fql.query
If that doesn't work, just search for “fql console” in the Developer documentation.
You can test this out. Just go to the preceding URL to get to the FQL Test Console. Then, in the Query box, place the following text that I show you in the preceding section:
Figure 10-9: The FQL Test Console can help you test your FQL code.

SELECT uid, name, pic_square FROM user WHERE uid = me() OR uid IN (SELECT uid2
FROM friend WHERE uid1 = me())
Leave all the defaults in and click Call Method. After a short wait, you'll get a list of yourself and all your friends in the box on the right. It should look something like what is shown in Figure 10-10.
Figure 10-10: The FQL Test Console returning data in JSON format for the preceding query.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access