Skip to content

Commit

Permalink
usage docs (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Iron-Ham authored and gh-action-runner committed Feb 23, 2024
1 parent 11f3604 commit bda25cd
Show file tree
Hide file tree
Showing 380 changed files with 199,121 additions and 13 deletions.
2 changes: 2 additions & 0 deletions SwiftScripts/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let package = Package(
dependencies: [
.package(name: "Apollo", path: "../apollo-ios"),
.package(name: "ApolloCodegen", path: "../apollo-ios-codegen"),
.package(name: "ApolloPagination", path: "../apollo-ios-pagination"),
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMajor(from: "1.2.0")),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
],
Expand Down Expand Up @@ -40,6 +41,7 @@ let package = Package(
.product(name: "ApolloAPI", package: "Apollo"),
.product(name: "ApolloSQLite", package: "Apollo"),
.product(name: "ApolloWebSocket", package: "Apollo"),
.product(name: "ApolloPagination", package: "ApolloPagination"),
.target(name: "SwiftScriptHelpers")
]
),
Expand Down
1 change: 1 addition & 0 deletions SwiftScripts/Sources/DocumentationGenerator/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enum Target: String, CaseIterable {
case ApolloSQLite
case ApolloWebSocket
case ApolloCodegenLib
case ApolloPagination

var name: String {
self.rawValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ public class AsyncGraphQLQueryPager<Model>: Publisher {
/// Resets pagination state and cancels further updates from the pager.
public func cancel() async {
await pager.cancel()
_subject.send(completion: .finished)
cancellables.removeAll()
}

public func receive<S>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public extension GraphQLQueryPager {
client: ApolloClientProtocol,
watcherDispatchQueue: DispatchQueue = .main,
initialQuery: InitialQuery,
pageResolver: @escaping (P, PaginationDirection) -> InitialQuery,
pageResolver: @escaping (P, PaginationDirection) -> InitialQuery?,
extractPageInfo: @escaping (InitialQuery.Data) -> P
) -> GraphQLQueryPager where Model == PaginationOutput<InitialQuery, InitialQuery> {
GraphQLQueryPager(pager: GraphQLQueryPagerCoordinator(
Expand All @@ -27,7 +27,7 @@ public extension GraphQLQueryPager {
client: ApolloClientProtocol,
watcherDispatchQueue: DispatchQueue = .main,
initialQuery: InitialQuery,
pageResolver: @escaping (P, PaginationDirection) -> InitialQuery,
pageResolver: @escaping (P, PaginationDirection) -> InitialQuery?,
extractPageInfo: @escaping (InitialQuery.Data) -> P,
transform: @escaping ([InitialQuery.Data], InitialQuery.Data, [InitialQuery.Data]) throws -> Model
) -> GraphQLQueryPager {
Expand All @@ -48,7 +48,7 @@ public extension GraphQLQueryPager {
client: ApolloClientProtocol,
watcherDispatchQueue: DispatchQueue = .main,
initialQuery: InitialQuery,
pageResolver: @escaping (P, PaginationDirection) -> InitialQuery,
pageResolver: @escaping (P, PaginationDirection) -> InitialQuery?,
extractPageInfo: @escaping (InitialQuery.Data) -> P,
transform: @escaping (InitialQuery.Data) throws -> Model
) -> GraphQLQueryPager where Model: RangeReplaceableCollection, T == Model.Element {
Expand All @@ -72,7 +72,7 @@ public extension GraphQLQueryPager {
watcherDispatchQueue: DispatchQueue = .main,
extractInitialPageInfo: @escaping (InitialQuery.Data) -> P,
extractNextPageInfo: @escaping (PaginatedQuery.Data) -> P,
pageResolver: @escaping (P, PaginationDirection) -> PaginatedQuery
pageResolver: @escaping (P, PaginationDirection) -> PaginatedQuery?
) -> GraphQLQueryPager where Model == PaginationOutput<InitialQuery, PaginatedQuery> {
GraphQLQueryPager(
pager: .init(
Expand All @@ -95,7 +95,7 @@ public extension GraphQLQueryPager {
watcherDispatchQueue: DispatchQueue = .main,
extractInitialPageInfo: @escaping (InitialQuery.Data) -> P,
extractNextPageInfo: @escaping (PaginatedQuery.Data) -> P,
pageResolver: @escaping (P, PaginationDirection) -> PaginatedQuery,
pageResolver: @escaping (P, PaginationDirection) -> PaginatedQuery?,
transform: @escaping ([PaginatedQuery.Data], InitialQuery.Data, [PaginatedQuery.Data]) throws -> Model
) -> GraphQLQueryPager where Model == PaginationOutput<InitialQuery, PaginatedQuery> {
GraphQLQueryPager(
Expand All @@ -120,7 +120,7 @@ public extension GraphQLQueryPager {
watcherDispatchQueue: DispatchQueue = .main,
extractInitialPageInfo: @escaping (InitialQuery.Data) -> P,
extractNextPageInfo: @escaping (PaginatedQuery.Data) -> P,
pageResolver: @escaping (P, PaginationDirection) -> PaginatedQuery,
pageResolver: @escaping (P, PaginationDirection) -> PaginatedQuery?,
initialTransform: @escaping (InitialQuery.Data) throws -> Model,
pageTransform: @escaping (PaginatedQuery.Data) throws -> Model
) -> GraphQLQueryPager where Model: RangeReplaceableCollection, T == Model.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ public class GraphQLQueryPager<Model>: Publisher {
/// Resets pagination state and cancels further updates from the pager.
public func cancel() {
pager.cancel()
_subject.send(completion: .finished)
cancellables.removeAll()
}

public func receive<S>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,14 @@
"text" : " conforms to ",
"type" : "text"
},
{
"code" : "AnyScalarType",
"type" : "codeVoice"
},
{
"text" : " and ",
"type" : "text"
},
{
"code" : "Hashable",
"type" : "codeVoice"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"defaultImplementationsSections" : [
{
"identifiers" : [
"doc:\/\/ApolloAPI\/documentation\/ApolloAPI\/GraphQLOperation\/operationType-90ybj",
"doc:\/\/ApolloAPI\/documentation\/ApolloAPI\/GraphQLOperation\/operationType-370r3",
"doc:\/\/ApolloAPI\/documentation\/ApolloAPI\/GraphQLOperation\/operationType-5e63x",
"doc:\/\/ApolloAPI\/documentation\/ApolloAPI\/GraphQLOperation\/operationType-90ybj"
"doc:\/\/ApolloAPI\/documentation\/ApolloAPI\/GraphQLOperation\/operationType-5e63x"
],
"title" : "GraphQLOperation Implementations"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@
"type" : "text"
},
{
"code" : "AnyScalarType",
"code" : "JSONEncodable",
"type" : "codeVoice"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@
"text" : " conforms to ",
"type" : "text"
},
{
"code" : "AnyScalarType",
"type" : "codeVoice"
},
{
"text" : " and ",
"type" : "text"
},
{
"code" : "Hashable",
"type" : "codeVoice"
Expand Down Expand Up @@ -446,7 +454,7 @@
"type" : "text"
},
{
"code" : "AnyScalarType",
"code" : "JSONEncodable",
"type" : "codeVoice"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,7 @@
"doc://ApolloCodegenLib/documentation/ApolloCodegenLib/ApolloCodegenConfiguration/OutputOptions/pruneGeneratedFiles": {
"abstract" : [
{
"text" : "Whether unused generated files will be automatically deleted.",
"text" : "Whether unused previously generated files will be automatically deleted.",
"type" : "text"
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"abstract" : [
{
"text" : "Whether unused generated files will be automatically deleted.",
"text" : "Whether unused previously generated files will be automatically deleted.",
"type" : "text"
}
],
Expand Down Expand Up @@ -520,7 +520,7 @@
"doc://ApolloCodegenLib/documentation/ApolloCodegenLib/ApolloCodegenConfiguration/OutputOptions/pruneGeneratedFiles": {
"abstract" : [
{
"text" : "Whether unused generated files will be automatically deleted.",
"text" : "Whether unused previously generated files will be automatically deleted.",
"type" : "text"
}
],
Expand Down
Loading

0 comments on commit bda25cd

Please sign in to comment.