diff --git a/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift b/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift index 853f9904f..fd7937c5f 100644 --- a/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift +++ b/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerCoordinatorTests.swift @@ -185,7 +185,7 @@ final class AsyncGraphQLQueryPagerCoordinatorTests: XCTestCase, CacheDependentTe nextQuery.__variables = [ "id": "2001", "first": 2, - "before": pageInfo.startCursor + "before": pageInfo.startCursor, ] return nextQuery } @@ -214,7 +214,7 @@ final class AsyncGraphQLQueryPagerCoordinatorTests: XCTestCase, CacheDependentTe nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } diff --git a/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerTests.swift b/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerTests.swift index 35b1b5d54..bd5188140 100644 --- a/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerTests.swift +++ b/Tests/ApolloPaginationTests/AsyncGraphQLQueryPagerTests.swift @@ -26,7 +26,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { initialQuery.__variables = [ "id": "2001", "first": 2, - "after": GraphQLNullable.null + "after": GraphQLNullable.null, ] let pager = AsyncGraphQLQueryPager( client: client, @@ -44,7 +44,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": page.endCursor + "after": page.endCursor, ] return nextQuery case .previous: @@ -82,7 +82,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { initialQuery.__variables = [ "id": "2001", "first": 2, - "after": GraphQLNullable.null + "after": GraphQLNullable.null, ] let pager = AsyncGraphQLQueryPager( client: client, @@ -100,7 +100,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": page.endCursor + "after": page.endCursor, ] return nextQuery case .previous: @@ -143,7 +143,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { initialQuery.__variables = [ "id": "2001", "first": 2, - "after": GraphQLNullable.null + "after": GraphQLNullable.null, ] let pager = AsyncGraphQLQueryPager( client: client, @@ -161,7 +161,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": page.endCursor + "after": page.endCursor, ] return nextQuery case .previous: @@ -199,7 +199,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { initialQuery.__variables = [ "id": "2001", "first": 2, - "after": GraphQLNullable.null + "after": GraphQLNullable.null, ] let pager = AsyncGraphQLQueryPager( client: client, @@ -217,7 +217,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": page.endCursor + "after": page.endCursor, ] return nextQuery case .previous: @@ -460,7 +460,7 @@ final class AsyncGraphQLQueryPagerTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } diff --git a/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift b/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift index ab4b29334..a19ec62b4 100644 --- a/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift +++ b/Tests/ApolloPaginationTests/BidirectionalPaginationTests.swift @@ -69,7 +69,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { "id": "2001", "first": 1, "after": pageInfo.endCursor, - "before": GraphQLNullable.null + "before": GraphQLNullable.null, ] return nextQuery case .previous: @@ -78,7 +78,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { "id": "2001", "first": 1, "before": pageInfo.startCursor, - "after": GraphQLNullable.null + "after": GraphQLNullable.null, ] return previousQuery } @@ -102,7 +102,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { subscription.cancel() var result = try await XCTUnwrapping(await pager.currentValue) results.append(result) - XCTAssertSuccessResult(result) { (output) in + XCTAssertSuccessResult(result) { output in XCTAssertTrue(output.nextPages.isEmpty) XCTAssertEqual(output.initialPage?.hero.friendsConnection.friends.count, 1) XCTAssertEqual(output.initialPage?.hero.friendsConnection.totalCount, 3) @@ -123,7 +123,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { result = try await XCTUnwrapping(await pager.currentValue) results.append(result) - try XCTAssertSuccessResult(result) { (output) in + try XCTAssertSuccessResult(result) { output in // Assert first page is unchanged XCTAssertEqual(try? results.first?.get().initialPage, try? results.last?.get().initialPage) @@ -155,7 +155,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { result = try await XCTUnwrapping(await pager.currentValue) results.append(result) - try XCTAssertSuccessResult(result) { (output) in + try XCTAssertSuccessResult(result) { output in // Assert first page is unchanged XCTAssertEqual(try? results.first?.get().initialPage, try? results.last?.get().initialPage) @@ -217,7 +217,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { subscription.cancel() var result = try await XCTUnwrapping(await pager.pager.currentValue) results.append(result) - XCTAssertSuccessResult(result) { (output) in + XCTAssertSuccessResult(result) { output in XCTAssertTrue(output.nextPages.isEmpty) XCTAssertEqual(output.initialPage?.hero.friendsConnection.friends.count, 1) XCTAssertEqual(output.initialPage?.hero.friendsConnection.totalCount, 3) @@ -238,7 +238,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { result = try await XCTUnwrapping(await pager.pager.currentValue) results.append(result) - try XCTAssertSuccessResult(result) { (output) in + try XCTAssertSuccessResult(result) { output in // Assert first page is unchanged XCTAssertEqual(try? results.first?.get().initialPage, try? results.last?.get().initialPage) @@ -266,7 +266,7 @@ final class BidirectionalPaginationTests: XCTestCase, CacheDependentTesting { result = try await XCTUnwrapping(await pager.pager.currentValue) results.append(result) - try XCTAssertSuccessResult(result) { (output) in + try XCTAssertSuccessResult(result) { output in // Assert first page is unchanged XCTAssertEqual(try? results.first?.get().initialPage, try? results.last?.get().initialPage) diff --git a/Tests/ApolloPaginationTests/ConcurrencyTest.swift b/Tests/ApolloPaginationTests/ConcurrencyTest.swift index 9d4ad0957..d42352af2 100644 --- a/Tests/ApolloPaginationTests/ConcurrencyTest.swift +++ b/Tests/ApolloPaginationTests/ConcurrencyTest.swift @@ -91,7 +91,7 @@ final class ConcurrencyTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } @@ -120,7 +120,7 @@ final class ConcurrencyTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } diff --git a/Tests/ApolloPaginationTests/ForwardPaginationTests.swift b/Tests/ApolloPaginationTests/ForwardPaginationTests.swift index eac214cc2..67461ece9 100644 --- a/Tests/ApolloPaginationTests/ForwardPaginationTests.swift +++ b/Tests/ApolloPaginationTests/ForwardPaginationTests.swift @@ -120,7 +120,7 @@ final class ForwardPaginationTests: XCTestCase, CacheDependentTesting { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": "Y3Vyc29yMg==" + "after": "Y3Vyc29yMg==", ] let expectedVariables = Set(nextQuery.__variables?.values.compactMap { $0._jsonEncodableValue?._jsonValue } ?? []) @@ -268,7 +268,7 @@ final class ForwardPaginationTests: XCTestCase, CacheDependentTesting { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } @@ -305,7 +305,7 @@ final class ForwardPaginationTests: XCTestCase, CacheDependentTesting { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } @@ -321,32 +321,32 @@ private extension Mocks.Hero.FriendsQuery { let pageInfo: [AnyHashable: AnyHashable] = [ "__typename": "PageInfo", "endCursor": "Y3Vyc29yMg==", - "hasNextPage": true + "hasNextPage": true, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Luke Skywalker", - "id": "1000" + "id": "1000", ], [ "__typename": "Human", "name": "Han Solo", - "id": "1002" - ] + "id": "1002", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ diff --git a/Tests/ApolloPaginationTests/FriendsQuery+TestHelpers.swift b/Tests/ApolloPaginationTests/FriendsQuery+TestHelpers.swift index 7e677bed6..fed0b74f4 100644 --- a/Tests/ApolloPaginationTests/FriendsQuery+TestHelpers.swift +++ b/Tests/ApolloPaginationTests/FriendsQuery+TestHelpers.swift @@ -10,32 +10,32 @@ extension Mocks.Hero.FriendsQuery { let pageInfo: [AnyHashable: AnyHashable] = [ "__typename": "PageInfo", "endCursor": "Y3Vyc29yMg==", - "hasNextPage": true + "hasNextPage": true, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Luke Skywalker", - "id": "1000" + "id": "1000", ], [ "__typename": "Human", "name": "Han Solo", - "id": "1002" - ] + "id": "1002", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -55,27 +55,27 @@ extension Mocks.Hero.FriendsQuery { let pageInfo: [AnyHashable: AnyHashable] = [ "__typename": "PageInfo", "endCursor": "Y3Vyc29yMw==", - "hasNextPage": false + "hasNextPage": false, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Leia Organa", - "id": "1003" - ] + "id": "1003", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -95,32 +95,32 @@ extension Mocks.Hero.FriendsQuery { let pageInfo: [AnyHashable: AnyHashable] = [ "__typename": "PageInfo", "endCursor": "Y3Vyc29yMg==", - "hasNextPage": true + "hasNextPage": true, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Luke Skywalker", - "id": "1000" + "id": "1000", ], [ "__typename": "Human", "name": "Han Solo", - "id": "1002" - ] + "id": "1002", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -135,8 +135,8 @@ extension Mocks.Hero.FriendsQuery { ], [ "message": "Some error" - ] - ] + ], + ], ] } } @@ -152,8 +152,8 @@ extension Mocks.Hero.FriendsQuery { ], [ "message": "Some error" - ] - ] + ], + ], ] } } @@ -169,8 +169,8 @@ extension Mocks.Hero.FriendsQuery { ], [ "message": "Some error" - ] - ] + ], + ], ] } } @@ -184,27 +184,27 @@ extension Mocks.Hero.ReverseFriendsQuery { let pageInfo: [AnyHashable: AnyHashable] = [ "__typename": "PageInfo", "startCursor": "Y3Vyc29yZg==", - "hasPreviousPage": false + "hasPreviousPage": false, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Luke Skywalker", - "id": "1000" - ] + "id": "1000", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -223,32 +223,32 @@ extension Mocks.Hero.ReverseFriendsQuery { let pageInfo: [AnyHashable: AnyHashable] = [ "__typename": "PageInfo", "startCursor": "Y3Vyc29yMg==", - "hasPreviousPage": true + "hasPreviousPage": true, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Han Solo", - "id": "1002" + "id": "1002", ], [ "__typename": "Human", "name": "Leia Organa", - "id": "1003" - ] + "id": "1003", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -272,27 +272,27 @@ extension Mocks.Hero.BidirectionalFriendsQuery { "startCursor": "Y3Vyc29yMw==", "hasPreviousPage": true, "endCursor": "Y3Vyc29yMg==", - "hasNextPage": true + "hasNextPage": true, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Leia Organa", - "id": "1003" - ] + "id": "1003", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -314,27 +314,27 @@ extension Mocks.Hero.BidirectionalFriendsQuery { "startCursor": "Y3Vyc29yMg==", "hasPreviousPage": true, "endCursor": "Y3Vyc29yMa==", - "hasNextPage": false + "hasNextPage": false, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Han Solo", - "id": "1002" - ] + "id": "1002", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -356,27 +356,27 @@ extension Mocks.Hero.BidirectionalFriendsQuery { "startCursor": "Y3Vyc29yMq==", "hasPreviousPage": false, "endCursor": "Y3Vyc29yMw==", - "hasNextPage": true + "hasNextPage": true, ] let friends: [[String: AnyHashable]] = [ [ "__typename": "Human", "name": "Luke Skywalker", - "id": "1000" - ] + "id": "1000", + ], ] let friendsConnection: [String: AnyHashable] = [ "__typename": "FriendsConnection", "totalCount": 3, "friends": friends, - "pageInfo": pageInfo + "pageInfo": pageInfo, ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friendsConnection": friendsConnection + "friendsConnection": friendsConnection, ] let data: [String: AnyHashable] = [ @@ -399,20 +399,20 @@ extension Mocks.Hero.OffsetFriendsQuery { [ "__typename": "Human", "name": "Luke Skywalker", - "id": "1000" + "id": "1000", ], [ "__typename": "Human", "name": "Han Solo", - "id": "1002" - ] + "id": "1002", + ], ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friends": friends + "friends": friends, ] let data: [String: AnyHashable] = [ @@ -433,15 +433,15 @@ extension Mocks.Hero.OffsetFriendsQuery { [ "__typename": "Human", "name": "Leia Organa", - "id": "1003" - ] + "id": "1003", + ], ] let hero: [String: AnyHashable] = [ "__typename": "Droid", "id": "2001", "name": "R2-D2", - "friends": friends + "friends": friends, ] let data: [String: AnyHashable] = [ diff --git a/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift b/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift index a937608a5..da3267db4 100644 --- a/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift +++ b/Tests/ApolloPaginationTests/GraphQLQueryPagerCoordinatorTests.swift @@ -63,7 +63,7 @@ final class GraphQLQueryPagerCoordinatorTests: XCTestCase, CacheDependentTesting nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } diff --git a/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift b/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift index ebe2671ff..6e1fff2db 100644 --- a/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift +++ b/Tests/ApolloPaginationTests/GraphQLQueryPagerTests.swift @@ -53,7 +53,7 @@ final class GraphQLQueryPagerTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } @@ -82,7 +82,7 @@ final class GraphQLQueryPagerTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "first": 2, - "before": pageInfo.startCursor + "before": pageInfo.startCursor, ] return nextQuery } diff --git a/Tests/ApolloPaginationTests/Mocks.swift b/Tests/ApolloPaginationTests/Mocks.swift index 19e679cb8..c86056f0b 100644 --- a/Tests/ApolloPaginationTests/Mocks.swift +++ b/Tests/ApolloPaginationTests/Mocks.swift @@ -20,8 +20,8 @@ enum Mocks { .field("friendsConnection", FriendsConnection.self, arguments: [ "first": .variable("first"), "before": .variable("before"), - "after": .variable("after") - ]) + "after": .variable("after"), + ]), ]} var name: String { __data["name"] } @@ -33,7 +33,7 @@ enum Mocks { .field("__typename", String.self), .field("totalCount", Int.self), .field("friends", [Character].self), - .field("pageInfo", PageInfo.self) + .field("pageInfo", PageInfo.self), ]} var totalCount: Int { __data["totalCount"] } @@ -44,7 +44,7 @@ enum Mocks { override class var __selections: [Selection] {[ .field("__typename", String.self), .field("name", String.self), - .field("id", String.self) + .field("id", String.self), ]} var name: String { __data["name"] } @@ -57,7 +57,7 @@ enum Mocks { .field("startCursor", Optional.self), .field("hasPreviousPage", Bool.self), .field("endCursor", Optional.self), - .field("hasNextPage", Bool.self) + .field("hasNextPage", Bool.self), ]} var endCursor: String? { __data["endCursor"] } @@ -82,8 +82,8 @@ enum Mocks { .field("name", String.self), .field("friendsConnection", FriendsConnection.self, arguments: [ "first": .variable("first"), - "before": .variable("before") - ]) + "before": .variable("before"), + ]), ]} var name: String { __data["name"] } @@ -95,7 +95,7 @@ enum Mocks { .field("__typename", String.self), .field("totalCount", Int.self), .field("friends", [Character].self), - .field("pageInfo", PageInfo.self) + .field("pageInfo", PageInfo.self), ]} var totalCount: Int { __data["totalCount"] } @@ -106,7 +106,7 @@ enum Mocks { override class var __selections: [Selection] {[ .field("__typename", String.self), .field("name", String.self), - .field("id", String.self) + .field("id", String.self), ]} var name: String { __data["name"] } @@ -117,7 +117,7 @@ enum Mocks { override class var __selections: [Selection] {[ .field("__typename", String.self), .field("startCursor", Optional.self), - .field("hasPreviousPage", Bool.self) + .field("hasPreviousPage", Bool.self), ]} var startCursor: String? { __data["startCursor"] } @@ -140,8 +140,8 @@ enum Mocks { .field("name", String.self), .field("friendsConnection", FriendsConnection.self, arguments: [ "first": .variable("first"), - "after": .variable("after") - ]) + "after": .variable("after"), + ]), ]} var name: String { __data["name"] } @@ -153,7 +153,7 @@ enum Mocks { .field("__typename", String.self), .field("totalCount", Int.self), .field("friends", [Character].self), - .field("pageInfo", PageInfo.self) + .field("pageInfo", PageInfo.self), ]} var totalCount: Int { __data["totalCount"] } @@ -164,7 +164,7 @@ enum Mocks { override class var __selections: [Selection] {[ .field("__typename", String.self), .field("name", String.self), - .field("id", String.self) + .field("id", String.self), ]} var name: String { __data["name"] } @@ -175,7 +175,7 @@ enum Mocks { override class var __selections: [Selection] {[ .field("__typename", String.self), .field("endCursor", Optional.self), - .field("hasNextPage", Bool.self) + .field("hasNextPage", Bool.self), ]} var endCursor: String? { __data["endCursor"] } @@ -199,8 +199,8 @@ enum Mocks { .field("name", String.self), .field("friends", [Character].self, arguments: [ "offset": .variable("offset"), - "limit": .variable("limit") - ]) + "limit": .variable("limit"), + ]), ]} var name: String { __data["name"] } @@ -211,7 +211,7 @@ enum Mocks { override class var __selections: [Selection] {[ .field("__typename", String.self), .field("name", String.self), - .field("id", String.self) + .field("id", String.self), ]} var name: String { __data["name"] } @@ -238,7 +238,7 @@ enum Mocks { static var __selections: [Selection] {[ .field("__typename", String.self), .field("id", String.self), - .field("name", String.self) + .field("name", String.self), ]} var id: String { diff --git a/Tests/ApolloPaginationTests/OffsetTests.swift b/Tests/ApolloPaginationTests/OffsetTests.swift index cc0436fc3..c752b0e6f 100644 --- a/Tests/ApolloPaginationTests/OffsetTests.swift +++ b/Tests/ApolloPaginationTests/OffsetTests.swift @@ -52,7 +52,7 @@ final class OffsetTests: XCTestCase { nextQuery.__variables = [ "id": "2001", "offset": pageInfo.offset, - "limit": pageSize + "limit": pageSize, ] return nextQuery } diff --git a/Tests/ApolloPaginationTests/ReversePaginationTests.swift b/Tests/ApolloPaginationTests/ReversePaginationTests.swift index dd295f836..7fe321f38 100644 --- a/Tests/ApolloPaginationTests/ReversePaginationTests.swift +++ b/Tests/ApolloPaginationTests/ReversePaginationTests.swift @@ -131,7 +131,7 @@ final class ReversePaginationTests: XCTestCase, CacheDependentTesting { nextQuery.__variables = [ "id": "2001", "first": 2, - "before": pageInfo.startCursor + "before": pageInfo.startCursor, ] return nextQuery } diff --git a/Tests/ApolloPaginationTests/SubscribeTests.swift b/Tests/ApolloPaginationTests/SubscribeTests.swift index ad0d8e0b4..3d5c319ef 100644 --- a/Tests/ApolloPaginationTests/SubscribeTests.swift +++ b/Tests/ApolloPaginationTests/SubscribeTests.swift @@ -93,7 +93,7 @@ final class SubscribeTest: XCTestCase, CacheDependentTesting { nextQuery.__variables = [ "id": "2001", "first": 2, - "after": pageInfo.endCursor + "after": pageInfo.endCursor, ] return nextQuery } diff --git a/apollo-ios-pagination/Package.swift b/apollo-ios-pagination/Package.swift index db7da8aad..99f0db844 100644 --- a/apollo-ios-pagination/Package.swift +++ b/apollo-ios-pagination/Package.swift @@ -8,7 +8,7 @@ let package = Package( .iOS(.v13), .macOS(.v10_15), .tvOS(.v13), - .watchOS(.v6) + .watchOS(.v6), ], products: [ .library(name: "ApolloPagination", targets: ["ApolloPagination"]), diff --git a/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift b/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift index 61200459f..31226545d 100644 --- a/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift +++ b/apollo-ios-pagination/Sources/ApolloPagination/AsyncGraphQLQueryPager.swift @@ -60,7 +60,6 @@ public class AsyncGraphQLQueryPager: Publisher { ) } - /// Subscribe to the results of the pager, with the management of the subscriber being stored internally to the `AnyGraphQLQueryPager`. /// - Parameter completion: The closure to trigger when new values come in. @available(*, deprecated, message: "Will be removed in a future version of ApolloPagination. Use the `Combine` publishers instead. If you need to dispatch to the main thread, make sure to use a `.receive(on: RunLoop.main)` as part of your `Combine` operation.") @@ -111,7 +110,7 @@ public class AsyncGraphQLQueryPager: Publisher { /// Resets pagination state and cancels in-flight updates from the pager. public func reset() async { - await pager.reset() + await pager.reset() } public func receive(