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 1 commit
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
12 changes: 10 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a link to the specific section of the Graph API documentation would be useful here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marty, I completely forgot about this simple request you had. Out of the blue my GitHub account popped in my mind and I have requested a pull with the changes you asked for. Thank you for this super useful SDK!


**Examples**

Expand All @@ -180,8 +185,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