Skip to content

Commit f3b4622

Browse files
committed
adding test
1 parent 37f8450 commit f3b4622

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

commons/src/main/java/io/ballerina/stdlib/graphql/commons/utils/SdlSchemaStringGenerator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,12 @@ private String getTypes() {
184184
}
185185
}
186186

187-
// Sort types according to GraphQL best practices:
188-
// Query -> Mutation -> Subscription -> Interface -> Object -> Input -> Enum -> Union -> Scalar
189187
typeList.sort((t1, t2) -> {
190188
int priority1 = getTypeSortPriority(t1);
191189
int priority2 = getTypeSortPriority(t2);
192190
if (priority1 != priority2) {
193191
return Integer.compare(priority1, priority2);
194192
}
195-
// Within the same priority, sort alphabetically by name
196193
return t1.getName().compareTo(t2.getName());
197194
});
198195

@@ -204,7 +201,6 @@ private String getTypes() {
204201
}
205202

206203
private int getTypeSortPriority(Type type) {
207-
// Query, Mutation, and Subscription should come first (in that order)
208204
if (this.schema.getQueryType() != null && type.getName().equals(this.schema.getQueryType().getName())) {
209205
return 0;
210206
}
@@ -216,7 +212,6 @@ private int getTypeSortPriority(Type type) {
216212
return 2;
217213
}
218214

219-
// Then order by TypeKind
220215
switch (type.getKind()) {
221216
case INTERFACE:
222217
return 3;

0 commit comments

Comments
 (0)