FQL Multiquery Returned Info

2019-08-03 15:49发布

I'm trying to use an FQL Multiquery to obtain my most recent Facebook question and options with one query using an http request.

So far the query I tried to use is:

SELECT name, votes FROM question_option WHERE question_id IN 
   (SELECT id, question FROM question WHERE owner = me() 
   ORDER BY created_time DESC LIMIT 1)

Unfortunately this only returns the name and votes from the outer query and not the question text from the inner one. Is there a way to retrieve all 3 without making 2 queries?

1条回答
Lonely孤独者°
2楼-- · 2019-08-03 16:24

What you posted isn't a multiquery. A proper multiquery should get you what you want:

{
'question_detail':
  'SELECT id, question FROM question WHERE owner = me() 
     ORDER BY created_time DESC LIMIT 1',
'question_answers':
   'SELECT name, votes FROM question_option WHERE question_id IN
      (SELECT id FROM #question_detail)'
 }

You'll need to get rid of the whitespace for this to properly execute.

查看更多
登录 后发表回答