(self, comment_graphql_schema: str)
| 106 | return self._repository.value |
| 107 | |
| 108 | def get_comments(self, comment_graphql_schema: str) -> PaginatedList[RepositoryDiscussionComment]: |
| 109 | if self._comments_page is not None: |
| 110 | return PaginatedList( |
| 111 | github.RepositoryDiscussionComment.RepositoryDiscussionComment, |
| 112 | self._requester, |
| 113 | firstData=self._comments_page, |
| 114 | firstHeaders={}, |
| 115 | ) |
| 116 | |
| 117 | if is_undefined(self._id): |
| 118 | raise RuntimeError("Retrieving discussion comments requires the discussion field 'id'") |
| 119 | if not comment_graphql_schema.startswith("\n"): |
| 120 | comment_graphql_schema = f" {comment_graphql_schema} " |
| 121 | |
| 122 | query = ( |
| 123 | """ |
| 124 | query Q($discussionId: ID!, $first: Int, $last: Int, $before: String, $after: String) { |
| 125 | node(id: $discussionId) { |
| 126 | ... on Discussion { |
| 127 | comments(first: $first, last: $last, before: $before, after: $after) { |
| 128 | totalCount |
| 129 | pageInfo { |
| 130 | startCursor |
| 131 | endCursor |
| 132 | hasNextPage |
| 133 | hasPreviousPage |
| 134 | } |
| 135 | nodes {""" |
| 136 | + comment_graphql_schema |
| 137 | + """} |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | }""" |
| 142 | ) |
| 143 | variables = {"discussionId": self.node_id} |
| 144 | return PaginatedList( |
| 145 | github.RepositoryDiscussionComment.RepositoryDiscussionComment, |
| 146 | self._requester, |
| 147 | graphql_query=query, |
| 148 | graphql_variables=variables, |
| 149 | list_item=["node", "comments"], |
| 150 | ) |
| 151 | |
| 152 | def get_labels(self) -> PaginatedList[Label]: |
| 153 | if self._labels_page is None: |
nothing calls this directly
no test coverage detected