Skip to content

Commit 7fe554a

Browse files
fix: Removes public scope
1 parent b73ce0d commit 7fe554a

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

Sources/GraphQLGeneratorCore/Generator/SchemaGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package struct SchemaGenerator {
1515
import GraphQLGeneratorRuntime
1616
1717
/// Build a GraphQL schema with the provided resolvers
18-
public func buildGraphQLSchema<Resolvers: ResolversProtocol>(
18+
func buildGraphQLSchema<Resolvers: ResolversProtocol>(
1919
resolvers: Resolvers.Type,
2020
decoder: MapDecoder = .init()
2121
) throws -> GraphQLSchema {

Sources/GraphQLGeneratorCore/Generator/TypeGenerator.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package struct TypeGenerator {
1919
// Generate ResolversProtocol
2020
output += """
2121
22-
public protocol ResolversProtocol: Sendable {
22+
protocol ResolversProtocol: Sendable {
2323
"""
2424
if let queryType = schema.queryType {
2525
output += """
@@ -89,7 +89,7 @@ package struct TypeGenerator {
8989
let swiftTypeName = try swiftTypeDeclaration(for: type, nameGenerator: nameGenerator)
9090
output += """
9191
92-
public protocol \(swiftTypeName): Sendable {}
92+
protocol \(swiftTypeName): Sendable {}
9393
"""
9494

9595
// Record which types need to be conformed
@@ -170,7 +170,7 @@ package struct TypeGenerator {
170170
let swiftTypeName = try swiftTypeDeclaration(for: type, nameGenerator: nameGenerator)
171171
output += """
172172
173-
public enum \(swiftTypeName): String, Codable, Sendable {
173+
enum \(swiftTypeName): String, Codable, Sendable {
174174
"""
175175

176176
// Generate cases
@@ -209,7 +209,7 @@ package struct TypeGenerator {
209209
}
210210

211211
let swiftTypeName = try swiftTypeDeclaration(for: type, nameGenerator: nameGenerator)
212-
output += "public struct \(swiftTypeName): Codable, Sendable {\n"
212+
output += "struct \(swiftTypeName): Codable, Sendable {\n"
213213

214214
// Generate properties
215215
let fields = try type.fields()
@@ -225,7 +225,7 @@ package struct TypeGenerator {
225225

226226
output += """
227227
228-
public let \(nameGenerator.swiftMemberName(for: fieldName)): \(returnType)
228+
let \(nameGenerator.swiftMemberName(for: fieldName)): \(returnType)
229229
"""
230230
}
231231

@@ -256,7 +256,7 @@ package struct TypeGenerator {
256256
let swiftTypeName = try swiftTypeDeclaration(for: type, nameGenerator: nameGenerator)
257257
output += """
258258
259-
public protocol \(swiftTypeName): \(interfaces)Sendable {
259+
protocol \(swiftTypeName): \(interfaces)Sendable {
260260
"""
261261

262262
// Generate properties
@@ -324,7 +324,7 @@ package struct TypeGenerator {
324324
let swiftTypeName = try swiftTypeDeclaration(for: type, nameGenerator: nameGenerator)
325325
output += """
326326
327-
public protocol \(swiftTypeName): \(unions)\(interfaces)Sendable {
327+
protocol \(swiftTypeName): \(unions)\(interfaces)Sendable {
328328
"""
329329

330330
// Generate properties
@@ -386,7 +386,7 @@ package struct TypeGenerator {
386386
let swiftTypeName = try swiftTypeDeclaration(for: type, nameGenerator: nameGenerator)
387387
output += """
388388
389-
public protocol \(swiftTypeName): Sendable {
389+
protocol \(swiftTypeName): Sendable {
390390
"""
391391

392392
// Generate properties

Tests/GraphQLGeneratorCoreTests/SchemaGeneratorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct SchemaGeneratorTests {
4545
import GraphQLGeneratorRuntime
4646
4747
/// Build a GraphQL schema with the provided resolvers
48-
public func buildGraphQLSchema<Resolvers: ResolversProtocol>(
48+
func buildGraphQLSchema<Resolvers: ResolversProtocol>(
4949
resolvers: Resolvers.Type,
5050
decoder: MapDecoder = .init()
5151
) throws -> GraphQLSchema {

Tests/GraphQLGeneratorCoreTests/TypeGeneratorTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct TypeGeneratorTests {
2525
actual == """
2626
2727
/// foo
28-
public enum Foo: String, Codable, Sendable {
28+
enum Foo: String, Codable, Sendable {
2929
/// foo
3030
case foo = "foo"
3131
/// bar
@@ -62,7 +62,7 @@ struct TypeGeneratorTests {
6262
actual == """
6363
6464
/// B
65-
public protocol BInterface: AInterface, Sendable {
65+
protocol BInterface: AInterface, Sendable {
6666
/// foo
6767
func foo(context: Context, info: GraphQLResolveInfo) async throws -> String
6868
@@ -115,7 +115,7 @@ struct TypeGeneratorTests {
115115
actual == """
116116
117117
/// Foo
118-
public protocol FooProtocol: XUnion, AInterface, Sendable {
118+
protocol FooProtocol: XUnion, AInterface, Sendable {
119119
/// foo
120120
func foo(context: Context, info: GraphQLResolveInfo) async throws -> String
121121
@@ -155,7 +155,7 @@ struct TypeGeneratorTests {
155155
#expect(
156156
actual == """
157157
158-
public protocol QueryProtocol: Sendable {
158+
protocol QueryProtocol: Sendable {
159159
/// foo
160160
static func foo(context: Context, info: GraphQLResolveInfo) async throws -> String?
161161
@@ -186,7 +186,7 @@ struct TypeGeneratorTests {
186186
#expect(
187187
actual == """
188188
189-
public protocol SubscriptionProtocol: Sendable {
189+
protocol SubscriptionProtocol: Sendable {
190190
/// foo
191191
static func watchThis(id: String?, context: Context, info: GraphQLResolveInfo) async throws -> AnyAsyncSequence<String?>
192192

0 commit comments

Comments
 (0)