@@ -2088,25 +2088,31 @@ public final class RepoFileHistoryQuery: GraphQLQuery {
2088
2088
2089
2089
public final class RepositoryInfoQuery: GraphQLQuery {
2090
2090
public let operationDefinition =
2091
- "query RepositoryInfo($owner: String!, $name: String!) {\n repository(owner: $owner, name: $name) {\n __typename\n id\n defaultBranchRef {\n __typename\n name\n }\n hasIssuesEnabled\n }\n}"
2091
+ "query RepositoryInfo($owner: String!, $name: String!, $issueQuery: String!, $prQuery: String! ) {\n repository(owner: $owner, name: $name) {\n __typename\n id\n defaultBranchRef {\n __typename\n name\n }\n hasIssuesEnabled\n }\n repoIssueOverview: search(query: $issueQuery, type: ISSUE) {\n __typename\n issueCount\n }\n repoPullRequestOverView: search(query: $prQuery, type: ISSUE) {\n __typename\n issueCount \n }\n}"
2092
2092
2093
2093
public var owner: String
2094
2094
public var name: String
2095
+ public var issueQuery: String
2096
+ public var prQuery: String
2095
2097
2096
- public init(owner: String, name: String) {
2098
+ public init(owner: String, name: String, issueQuery: String, prQuery: String ) {
2097
2099
self.owner = owner
2098
2100
self.name = name
2101
+ self.issueQuery = issueQuery
2102
+ self.prQuery = prQuery
2099
2103
}
2100
2104
2101
2105
public var variables: GraphQLMap? {
2102
- return ["owner": owner, "name": name]
2106
+ return ["owner": owner, "name": name, "issueQuery": issueQuery, "prQuery": prQuery ]
2103
2107
}
2104
2108
2105
2109
public struct Data: GraphQLSelectionSet {
2106
2110
public static let possibleTypes = ["Query"]
2107
2111
2108
2112
public static let selections: [GraphQLSelection] = [
2109
2113
GraphQLField("repository", arguments: ["owner": GraphQLVariable("owner"), "name": GraphQLVariable("name")], type: .object(Repository.selections)),
2114
+ GraphQLField("search", alias: "repoIssueOverview", arguments: ["query": GraphQLVariable("issueQuery"), "type": "ISSUE"], type: .nonNull(.object(RepoIssueOverview.selections))),
2115
+ GraphQLField("search", alias: "repoPullRequestOverView", arguments: ["query": GraphQLVariable("prQuery"), "type": "ISSUE"], type: .nonNull(.object(RepoPullRequestOverView.selections))),
2110
2116
]
2111
2117
2112
2118
public private(set) var resultMap: ResultMap
@@ -2115,8 +2121,8 @@ public final class RepositoryInfoQuery: GraphQLQuery {
2115
2121
self.resultMap = unsafeResultMap
2116
2122
}
2117
2123
2118
- public init(repository: Repository? = nil) {
2119
- self.init(unsafeResultMap: ["__typename": "Query", "repository": repository.flatMap { (value: Repository) -> ResultMap in value.resultMap }])
2124
+ public init(repository: Repository? = nil, repoIssueOverview: RepoIssueOverview, repoPullRequestOverView: RepoPullRequestOverView ) {
2125
+ self.init(unsafeResultMap: ["__typename": "Query", "repository": repository.flatMap { (value: Repository) -> ResultMap in value.resultMap }, "repoIssueOverview": repoIssueOverview.resultMap, "repoPullRequestOverView": repoPullRequestOverView.resultMap ])
2120
2126
}
2121
2127
2122
2128
/// Lookup a given repository by the owner and repository name.
@@ -2129,6 +2135,26 @@ public final class RepositoryInfoQuery: GraphQLQuery {
2129
2135
}
2130
2136
}
2131
2137
2138
+ /// Perform a search across resources.
2139
+ public var repoIssueOverview: RepoIssueOverview {
2140
+ get {
2141
+ return RepoIssueOverview(unsafeResultMap: resultMap["repoIssueOverview"]! as! ResultMap)
2142
+ }
2143
+ set {
2144
+ resultMap.updateValue(newValue.resultMap, forKey: "repoIssueOverview")
2145
+ }
2146
+ }
2147
+
2148
+ /// Perform a search across resources.
2149
+ public var repoPullRequestOverView: RepoPullRequestOverView {
2150
+ get {
2151
+ return RepoPullRequestOverView(unsafeResultMap: resultMap["repoPullRequestOverView"]! as! ResultMap)
2152
+ }
2153
+ set {
2154
+ resultMap.updateValue(newValue.resultMap, forKey: "repoPullRequestOverView")
2155
+ }
2156
+ }
2157
+
2132
2158
public struct Repository: GraphQLSelectionSet {
2133
2159
public static let possibleTypes = ["Repository"]
2134
2160
@@ -2225,6 +2251,82 @@ public final class RepositoryInfoQuery: GraphQLQuery {
2225
2251
}
2226
2252
}
2227
2253
}
2254
+
2255
+ public struct RepoIssueOverview: GraphQLSelectionSet {
2256
+ public static let possibleTypes = ["SearchResultItemConnection"]
2257
+
2258
+ public static let selections: [GraphQLSelection] = [
2259
+ GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
2260
+ GraphQLField("issueCount", type: .nonNull(.scalar(Int.self))),
2261
+ ]
2262
+
2263
+ public private(set) var resultMap: ResultMap
2264
+
2265
+ public init(unsafeResultMap: ResultMap) {
2266
+ self.resultMap = unsafeResultMap
2267
+ }
2268
+
2269
+ public init(issueCount: Int) {
2270
+ self.init(unsafeResultMap: ["__typename": "SearchResultItemConnection", "issueCount": issueCount])
2271
+ }
2272
+
2273
+ public var __typename: String {
2274
+ get {
2275
+ return resultMap["__typename"]! as! String
2276
+ }
2277
+ set {
2278
+ resultMap.updateValue(newValue, forKey: "__typename")
2279
+ }
2280
+ }
2281
+
2282
+ /// The number of issues that matched the search query.
2283
+ public var issueCount: Int {
2284
+ get {
2285
+ return resultMap["issueCount"]! as! Int
2286
+ }
2287
+ set {
2288
+ resultMap.updateValue(newValue, forKey: "issueCount")
2289
+ }
2290
+ }
2291
+ }
2292
+
2293
+ public struct RepoPullRequestOverView: GraphQLSelectionSet {
2294
+ public static let possibleTypes = ["SearchResultItemConnection"]
2295
+
2296
+ public static let selections: [GraphQLSelection] = [
2297
+ GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
2298
+ GraphQLField("issueCount", type: .nonNull(.scalar(Int.self))),
2299
+ ]
2300
+
2301
+ public private(set) var resultMap: ResultMap
2302
+
2303
+ public init(unsafeResultMap: ResultMap) {
2304
+ self.resultMap = unsafeResultMap
2305
+ }
2306
+
2307
+ public init(issueCount: Int) {
2308
+ self.init(unsafeResultMap: ["__typename": "SearchResultItemConnection", "issueCount": issueCount])
2309
+ }
2310
+
2311
+ public var __typename: String {
2312
+ get {
2313
+ return resultMap["__typename"]! as! String
2314
+ }
2315
+ set {
2316
+ resultMap.updateValue(newValue, forKey: "__typename")
2317
+ }
2318
+ }
2319
+
2320
+ /// The number of issues that matched the search query.
2321
+ public var issueCount: Int {
2322
+ get {
2323
+ return resultMap["issueCount"]! as! Int
2324
+ }
2325
+ set {
2326
+ resultMap.updateValue(newValue, forKey: "issueCount")
2327
+ }
2328
+ }
2329
+ }
2228
2330
}
2229
2331
}
2230
2332
0 commit comments