Skip to content

Commit 44e0759

Browse files
authored
docs: metadata.paginated_query (#1662)
1 parent 7afa4f5 commit 44e0759

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/api-ref.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,38 @@ See the `metadata_query.py` sample in the Samples directory.
16381638
<br>
16391639
<br>
16401640

1641+
#### metadata.paginated_query
1642+
1643+
1644+
```py
1645+
metadata.paginated_query(query, variables=None, abort_on_error=False)
1646+
```
1647+
1648+
Executes a metadata query, and returns a dictionary containing a list of the results. In order to properly paginate through all the results, the query must contain a field `pageInfo` with the subfields `hasNextPage` and `endCursor`, as well as the nodes to be returned. The query must accept the variables `first` (the number of items to return) and `afterToken` (the cursor after which to return items). The method will repeatedly call the metadata endpoint until all results have been retrieved, and return a dictionary containing a list of all results.
1649+
1650+
1651+
1652+
**Parameters**
1653+
1654+
Name | Description
1655+
:--- | :---
1656+
`query` | The GraphQL query
1657+
`variables` | Variables for the GraphQL query
1658+
`abort_on_error` | Whether to throw an exception on error
1659+
1660+
1661+
**Returns**
1662+
1663+
The method returns the query results in a dictionary containing a list of pages as a stucture of `list`s and `dict`s as returned by the `json` package.
1664+
1665+
1666+
**Example**
1667+
1668+
See the `metadata_paginated_query.py` sample in the Samples directory.
1669+
1670+
<br>
1671+
<br>
1672+
16411673
---
16421674

16431675
## Metrics

0 commit comments

Comments
 (0)