Skip to content

Commit 0d90d04

Browse files
chore: swiftformat updates
1 parent e1c66d9 commit 0d90d04

File tree

7 files changed

+32
-15
lines changed

7 files changed

+32
-15
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

4040
return sourceResult.map { sourceStream in
4141
AsyncThrowingStream<GraphQLResult, Error> {
42-
// The type-cast below is required on Swift <6. Once we drop Swift 5 support it may be removed.
42+
// The type-cast below is required on Swift <6. Once we drop Swift 5 support it may be
43+
// removed.
4344
var iterator = sourceStream.makeAsyncIterator() as (any AsyncIteratorProtocol)
4445
guard let eventPayload = try await iterator.next() else {
4546
return nil

Sources/GraphQL/Type/Introspection.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ let __Directive = try! GraphQLObjectType(
8383
"name": GraphQLField(type: GraphQLNonNull(GraphQLString)),
8484
"description": GraphQLField(type: GraphQLString),
8585
"isRepeatable": GraphQLField(type: GraphQLNonNull(GraphQLBoolean)),
86-
"locations": GraphQLField(type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__DirectiveLocation)))),
86+
"locations": GraphQLField(
87+
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__DirectiveLocation)))
88+
),
8789
"args": GraphQLField(
8890
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))),
8991
args: [

Tests/GraphQLTests/SubscriptionTests/SubscriptionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class SubscriptionTests: XCTestCase {
194194
]
195195
)
196196
)
197-
let _ = try await createSubscription(schema: schema, query: """
197+
_ = try await createSubscription(schema: schema, query: """
198198
subscription {
199199
importantEmail {
200200
email {

Tests/GraphQLTests/UtilitiesTests/BuildASTSchemaTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,12 +988,12 @@ class BuildASTSchemaTests: XCTestCase {
988988
let query = try XCTUnwrap(schema.getType(name: "Query") as? GraphQLObjectType)
989989
let testInput = try XCTUnwrap(schema.getType(name: "TestInput") as? GraphQLInputObjectType)
990990
let testEnum = try XCTUnwrap(schema.getType(name: "TestEnum") as? GraphQLEnumType)
991-
let _ = try XCTUnwrap(schema.getType(name: "TestUnion") as? GraphQLUnionType)
991+
XCTAssertNotNil(schema.getType(name: "TestUnion") as? GraphQLUnionType)
992992
let testInterface = try XCTUnwrap(
993993
schema.getType(name: "TestInterface") as? GraphQLInterfaceType
994994
)
995995
let testType = try XCTUnwrap(schema.getType(name: "TestType") as? GraphQLObjectType)
996-
let _ = try XCTUnwrap(schema.getType(name: "TestScalar") as? GraphQLScalarType)
996+
XCTAssertNotNil(schema.getType(name: "TestScalar") as? GraphQLScalarType)
997997
let testDirective = try XCTUnwrap(schema.getDirective(name: "test"))
998998

999999
// No `Equatable` conformance

Tests/GraphQLTests/UtilitiesTests/PrintSchemaTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,9 @@ class TypeSystemPrinterTests: XCTestCase {
970970
name: "Virus",
971971
fields: [
972972
"name": GraphQLField(type: GraphQLNonNull(GraphQLString)),
973-
"knownMutations": GraphQLField(type: GraphQLNonNull(GraphQLList(GraphQLNonNull(Mutation)))),
973+
"knownMutations": GraphQLField(
974+
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(Mutation)))
975+
),
974976
]
975977
)
976978

Tests/GraphQLTests/ValidationTests/ExampleSchema.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ let ValidationExampleIntelligent = try! GraphQLInterfaceType(
288288
let ValidationExampleSentient = try! GraphQLInterfaceType(
289289
name: "Sentient",
290290
fields: [
291-
"name": GraphQLField(type: GraphQLNonNull(GraphQLString)) { inputValue, _, _, _ -> String? in
291+
"name": GraphQLField(
292+
type: GraphQLNonNull(GraphQLString)
293+
) { inputValue, _, _, _ -> String? in
292294
print(type(of: inputValue))
293295
return nil
294296
},
@@ -305,7 +307,9 @@ let ValidationExampleSentient = try! GraphQLInterfaceType(
305307
let ValidationExampleAlien = try! GraphQLObjectType(
306308
name: "Alien",
307309
fields: [
308-
"name": GraphQLField(type: GraphQLNonNull(GraphQLString)) { inputValue, _, _, _ -> String? in
310+
"name": GraphQLField(
311+
type: GraphQLNonNull(GraphQLString)
312+
) { inputValue, _, _, _ -> String? in
309313
print(type(of: inputValue))
310314
return nil
311315
},
@@ -501,7 +505,9 @@ let ValidationExampleComplicatedArgs = try! GraphQLObjectType(
501505
"stringListNonNullArgField": GraphQLField(
502506
type: GraphQLString,
503507
args: [
504-
"stringListNonNullArg": GraphQLArgument(type: GraphQLList(GraphQLNonNull(GraphQLString))),
508+
"stringListNonNullArg": GraphQLArgument(
509+
type: GraphQLList(GraphQLNonNull(GraphQLString))
510+
),
505511
],
506512
resolve: { inputValue, _, _, _ -> String? in
507513
print(type(of: inputValue))

Tests/GraphQLTests/ValidationTests/NoDeprecatedCustomRuleTests.swift

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ class NoDeprecatedCustomRuleTests: ValidationTestCase {
132132
],
133133
args: [
134134
"normalArg": .init(type: GraphQLString),
135-
"deprecatedArg": .init(type: GraphQLString,
136-
deprecationReason: "Some arg reason."),
135+
"deprecatedArg": .init(
136+
type: GraphQLString,
137+
deprecationReason: "Some arg reason."
138+
),
137139
]
138140
),
139141
]
@@ -184,8 +186,10 @@ class NoDeprecatedCustomRuleTests: ValidationTestCase {
184186
let deprecatedInputFieldSchema: GraphQLSchema = {
185187
let inputType = try! GraphQLInputObjectType(name: "InputType", fields: [
186188
"normalField": .init(type: GraphQLString),
187-
"deprecatedField": .init(type: GraphQLString,
188-
deprecationReason: "Some input field reason."),
189+
"deprecatedField": .init(
190+
type: GraphQLString,
191+
deprecationReason: "Some input field reason."
192+
),
189193
])
190194
return try! GraphQLSchema(
191195
query: .init(name: "Query", fields: [
@@ -273,8 +277,10 @@ class NoDeprecatedCustomRuleTests: ValidationTestCase {
273277
let deprecatedEnumValueSchema: GraphQLSchema = {
274278
let enumType = try! GraphQLEnumType(name: "EnumType", values: [
275279
"NORMAL_VALUE": .init(value: .string("NORMAL_VALUE")),
276-
"DEPRECATED_VALUE": .init(value: .string("DEPRECATED_VALUE"),
277-
deprecationReason: "Some enum reason."),
280+
"DEPRECATED_VALUE": .init(
281+
value: .string("DEPRECATED_VALUE"),
282+
deprecationReason: "Some enum reason."
283+
),
278284
])
279285
return try! GraphQLSchema(
280286
query: .init(name: "Query", fields: [

0 commit comments

Comments
 (0)