Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand the documentation for get_connection #400

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ Returns all connections for a given object as a ``dict``.
between objects, e.g., feed, friends, groups, likes, posts. If left empty,
``get_connections`` will simply return the authenticated user's basic
information.
* ``fields`` – A ``string`` or group of (comma separated) ``strings``. Accepts one
or more fields of the edge specified in connection_name, or one or more
fields/edges of the node connected to the given object_id by said edge.
This parameter allows for nested queries to the GraphAPI, supported by the
field expansion feature. See the GraphAPI docs for syntax and further examples at
https://developers.facebook.com/docs/graph-api/using-graph-api/

**Examples**

Expand All @@ -180,8 +186,11 @@ Returns all connections for a given object as a ``dict``.
friends = graph.get_connections(id='me', connection_name='friends')

# Get the comments from a post.
comments = graph.get_connections(id='post_id', connection_name='comments')

comments = graph.get_connections(id='post_id', connection_name='comments')}

# Get the photos from a user, requesting info available from node "Photo".
# Note that only the edge "Page Photos" ("photos") is referenced.
photos = graph.get_connections(id='me', 'photos', fields='created_time','likes.summary(total_count)')

get_all_connections
^^^^^^^^^^^^^^^^^^^
Expand Down