Skip to content

Commit

Permalink
Merge pull request #33 from winebarrel/remove_comment
Browse files Browse the repository at this point in the history
Remove comment
  • Loading branch information
winebarrel authored Nov 24, 2024
2 parents 87d1b30 + 8afa313 commit 7b9bfa6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extension Github {
static let operationName: String = "SearchPullRequests"
static let operationDocument: ApolloAPI.OperationDocument = .init(
definition: .init(
#"query SearchPullRequests($query: String!) { search(type: ISSUE, last: 100, query: $query) { __typename nodes { __typename ... on PullRequest { repository { __typename name owner { __typename login } } title url reviewDecision mergeable isDraft updatedAt comments(last: 1) { __typename nodes { __typename author { __typename login } bodyText } } commits(last: 1) { __typename nodes { __typename commit { __typename url statusCheckRollup { __typename state } } } } reviews(states: APPROVED) { __typename totalCount } } } } }"#
#"query SearchPullRequests($query: String!) { search(type: ISSUE, last: 100, query: $query) { __typename nodes { __typename ... on PullRequest { repository { __typename name owner { __typename login } } title url reviewDecision mergeable isDraft updatedAt comments(last: 1) { __typename nodes { __typename author { __typename login } } } commits(last: 1) { __typename nodes { __typename commit { __typename url statusCheckRollup { __typename state } } } } reviews(states: APPROVED) { __typename totalCount } } } } }"#
))

public var query: String
Expand Down Expand Up @@ -173,13 +173,10 @@ extension Github {
static var __selections: [ApolloAPI.Selection] { [
.field("__typename", String.self),
.field("author", Author?.self),
.field("bodyText", String.self),
] }

/// The actor who authored the comment.
var author: Author? { __data["author"] }
/// The body rendered to text.
var bodyText: String { __data["bodyText"] }

/// Search.Node.AsPullRequest.Comments.Node.Author
///
Expand Down
1 change: 0 additions & 1 deletion Pulse/Github/SearchPullRequests.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ query SearchPullRequests($query: String!) {
author {
login
}
bodyText
}
}
commits(last: 1) {
Expand Down
2 changes: 0 additions & 2 deletions Pulse/PullRequestAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ struct PullRequest: Identifiable {
let url: String
let mergeable: Github.MergeableState // NOTE: It might use
let commitUrl: String
let comment: String?
let commentAuthor: String?
let draft: Bool
let approvedCount: Int
Expand Down Expand Up @@ -114,7 +113,6 @@ struct PullRequestAPI {
url: asPull.url,
mergeable: asPull.mergeable.value ?? Github.MergeableState.unknown,
commitUrl: commit.url,
comment: asPull.comments.nodes?.first??.bodyText,
commentAuthor: asPull.comments.nodes?.first??.author?.login,
draft: asPull.isDraft,
approvedCount: asPull.reviews?.totalCount ?? 0,
Expand Down

0 comments on commit 7b9bfa6

Please sign in to comment.