Skip to content

Commit c60101b

Browse files
smyrickbrennantaylor
authored andcommitted
refactor: simplify the deep name logic (#165)
1 parent 20c8d20 commit c60101b

File tree

1 file changed

+2
-7
lines changed
  • src/main/kotlin/com/expedia/graphql/extensions

1 file changed

+2
-7
lines changed
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package com.expedia.graphql.extensions
22

3-
import graphql.schema.GraphQLList
4-
import graphql.schema.GraphQLNonNull
53
import graphql.schema.GraphQLType
4+
import graphql.schema.GraphQLTypeUtil
65

76
/**
87
* Useful public extension that renders a readable string from the given
@@ -12,8 +11,4 @@ import graphql.schema.GraphQLType
1211
* @return a string representation of the type taking list and non-null into account
1312
*/
1413
val GraphQLType.deepName: String
15-
get() = when {
16-
this is GraphQLNonNull -> "${wrappedType.deepName}!"
17-
this is GraphQLList -> "[${wrappedType.deepName}]"
18-
else -> name
19-
}
14+
get() = GraphQLTypeUtil.simplePrint(this)

0 commit comments

Comments
 (0)