Search code examples
javarestfb

restfb Fetching Object


I just use restfb today and I write some demo application using restfb. But the new api version 1.30 is not match with documentation.

In Documentation, Fetching object is written like that..

Page page = facebookClient.fetchObject("cocacola", Page.class);

But new version is I can only write like that...

Page page = client.fetchObject("cocacola", Page.class,Parameter.with("fields", "name,id"));

Fetching with Parameter could be faster but I want to fetch all data from facebook page. I don't want to do with specific parameters because if i need more parameters, I have to write more. I want to fetch all data from pages. So, Is there any suggestion?


Solution

  • Let me quote the restfb documentation:

    Facebook made a breaking change with Graph API 2.4 and you now have to provide the fields parameter to get the fields you need. According to Facebook, reducing the default fields leads to faster performance. In the Advanced Usage section you'll find a example how the fields are requested with RestFB.