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

Method get_discussion

github/Repository.py:2594–2620  ·  view source on GitHub ↗
(
        self,
        number: int,
        discussion_graphql_schema: str,
    )

Source from the content-addressed store, hash-verified

2592 return github.Deployment.Deployment(self._requester, headers, data, completed=True)
2593
2594 def get_discussion(
2595 self,
2596 number: int,
2597 discussion_graphql_schema: str,
2598 ) -> RepositoryDiscussion:
2599 assert isinstance(number, int), number
2600 if not discussion_graphql_schema.startswith("\n"):
2601 discussion_graphql_schema = f" {discussion_graphql_schema} "
2602 query = (
2603 """
2604 query Q($repo: String!, $owner: String!, $number: Int!) {
2605 repository(name: $repo, owner: $owner) {
2606 discussion(number: $number) {"""
2607 + discussion_graphql_schema
2608 + """}
2609 }
2610 }
2611 """
2612 )
2613 variables = {
2614 "repo": self.name,
2615 "owner": self.owner.login,
2616 "number": number,
2617 }
2618 return self._requester.graphql_query_class(
2619 query, variables, ["repository", "discussion"], github.RepositoryDiscussion.RepositoryDiscussion
2620 )
2621
2622 def get_discussions(
2623 self,

Callers 1

testGetDiscussionMethod · 0.80

Calls 1

graphql_query_classMethod · 0.80

Tested by

no test coverage detected