MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / graphql_query_class

Method graphql_query_class

github/Requester.py:724–740  ·  view source on GitHub ↗

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]
    )

Source from the content-addressed store, hash-verified

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 """

Callers 3

get_discussionMethod · 0.80
testQueryRestClassMethod · 0.80
testQueryGraphQlClassMethod · 0.80

Calls 2

graphql_queryMethod · 0.95
data_as_classMethod · 0.95

Tested by

no test coverage detected