Skip to content

Commit

Permalink
📝 add example
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Jul 28, 2024
1 parent c1572fc commit 0e080c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,13 @@ for result in github.graphql.paginate(
print(result)
```

Note that the `result` is a dict containing the list of nodes/edges for each page and the `pageInfo` object. You should iterate over the `nodes` or `edges` list to get the actual data.
Note that the `result` is a dict containing the list of nodes/edges for each page and the `pageInfo` object. You should iterate over the `nodes` or `edges` list to get the actual data. For example:

```python
for result in g.graphql.paginate(query, {"owner": "owner", "repo": "repo"}):
for issue in result["repository"]["issues"]["nodes"]:
print(issue)
```

You can also provide a initial cursor value to start pagination from a specific point:

Expand Down

0 comments on commit 0e080c6

Please sign in to comment.