( notification: GitifyNotification, )
| 214 | * Fetch GitHub Discussion by Discussion Number. |
| 215 | */ |
| 216 | export async function fetchDiscussionByNumber( |
| 217 | notification: GitifyNotification, |
| 218 | ): Promise<FetchDiscussionByNumberQuery> { |
| 219 | const number = getNumberFromUrl(notification.subject.url!); |
| 220 | |
| 221 | return performGraphQLRequest( |
| 222 | notification.account, |
| 223 | FetchDiscussionByNumberDocument, |
| 224 | { |
| 225 | owner: notification.repository.owner.login, |
| 226 | name: notification.repository.name, |
| 227 | number: number, |
| 228 | firstLabels: Constants.GRAPHQL_ARGS.FIRST_LABELS, |
| 229 | lastThreadedComments: Constants.GRAPHQL_ARGS.LAST_THREADED_COMMENTS, |
| 230 | lastReplies: Constants.GRAPHQL_ARGS.LAST_REPLIES, |
| 231 | includeIsAnswered: isAnsweredDiscussionFeatureSupported( |
| 232 | notification.account, |
| 233 | ), |
| 234 | }, |
| 235 | ); |
| 236 | } |
| 237 | |
| 238 | /** |
| 239 | * Fetch GitHub Issue by Issue Number. |
no test coverage detected