- Nodes — individual objects such as a user, page, or photo (e.g.
/me,/123456789) - Edges — connections between objects (e.g.
/me/friends,/me/posts) - Fields — specific properties of a node or edge (e.g.
name,email,id)
v21.0) and the SDK automatically appends the version configured in Settings.shared.graphAPIVersion.
How the SDK wraps Graph API
The SDK providesGraphRequest to build and execute API requests. You construct a request with a graph path and optional parameters, then call startWithCompletion(_:) to fire it. Results arrive in a completion handler on the main queue.
Authentication
Requests are authenticated usingAccessToken.current. When a user is logged in via Facebook Login, the SDK automatically attaches the current access token to every request. You can also supply an explicit token string when constructing a GraphRequest:
Settings.
Common use cases
- Fetching the current user’s profile (
/me) - Reading a user’s friends list (
/me/friends) - Querying pages or groups the user manages (
/me/accounts) - Publishing posts or actions on behalf of the user
- Reading ad insights or campaign data
Next steps
Making requests
Build and execute single Graph API requests.
Batch requests
Execute multiple requests in a single network call.