Skip to content

Commit ea37578

Browse files
fix: Improves file naming
Swift disallows duplicate file names (even in plugins), so these should be less commonly matched than the previous file names.
1 parent 084f18e commit ea37578

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

Plugins/GraphQLGeneratorPlugin.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ struct GraphQLGeneratorPlugin: BuildToolPlugin {
2727
let schemaInputs = schemaFiles.map(\.url)
2828

2929
let outputFiles = [
30-
outputDirectory.appendingPathComponent("Types.swift"),
31-
outputDirectory.appendingPathComponent("Schema.swift"),
32-
outputDirectory.appendingPathComponent("SDL.swift"),
30+
outputDirectory.appendingPathComponent("BuildGraphQLSchema.swift"),
31+
outputDirectory.appendingPathComponent("GraphQLRawSDL.swift"),
32+
outputDirectory.appendingPathComponent("GraphQLTypes.swift"),
3333
]
3434

3535
let arguments = schemaInputs.flatMap { ["\($0.path)"] } + [

Sources/GraphQLGeneratorCore/Generator/CodeGenerator.swift

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,9 @@ package struct CodeGenerator {
1111
let schema = try GraphQL.buildSchema(source: source)
1212

1313
var files: [String: String] = [:]
14-
15-
// Generate Types.swift
16-
let typeGenerator = TypeGenerator()
17-
files["Types.swift"] = try typeGenerator.generate(schema: schema)
18-
19-
// Generate Schema.swift
20-
let schemaGenerator = SchemaGenerator()
21-
files["Schema.swift"] = try schemaGenerator.generate(schema: schema)
22-
23-
// Generate SDL.swift
24-
let sdlGenerator = SDLGenerator()
25-
files["SDL.swift"] = try sdlGenerator.generate(source: source)
14+
files["BuildGraphQLSchema.swift"] = try SchemaGenerator().generate(schema: schema)
15+
files["GraphQLRawSDL.swift"] = try SDLGenerator().generate(source: source)
16+
files["GraphQLTypes.swift"] = try TypeGenerator().generate(schema: schema)
2617

2718
return files
2819
}

0 commit comments

Comments
 (0)