FQL Multiquery始终失败(查询作为单个查询工作)

时间:2014-01-18 15:39:13

标签: ios facebook facebook-fql fql.multiquery

我正在尝试获取用户新闻流,并从新闻流帖子的演员ID中获取个人资料的名称。

这是我使用的查询

NSString *fqlString = @"{"
@"'query0':'SELECT post_id, actor_id, message, created_time FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND is_hidden = 0 ORDER BY created_time DESC LIMIT 5',"
@"'query1':'SELECT id, name, pic_square FROM profile WHERE id IN (SELECT uid2 FROM #query0)',"
@"}";

这会返回OAuth异常,其中显示:"(#601) Parser error: unexpected '{' at position 0."

实际上它没有意义,因为query0和query1都作为单个查询工作。

任何人都可以帮我解决这个问题。

1 个答案:

答案 0 :(得分:2)

你有:

  1. 一个synthax错误:type='newsfeed'必须是type="newsfeed",因为您的查询已在撇号'之后开始。
  2. 无法在uid2中找到
  3. #query0,因为uid2表中不存在字段stream。您最有可能需要actor_id
  4. 以下是您更正的FQL查询:

    {
     'query0':'SELECT post_id, actor_id, message, created_time FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type="newsfeed") AND is_hidden = 0 ORDER BY created_time DESC LIMIT 5',
     'query1':'SELECT id, name, pic_square FROM profile WHERE id IN (SELECT actor_id FROM #query0)'
    }
    

    Try it here