How do I order the friends list returned from the new Facebook Graph API?

facebook, facebook-graph-api

Solution

Figured out a solution. Eventually, we'll probably be able to order graph results. For now, I'm just doing this (javascript). Assuming that I got "fb_uid" from my PHP session:

var friends = FB.Data.query("SELECT name, uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1={0}) ORDER BY name", parseInt(fb_uid));
friends.wait(function(rows){
    console.log(rows);
});

Problem

You can get a list of friends of an authenticated user with: https://graph.facebook.com/me/friends Anyone have any idea how to order the list by user name? Because it doesn't by default. There's nothing in the documentation.

Original source