Skip to content

Commit 1dac620

Browse files
chore: Remove Swift 6 warnings
1 parent 2b0db26 commit 1dac620

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

Sources/GraphQL/Execution/Values.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func getVariableValue(
8888
definitionAST: VariableDefinition,
8989
input: Map
9090
) throws -> Map {
91-
var type = typeFromAST(schema: schema, inputTypeAST: definitionAST.type)
91+
let type = typeFromAST(schema: schema, inputTypeAST: definitionAST.type)
9292
let variable = definitionAST.variable
9393

9494
guard let inputType = type as? GraphQLInputType else {

Sources/GraphQL/GraphQL.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import NIO
22

3-
public struct GraphQLResult: Equatable, Codable, CustomStringConvertible {
3+
public struct GraphQLResult: Equatable, Codable, Sendable, CustomStringConvertible {
44
public var data: Map?
55
public var errors: [GraphQLError]
66

Sources/GraphQL/Map/Map.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public enum MapError: Error {
1111

1212
// MARK: Map
1313

14-
public enum Map {
14+
public enum Map: Sendable {
1515
case undefined
1616
case null
1717
case bool(Bool)
@@ -600,7 +600,7 @@ public extension Map {
600600
}
601601
}
602602

603-
extension String: CodingKey {
603+
extension String: @retroactive CodingKey {
604604
public var stringValue: String {
605605
return self
606606
}

Sources/GraphQL/Map/Number.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

3-
public struct Number {
4-
public enum StorageType {
3+
public struct Number: Sendable {
4+
public enum StorageType: Sendable {
55
case bool
66
case int
77
case double

Sources/GraphQL/Utilities/NIO+Extensions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ extension Future {
8989

9090
public protocol FutureType {
9191
associatedtype Expectation
92-
func whenSuccess(_ callback: @escaping (Expectation) -> Void)
93-
func whenFailure(_ callback: @escaping (Error) -> Void)
92+
func whenSuccess(_ callback: @escaping @Sendable (Expectation) -> Void)
93+
func whenFailure(_ callback: @escaping @Sendable (Error) -> Void)
9494
func map<NewValue>(
9595
file: StaticString,
9696
line: UInt,

Tests/GraphQLTests/SubscriptionTests/SubscriptionTests.swift

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ class SubscriptionTests: XCTestCase {
2828
}
2929
"""
3030

31-
let subscriptionResult = try graphqlSubscribe(
31+
let subscriptionResult = try await graphqlSubscribe(
3232
schema: schema,
3333
request: query,
3434
eventLoopGroup: eventLoopGroup
35-
).wait()
35+
).get()
3636
guard let subscription = subscriptionResult.stream else {
3737
XCTFail(subscriptionResult.errors.description)
3838
return
@@ -653,7 +653,7 @@ class SubscriptionTests: XCTestCase {
653653
]]
654654
)
655655
)
656-
wait(for: [expectation], timeout: timeoutDuration)
656+
await fulfillment(of: [expectation], timeout: timeoutDuration)
657657
XCTAssertEqual(results, expected)
658658

659659
// Low priority email shouldn't trigger an event
@@ -666,7 +666,7 @@ class SubscriptionTests: XCTestCase {
666666
unread: true,
667667
priority: 2
668668
))
669-
wait(for: [expectation], timeout: timeoutDuration)
669+
await fulfillment(of: [expectation], timeout: timeoutDuration)
670670
XCTAssertEqual(results, expected)
671671

672672
// Higher priority one should trigger again
@@ -692,7 +692,7 @@ class SubscriptionTests: XCTestCase {
692692
]]
693693
)
694694
)
695-
wait(for: [expectation], timeout: timeoutDuration)
695+
await fulfillment(of: [expectation], timeout: timeoutDuration)
696696
XCTAssertEqual(results, expected)
697697

698698
// So that the Task won't immediately be cancelled since the ConcurrentEventStream is
@@ -754,7 +754,7 @@ class SubscriptionTests: XCTestCase {
754754
]]
755755
)
756756
)
757-
wait(for: [expectation], timeout: timeoutDuration)
757+
await fulfillment(of: [expectation], timeout: timeoutDuration)
758758
XCTAssertEqual(results, expected)
759759

760760
db.stop()
@@ -770,7 +770,7 @@ class SubscriptionTests: XCTestCase {
770770
))
771771

772772
// Ensure that the current result was the one before the db was stopped
773-
wait(for: [expectation], timeout: timeoutDuration)
773+
await fulfillment(of: [expectation], timeout: timeoutDuration)
774774
XCTAssertEqual(results, expected)
775775

776776
// So that the Task won't immediately be cancelled since the ConcurrentEventStream is
@@ -917,7 +917,7 @@ class SubscriptionTests: XCTestCase {
917917
]]
918918
)
919919
)
920-
wait(for: [expectation], timeout: timeoutDuration)
920+
await fulfillment(of: [expectation], timeout: timeoutDuration)
921921
XCTAssertEqual(results, expected)
922922

923923
expectation = XCTestExpectation()
@@ -936,7 +936,7 @@ class SubscriptionTests: XCTestCase {
936936
]
937937
)
938938
)
939-
wait(for: [expectation], timeout: timeoutDuration)
939+
await fulfillment(of: [expectation], timeout: timeoutDuration)
940940
XCTAssertEqual(results, expected)
941941

942942
expectation = XCTestExpectation()
@@ -957,7 +957,7 @@ class SubscriptionTests: XCTestCase {
957957
]]
958958
)
959959
)
960-
wait(for: [expectation], timeout: timeoutDuration)
960+
await fulfillment(of: [expectation], timeout: timeoutDuration)
961961
XCTAssertEqual(results, expected)
962962

963963
// So that the Task won't immediately be cancelled since the ConcurrentEventStream is

0 commit comments

Comments
 (0)