2

I have this query:

SELECT uid, name, current_location FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) AND current_location.id IN (Select current_location.id from user where uid = me() ) 

It gives me results as required i-e friends only with a particular location. Can i get the same results using Graph API instead? assuming I have the location id. I tried this in graph API:

me/friends?location.id='111501225536407'&fields=location 

Is something of ^ sort even possible using graph API?

2 Answers 2

1

Not that I can see. The Graph API is best for getting all of or the most recent items of an object. If you wanted to filter those friends by location, you would need to do that on the client side.

If you want Facebook to pre-filter your results on their servers, you need to use FQL.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your response @cpilko I could have used fql using Php sdk but for some reason it's not working for me. As i have mentioned in This Question
1

you can execute fql queries (including multiqueries) through the graph api like this:

https://graph.facebook.com/fql?q={"albums":"select aid, name,cover_pid FROM album where owner=me()","album_covers":"select src from photo where pid in (select cover_pid from %23albums)"}&access_token=xxxxxx

It's a little tricky with the url encoding. Be sure that "#" sign used in multiqueries is encoded as %23

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.