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

Method graphql_node_class

github/Requester.py:789–810  ·  view source on GitHub ↗

Fetches a GraphQL node by id in the give schema, and returns a PyGithub instance of the given class populated with the retrieved properties. Uses :func:`graph_node` to retrieve the GraphQl node. :param node_id: GraphQL node id :param output_schema: The sche

(
        self, node_id: str, output_schema: str, klass: type[T_gh], node_type: str | None = None
    )

Source from the content-addressed store, hash-verified

787 return headers, data
788
789 def graphql_node_class(
790 self, node_id: str, output_schema: str, klass: type[T_gh], node_type: str | None = None
791 ) -> T_gh:
792 """
793 Fetches a GraphQL node by id in the give schema, and returns a PyGithub instance of the given class populated
794 with the retrieved properties.
795
796 Uses :func:`graph_node` to retrieve the GraphQl node.
797
798 :param node_id: GraphQL node id
799 :param output_schema: The schema of the retrieved properties of the node, without enclosing curly brackets
800 :param klass: PyGithub class
801 :param node_type: Optional GraphQL node type, defaults to the name of the PyGithub class
802 :return: PyGithub class instance
803 :raises: :class:`GithubException` for error status codes
804
805 """
806 if node_type is None:
807 node_type = klass.__name__
808
809 headers, data = self.graphql_node(node_id, output_schema, node_type)
810 return self.data_as_class(headers, data, ["data", "node"], klass)
811
812 def graphql_named_mutation(
813 self, mutation_name: str, mutation_input: dict[str, Any], output_schema: str

Callers 2

testNodeClassMethod · 0.80

Calls 2

graphql_nodeMethod · 0.95
data_as_classMethod · 0.95

Tested by

no test coverage detected