File tree 1 file changed +3
-5
lines changed
graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,12 @@ open class SchemaGenerator(internal val config: SchemaGeneratorConfig) {
90
90
* This function is recursive because while generating the additionalTypes it is possible to create additional types that need to be processed.
91
91
*/
92
92
protected open fun generateAdditionalTypes (): Set <GraphQLType > {
93
- val currentlyProcessedTypes = mutableSetOf<KType >()
94
93
val graphqlTypes = mutableSetOf<GraphQLType >()
95
- do {
96
- currentlyProcessedTypes.addAll (this .additionalTypes)
94
+ while ( this .additionalTypes.isNotEmpty()) {
95
+ val currentlyProcessedTypes = LinkedHashSet (this .additionalTypes)
97
96
this .additionalTypes.clear()
98
97
graphqlTypes.addAll(currentlyProcessedTypes.map { generateGraphQLType(this , it) })
99
- currentlyProcessedTypes.clear()
100
- } while (this .additionalTypes.isNotEmpty())
98
+ }
101
99
102
100
return graphqlTypes.toSet()
103
101
}
You can’t perform that action at this time.
0 commit comments