Change from FQL to Graph API

2019-09-20 14:17发布

问题:

So I understand that FQL is going to be deprecated soon in favor of the graph API, I read about some graph API examples but yet to find how to do what I actually need. So the thing is simple, I need to select from a page all its albums that are updated in the last 2 weeks, and from the photos inside these albums all photos that have been updated in the last 2 weeks. In FQL it would go something like this (2 queries):

SELECT aid, object_id, name, description FROM album WHERE owner=' . $owner . ' AND modified>' . $time . ' ORDER BY modified DESC;
SELECT pid, object_id, src_small, src_big, caption, modified FROM photo WHERE album_object_id=' . $query1['object_id'] . ' AND modified>' . $time . ' AND owner=' . $owner . ' ORDER BY modified DESC;

I also heard this can be combined with the graph API, if thats really possible I would like to know it too. Thanks for the helpers.

回答1:

Currently it's not possible to apply a manual ordering in the Graph API. There are the since and until parameters, but they refer to the created timestamp, and not the updated timestamp IMHO. See

  • https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging

In general, FQL is usable until August 7th, 2016. So if this is a important use case for you, I'd recommend to stick with FQL and wait until the Graph API (maybe) gets augmented with this functionality.