Queries the GraphQL API, extracts data from a given path, populates and returns a PyGithub class instance. Uses :func:`graphql_query` to query the GraphQL API. :param query: GraphQL query :param data_path: GraphQL path in the response to extract the properties for
(
self, query: str, variables: dict[str, Any], data_path: list[str], klass: type[T_gh]
)
| 722 | return response_headers, data |
| 723 | |
| 724 | def graphql_query_class( |
| 725 | self, query: str, variables: dict[str, Any], data_path: list[str], klass: type[T_gh] |
| 726 | ) -> T_gh: |
| 727 | """ |
| 728 | Queries the GraphQL API, extracts data from a given path, populates and returns a PyGithub class instance. |
| 729 | |
| 730 | Uses :func:`graphql_query` to query the GraphQL API. |
| 731 | |
| 732 | :param query: GraphQL query |
| 733 | :param data_path: GraphQL path in the response to extract the properties for the class to return |
| 734 | :param klass: PyGithub class |
| 735 | :return: PyGithub class instance |
| 736 | :raises: :class:`GithubException` for error status codes |
| 737 | |
| 738 | """ |
| 739 | headers, data = self.graphql_query(query, variables) |
| 740 | return self.data_as_class(headers, data, ["data"] + data_path, klass) |
| 741 | |
| 742 | def graphql_node(self, node_id: str, output_schema: str, node_type: str) -> tuple[dict[str, Any], dict[str, Any]]: |
| 743 | """ |
no test coverage detected