Starting multiquery in client throws parser error

不打扰是莪最后的温柔 提交于 2019-12-03 21:33:41
firepol

To do a multiquery with a reference to the first query, such as the one in the question, do as follows:

//note: queries begin from 0, not from 1
string query0 = "SELECT uid2 FROM friend WHERE uid1 = me()";
string query1 = "SELECT uid1, uid2 FROM friend WHERE uid1 IN (SELECT uid2 FROM #query0) AND uid2 IN (SELECT uid2 FROM #query0)";

dynamic result = fb.Query(query0, query1);

To answer this, I got inspired from here (had to figure out that queries start from 0): How to use fql.multiquery with C# SDK

Enjoy!

Here is an alternate to firepol's answer, with named queries:

var queries = 
    new Dictionary<string, object>
    {
        { "FamDamly", "select uid from family where profile_id = me()" },
        { "FamDetails", "select uid, first_name from user where uid in #FamDamly" }
    };
client.Get(queries);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!