@@ -3,6 +3,7 @@ package graphql.kickstart.tools
33import graphql.Scalars
44import graphql.introspection.Introspection
55import graphql.kickstart.tools.directive.SchemaGeneratorDirectiveHelper
6+ import graphql.kickstart.tools.util.getDocumentation
67import graphql.kickstart.tools.util.getExtendedFieldDefinitions
78import graphql.kickstart.tools.util.unwrap
89import graphql.language.*
@@ -24,17 +25,11 @@ class SchemaParser internal constructor(
2425 private val options : SchemaParserOptions ,
2526 private val runtimeWiring : RuntimeWiring
2627) {
27- companion object {
28- val log = LoggerFactory .getLogger(SchemaClassScanner ::class .java)!!
29- const val DEFAULT_DEPRECATION_MESSAGE = " No longer supported"
28+ private val log = LoggerFactory .getLogger(javaClass)
3029
30+ companion object {
3131 @JvmStatic
3232 fun newParser () = SchemaParserBuilder ()
33-
34- internal fun getDocumentation (node : AbstractNode <* >): String? = node.comments?.asSequence()
35- ?.filter { ! it.content.startsWith(" #" ) }
36- ?.joinToString(" \n " ) { it.content.trimEnd() }
37- ?.trimIndent()
3833 }
3934
4035 private val dictionary = scanResult.dictionary
@@ -389,7 +384,7 @@ class SchemaParser internal constructor(
389384 }
390385 is TypeName -> {
391386 val scalarType = customScalars[typeDefinition.name]
392- ? : graphQLScalars [typeDefinition.name]
387+ ? : GRAPHQL_SCALARS [typeDefinition.name]
393388 if (scalarType != null ) {
394389 scalarType
395390 } else {
@@ -416,7 +411,7 @@ class SchemaParser internal constructor(
416411 }
417412 is TypeName -> {
418413 val scalarType = customScalars[typeDefinition.name]
419- ? : graphQLScalars [typeDefinition.name]
414+ ? : GRAPHQL_SCALARS [typeDefinition.name]
420415 if (scalarType != null ) {
421416 scalarType
422417 } else {
@@ -463,4 +458,6 @@ class SchemaParser internal constructor(
463458
464459class SchemaError (message : String , cause : Throwable ? = null ) : RuntimeException(message, cause)
465460
466- val graphQLScalars = ScalarInfo .GRAPHQL_SPECIFICATION_SCALARS .associateBy { it.name }
461+ val GRAPHQL_SCALARS = ScalarInfo .GRAPHQL_SPECIFICATION_SCALARS .associateBy { it.name }
462+
463+ const val DEFAULT_DEPRECATION_MESSAGE = " No longer supported"
0 commit comments