Skip to content

Commit 4351e1e

Browse files
feat: Removes build ordering
1 parent 0ba4aaa commit 4351e1e

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

Sources/Graphiti/Component/Component.swift

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,4 @@ enum ComponentType {
3636
case type
3737
case types
3838
case union
39-
40-
/// An index used to sort components into the correct schema build order. This order goes
41-
/// from "least other type references" to "most". By building in this order we are able to satisfy
42-
/// hard ordering requirements (interfaces MUST be built before inheriting types), as well as
43-
/// reduce unnecessary TypeReferences.
44-
var buildOrder: Int {
45-
switch self {
46-
case .none: return 0
47-
case .scalar: return 1
48-
case .enum: return 2
49-
case .interface: return 3
50-
case .input: return 4
51-
case .connection: return 5
52-
case .type: return 6
53-
case .types: return 7
54-
case .union: return 8
55-
case .query: return 9
56-
case .mutation: return 10
57-
case .subscription: return 11
58-
}
59-
}
6039
}

Sources/Graphiti/Schema/Schema.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,8 @@ public final class Schema<Resolver, Context> {
1212
let typeProvider = SchemaTypeProvider()
1313
typeProvider.federatedSDL = federatedSDL
1414

15-
// Collect types mappings first
1615
for component in components {
1716
try component.setGraphQLName(typeProvider: typeProvider)
18-
}
19-
20-
// Order component by componentType build order
21-
let sortedComponents = components.sorted {
22-
$0.componentType.buildOrder <= $1.componentType.buildOrder
23-
}
24-
for component in sortedComponents {
2517
try component.update(typeProvider: typeProvider, coders: coders)
2618
}
2719

0 commit comments

Comments
 (0)