ย้อนกลับไปที่ "ข่าวสำหรับผู้พัฒนา"

Updates to the Graph API

We’re happy to announce several improvements to the Graph API, which make it easier and faster to access data from the social graph. Here’s a summary of the updates:

Field expansion

Field expansion significantly improves performance for API calls and reduces your coding effort for retrieving data from the social graph. You can now make advanced Graph API queries to get the exact data you need, in fewer API calls. You can also create nested queries, similar to what you can do with FQL multi-queries. The call response maintains data hierarchy, so you don't have to post-process the data either.

As an example, you can request read properties from a user's first K albums and retrieve the first N photos in each album with one API call.

To get started, check out the documentation for field expansion.

Graph API Explorer with field expansion

To better understand the field expansion functionality, try playing around with node and edge schemas in the Graph API Explorer.

Pagination

For selected edges, we’ve introduced cursor-based offset paging. This improvement definitively indicates when you've reached the end or beginning of a data set. We'll no longer show the ‘previous’ or 'next' paging links when there's no new data. This translates to faster request processing times, saving you one round-trip every time you page through an entire collection. We're working on adding support for more edges.

Learn more about pagination.