Skip to content

Commit 452d1a6

Browse files
chore: Formatting
1 parent 020dce9 commit 452d1a6

8 files changed

Lines changed: 24 additions & 21 deletions

File tree

Sources/Graphiti/Federation/Queries.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ func serviceQuery(for sdl: String) -> GraphQLField {
55
type: GraphQLNonNull(serviceType),
66
description: "Return the SDL string for the subschema",
77
resolve: { _, _, _, _ in
8-
let result = Service(sdl: sdl)
9-
return result
8+
Service(sdl: sdl)
109
}
1110
)
1211
}

Sources/Graphiti/Field/Field/Field.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,5 @@ public extension Field where Arguments == NoArguments {
150150
}
151151
}
152152

153-
// We must conform KeyPath to unchecked sendable to allow keypath-based resolvers.
153+
/// We must conform KeyPath to unchecked sendable to allow keypath-based resolvers.
154154
extension KeyPath: @retroactive @unchecked Sendable {}

Sources/Graphiti/SchemaBuilders/PartialSchema.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,24 @@ open class PartialSchema<Resolver: Sendable, Context: Sendable> {
3232
}
3333

3434
/// Definitions of types
35-
open var types: Types { typedef }
35+
open var types: Types {
36+
typedef
37+
}
3638

3739
/// Definitions of query operation fields
38-
open var query: Fields { querydef }
40+
open var query: Fields {
41+
querydef
42+
}
3943

4044
/// Definitions of mutation operation fields
41-
open var mutation: Fields { mutationdef }
45+
open var mutation: Fields {
46+
mutationdef
47+
}
4248

4349
/// Definitions of subscription operation fields
44-
open var subscription: Fields { subscriptiondef }
50+
open var subscription: Fields {
51+
subscriptiondef
52+
}
4553
}
4654

4755
public extension Schema {

Tests/GraphitiTests/PartialSchemaTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct PartialSchemaTests {
130130
}
131131

132132
@Test func partialSchema() async throws {
133-
/// Double check if static func works and the types are inferred properly
133+
// Double check if static func works and the types are inferred properly
134134
let schema = try Schema.create(from: [BaseSchema(), SearchSchema()])
135135

136136
struct PartialSchemaTestAPI: API {
@@ -161,7 +161,7 @@ struct PartialSchemaTests {
161161
}
162162

163163
@Test func partialSchemaOutOfOrder() async throws {
164-
/// Double check if ordering of partial schema doesn't matter
164+
// Double check if ordering of partial schema doesn't matter
165165
let schema = try Schema.create(from: [SearchSchema(), BaseSchema()])
166166

167167
struct PartialSchemaTestAPI: API {
@@ -282,7 +282,7 @@ struct PartialSchemaTests {
282282
}
283283
)
284284

285-
/// Double check if ordering of partial schema doesn't matter
285+
// Double check if ordering of partial schema doesn't matter
286286
let schema = try Schema.create(from: [searchSchema, baseSchema])
287287

288288
struct PartialSchemaTestAPI: API {

Tests/GraphitiTests/ScalarTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,4 @@ struct StringCodedCoordinate: Codable {
721721
struct DictCodedCoordinate: Codable {
722722
let latitude: Double
723723
let longitude: Double
724-
725-
init(latitude: Double, longitude: Double) {
726-
self.latitude = latitude
727-
self.longitude = longitude
728-
}
729724
}

Tests/GraphitiTests/SchemaTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import GraphQL
44
import Testing
55

66
struct SchemaTests {
7-
// Tests that circularly dependent objects can be used in schema and resolved correctly
7+
/// Tests that circularly dependent objects can be used in schema and resolved correctly
88
@Test func circularDependencies() async throws {
99
struct A: Codable {
1010
let name: String
@@ -68,7 +68,7 @@ struct SchemaTests {
6868
)
6969
}
7070

71-
// Tests that we can resolve type references for named types
71+
/// Tests that we can resolve type references for named types
7272
@Test func typeReferenceForNamedType() async throws {
7373
struct LocationObject: Codable {
7474
let id: String

Tests/GraphitiTests/StarWarsTests/StarWarsIntrospectionTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
@testable import Graphiti
12
import GraphQL
23
import Testing
34

4-
@testable import Graphiti
5-
65
struct StarWarsIntrospectionTests {
76
private let api = StarWarsAPI()
87

Tests/GraphitiTests/ValidationRulesTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import GraphQL
44
import Testing
55

66
struct ValidationRulesTests {
7-
// Test registering custom validation rules
7+
/// Test registering custom validation rules
88
@Test func registeringCustomValidationRule() async throws {
99
struct TestResolver {
10-
var helloWorld: String { "Hellow World" }
10+
var helloWorld: String {
11+
"Hellow World"
12+
}
1113
}
1214

1315
let testSchema = try Schema<TestResolver, NoContext> {

0 commit comments

Comments
 (0)