cleg
cleg

Reputation: 5022

Facebook FQL returns no result, while GraphAPI does

I'm trying to get Facebook user information by username. I'm trying to make following FQL request:

SELECT first_name, last_name FROM user WHERE username="Google"

I got no data in response:

{
  "data": [
  ]
}

Same query works OK for other usernames:

SELECT first_name, last_name FROM user WHERE username="c1egger"

This gives me:

{
  "data": [
    {
      "first_name": "Paul", 
      "last_name": "Dmitryev"
    }
  ]
}

I've tried to use GrapAPI with following request:

/Google?fields=id,name

And got the result:

{
    "name": "Google", 
    "id": "104958162837"
}

Also, I'm getting same problem, when trying to query by userid.

Major part of my application uses FQL, so I'd like to figure out why FQL not working, before starting complex porting to FQL.

Upvotes: 1

Views: 140

Answers (1)

Basque
Basque

Reputation: 128

They are not the same request...

/Google?fields=id,name

That request doesn't check in "User" table, that's why you can't retrieve user "google" with '104958162837' id.

facebook.com/c1egger and facebook.com/Google are not the same type of page.

select name from page where page_id=104958162837

or

select page_id from page where username='Google'

Gives you the same result as the graph api.

FQL works, but it's more complex that GraphApi to use.

Facebook Query Language, or FQL, enables you to use a SQL-style interface to query the data exposed by the Graph API. It provides advanced features not available in the Graph API.

Upvotes: 1

Related Questions