Skip to content
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
35 changes: 35 additions & 0 deletions docs/api-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,41 @@ Name | Description
The method returns the query results as a stucture of `list`s and `dict`s as returned by the `json` package.


**Example**

See the `metadata_query.py` sample in the Samples directory.

<br>
<br>

#### metadata.paginated_query


```py
metadata.paginated_query(query, variables=None, abort_on_error=False)
```

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.

**Example**

See the `metadata_paginated_query.py` sample in the Samples directory.


**Parameters**

Name | Description
:--- | :---
`query` | The GraphQL query
`variables` | Variables for the GraphQL query
`abort_on_error` | Whether to throw an exception on error


**Returns**

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.


**Example**

See the `metadata_query.py` sample in the Samples directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

delete this trailing Example reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jacalata Removed the example reference above the parameters section, and updated the trailing example reference to the proper sample.

Expand Down