Skip to content

Commit b870a4b

Browse files
committed
Upgrade generated API.swift
1 parent 120365a commit b870a4b

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

GitHub-GraphQL-API-Example-iOS/API.swift

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
122122
}
123123

124124
public struct Node: GraphQLSelectionSet {
125-
public static let possibleTypes = ["Issue", "PullRequest", "Repository", "User", "Organization"]
125+
public static let possibleTypes = ["Issue", "PullRequest", "Repository", "User", "Organization", "MarketplaceListing"]
126126

127127
public static let selections: [GraphQLSelection] = [
128128
GraphQLTypeCase(
@@ -155,6 +155,10 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
155155
return Node(snapshot: ["__typename": "Organization"])
156156
}
157157

158+
public static func makeMarketplaceListing() -> Node {
159+
return Node(snapshot: ["__typename": "MarketplaceListing"])
160+
}
161+
158162
public static func makeRepository(name: String, owner: AsRepository.Owner, stargazers: AsRepository.Stargazer, url: String) -> Node {
159163
return Node(snapshot: ["__typename": "Repository", "name": name, "owner": owner.snapshot, "stargazers": stargazers.snapshot, "url": url])
160164
}
@@ -230,7 +234,7 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
230234
}
231235
}
232236

233-
/// A list of users who have starred this repository.
237+
/// A list of users who have starred this starrable.
234238
public var stargazers: Stargazer {
235239
get {
236240
return Stargazer(snapshot: snapshot["stargazers"]! as! Snapshot)
@@ -240,7 +244,7 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
240244
}
241245
}
242246

243-
/// The HTTP url for this repository
247+
/// The HTTP URL for this repository
244248
public var url: String {
245249
get {
246250
return snapshot["url"]! as! String
@@ -277,7 +281,7 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
277281

278282
public static let selections: [GraphQLSelection] = [
279283
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
280-
GraphQLField("path", type: .nonNull(.scalar(String.self))),
284+
GraphQLField("resourcePath", type: .nonNull(.scalar(String.self))),
281285
]
282286

283287
public var snapshot: Snapshot
@@ -286,12 +290,12 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
286290
self.snapshot = snapshot
287291
}
288292

289-
public static func makeOrganization(path: String) -> Owner {
290-
return Owner(snapshot: ["__typename": "Organization", "path": path])
293+
public static func makeOrganization(resourcePath: String) -> Owner {
294+
return Owner(snapshot: ["__typename": "Organization", "resourcePath": resourcePath])
291295
}
292296

293-
public static func makeUser(path: String) -> Owner {
294-
return Owner(snapshot: ["__typename": "User", "path": path])
297+
public static func makeUser(resourcePath: String) -> Owner {
298+
return Owner(snapshot: ["__typename": "User", "resourcePath": resourcePath])
295299
}
296300

297301
public var __typename: String {
@@ -303,13 +307,13 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
303307
}
304308
}
305309

306-
/// The HTTP url for the owner.
307-
public var path: String {
310+
/// The HTTP URL for the owner.
311+
public var resourcePath: String {
308312
get {
309-
return snapshot["path"]! as! String
313+
return snapshot["resourcePath"]! as! String
310314
}
311315
set {
312-
snapshot.updateValue(newValue, forKey: "path")
316+
snapshot.updateValue(newValue, forKey: "resourcePath")
313317
}
314318
}
315319
}
@@ -360,7 +364,7 @@ public final class SearchRepositoriesQuery: GraphQLQuery {
360364

361365
public struct RepositoryDetails: GraphQLFragment {
362366
public static let fragmentString =
363-
"fragment RepositoryDetails on Repository {\n __typename\n name\n owner {\n __typename\n path\n }\n stargazers {\n __typename\n totalCount\n }\n url\n}"
367+
"fragment RepositoryDetails on Repository {\n __typename\n name\n owner {\n __typename\n resourcePath\n }\n stargazers {\n __typename\n totalCount\n }\n url\n}"
364368

365369
public static let possibleTypes = ["Repository"]
366370

@@ -411,7 +415,7 @@ public struct RepositoryDetails: GraphQLFragment {
411415
}
412416
}
413417

414-
/// A list of users who have starred this repository.
418+
/// A list of users who have starred this starrable.
415419
public var stargazers: Stargazer {
416420
get {
417421
return Stargazer(snapshot: snapshot["stargazers"]! as! Snapshot)
@@ -421,7 +425,7 @@ public struct RepositoryDetails: GraphQLFragment {
421425
}
422426
}
423427

424-
/// The HTTP url for this repository
428+
/// The HTTP URL for this repository
425429
public var url: String {
426430
get {
427431
return snapshot["url"]! as! String
@@ -436,7 +440,7 @@ public struct RepositoryDetails: GraphQLFragment {
436440

437441
public static let selections: [GraphQLSelection] = [
438442
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
439-
GraphQLField("path", type: .nonNull(.scalar(String.self))),
443+
GraphQLField("resourcePath", type: .nonNull(.scalar(String.self))),
440444
]
441445

442446
public var snapshot: Snapshot
@@ -445,12 +449,12 @@ public struct RepositoryDetails: GraphQLFragment {
445449
self.snapshot = snapshot
446450
}
447451

448-
public static func makeOrganization(path: String) -> Owner {
449-
return Owner(snapshot: ["__typename": "Organization", "path": path])
452+
public static func makeOrganization(resourcePath: String) -> Owner {
453+
return Owner(snapshot: ["__typename": "Organization", "resourcePath": resourcePath])
450454
}
451455

452-
public static func makeUser(path: String) -> Owner {
453-
return Owner(snapshot: ["__typename": "User", "path": path])
456+
public static func makeUser(resourcePath: String) -> Owner {
457+
return Owner(snapshot: ["__typename": "User", "resourcePath": resourcePath])
454458
}
455459

456460
public var __typename: String {
@@ -462,13 +466,13 @@ public struct RepositoryDetails: GraphQLFragment {
462466
}
463467
}
464468

465-
/// The HTTP url for the owner.
466-
public var path: String {
469+
/// The HTTP URL for the owner.
470+
public var resourcePath: String {
467471
get {
468-
return snapshot["path"]! as! String
472+
return snapshot["resourcePath"]! as! String
469473
}
470474
set {
471-
snapshot.updateValue(newValue, forKey: "path")
475+
snapshot.updateValue(newValue, forKey: "resourcePath")
472476
}
473477
}
474478
}

0 commit comments

Comments
 (0)