Skip to content

Commit 210fb72

Browse files
chore: Fixes deprecation warnings
1 parent 4424f8e commit 210fb72

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

Sources/GraphQL/Subscription/Subscribe.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func subscribe(
3939
guard let eventPayload = try await iterator.next() else {
4040
return nil
4141
}
42-
// Despite the warning, we must force unwrap because on optional unwrap, compiler throws:
42+
// Despite the warning, we must force unwrap because on optional unwrap, compiler
43+
// throws:
4344
// `marker protocol 'Sendable' cannot be used in a conditional cast`
4445
let rootValue = eventPayload as! (any Sendable)
4546
return try await execute(

Tests/GraphQLTests/LanguageTests/ParserTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class ParserTests: XCTestCase {
282282
func testKitchenSink() throws {
283283
guard
284284
let url = Bundle.module.url(forResource: "kitchen-sink", withExtension: "graphql"),
285-
let kitchenSink = try? String(contentsOf: url)
285+
let kitchenSink = try? String(contentsOf: url, encoding: .utf8)
286286
else {
287287
XCTFail("Could not load kitchen sink")
288288
return

Tests/GraphQLTests/LanguageTests/PrinterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class PrinterTests: XCTestCase {
164164
func testPrintsKitchenSinkWithoutAlteringAST() throws {
165165
guard
166166
let url = Bundle.module.url(forResource: "kitchen-sink", withExtension: "graphql"),
167-
let kitchenSink = try? String(contentsOf: url)
167+
let kitchenSink = try? String(contentsOf: url, encoding: .utf8)
168168
else {
169169
XCTFail("Could not load kitchen sink")
170170
return

Tests/GraphQLTests/LanguageTests/SchemaParserTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ class SchemaParserTests: XCTestCase {
13791379
forResource: "schema-kitchen-sink",
13801380
withExtension: "graphql"
13811381
),
1382-
let kitchenSink = try? String(contentsOf: url)
1382+
let kitchenSink = try? String(contentsOf: url, encoding: .utf8)
13831383
else {
13841384
XCTFail("Could not load kitchen sink")
13851385
return

Tests/GraphQLTests/LanguageTests/SchemaPrinterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SchemaPrinterTests: XCTestCase {
1515
forResource: "schema-kitchen-sink",
1616
withExtension: "graphql"
1717
),
18-
let kitchenSink = try? String(contentsOf: url)
18+
let kitchenSink = try? String(contentsOf: url, encoding: .utf8)
1919
else {
2020
XCTFail("Could not load kitchen sink")
2121
return

Tests/GraphQLTests/LanguageTests/VisitorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ class VisitorTests: XCTestCase {
504504

505505
guard
506506
let url = Bundle.module.url(forResource: "kitchen-sink", withExtension: "graphql"),
507-
let kitchenSink = try? String(contentsOf: url)
507+
let kitchenSink = try? String(contentsOf: url, encoding: .utf8)
508508
else {
509509
XCTFail("Could not load kitchen sink")
510510
return

0 commit comments

Comments
 (0)