fql?q=SELECT friend_count FROM user WHERE uid=’id’
I was using the above fql query for getting the count of friends. It has been working for me for quite some time. [Javascript SDK ]
But now it gives the following error message,
{“error”:{“message”:”(#604) Your statement is not indexable. The WHERE
clause must contain an indexable column. Such columns are marked with
* in the tables linked from http://developers.facebook.com/docs/reference/fql “,
“type”:”OAuthException”}}
I tried copying this query and pasting it in graph api explorer tool and it works perfectly fine.
I have checked the FQL reference for user and uid is still an indexable column.
I have checked the blogs for breaking changes, but there are none mentioned regarding fql.
Any idea why this is not working anymore ? And any other way to get this working ?
You might have a bad access token, or your query might have quotes around the numeric user ID value.
https://graph.facebook.com/fql?q=SELECT friend_count FROM user WHERE uid=me(){
“data”: [
{
“friend_count”: NNNN
}
]
}
https://graph.facebook.com/fql?q=SELECT friend_count FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()){
“data”: [
{
“friend_count”: 421
},
{
“friend_count”: 219
},
{
“friend_count”: 59
},
{
“friend_count”: 239
},
{
“friend_count”: 235
},
{
“friend_count”: 986
},
EDIT
Based upon the code links you shared below, here’s a way to get the fql url encoded properly.