@@ -122,7 +122,7 @@ class SchemaParser internal constructor(
122122 val builder = GraphQLObjectType .newObject()
123123 .name(name)
124124 .definition(objectDefinition)
125- .description(if (objectDefinition.description != null ) objectDefinition.description.content else getDocumentation(objectDefinition))
125+ .description(getDocumentation(objectDefinition, options ))
126126
127127 builder.withDirectives(* buildDirectives(objectDefinition.directives, Introspection .DirectiveLocation .OBJECT ))
128128
@@ -133,7 +133,6 @@ class SchemaParser internal constructor(
133133 }
134134
135135 objectDefinition.getExtendedFieldDefinitions(extensionDefinitions).forEach { fieldDefinition ->
136- fieldDefinition.description
137136 builder.field { field ->
138137 createField(field, fieldDefinition, inputObjects)
139138 codeRegistryBuilder.dataFetcher(
@@ -163,7 +162,7 @@ class SchemaParser internal constructor(
163162 .name(definition.name)
164163 .definition(definition)
165164 .extensionDefinitions(extensionDefinitions)
166- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
165+ .description(getDocumentation(definition, options ))
167166
168167 builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .INPUT_OBJECT ))
169168
@@ -174,7 +173,7 @@ class SchemaParser internal constructor(
174173 val fieldBuilder = GraphQLInputObjectField .newInputObjectField()
175174 .name(inputDefinition.name)
176175 .definition(inputDefinition)
177- .description(if (inputDefinition.description != null ) inputDefinition.description.content else getDocumentation(inputDefinition))
176+ .description(getDocumentation(inputDefinition, options ))
178177 .defaultValue(buildDefaultValue(inputDefinition.defaultValue))
179178 .type(determineInputType(inputDefinition.type, inputObjects, referencingInputObjects))
180179 .withDirectives(* buildDirectives(inputDefinition.directives, Introspection .DirectiveLocation .INPUT_FIELD_DEFINITION ))
@@ -194,7 +193,7 @@ class SchemaParser internal constructor(
194193 val builder = GraphQLEnumType .newEnum()
195194 .name(name)
196195 .definition(definition)
197- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
196+ .description(getDocumentation(definition, options ))
198197
199198 builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .ENUM ))
200199
@@ -207,7 +206,7 @@ class SchemaParser internal constructor(
207206 getDeprecated(enumDefinition.directives).let {
208207 val enumValueDefinition = GraphQLEnumValueDefinition .newEnumValueDefinition()
209208 .name(enumName)
210- .description(if (enumDefinition.description != null ) enumDefinition.description.content else getDocumentation(enumDefinition))
209+ .description(getDocumentation(enumDefinition, options ))
211210 .value(enumValue)
212211 .deprecationReason(it)
213212 .withDirectives(* enumValueDirectives)
@@ -226,7 +225,7 @@ class SchemaParser internal constructor(
226225 val builder = GraphQLInterfaceType .newInterface()
227226 .name(name)
228227 .definition(interfaceDefinition)
229- .description(if (interfaceDefinition.description != null ) interfaceDefinition.description.content else getDocumentation(interfaceDefinition))
228+ .description(getDocumentation(interfaceDefinition, options ))
230229
231230 builder.withDirectives(* buildDirectives(interfaceDefinition.directives, Introspection .DirectiveLocation .INTERFACE ))
232231
@@ -247,7 +246,7 @@ class SchemaParser internal constructor(
247246 val builder = GraphQLUnionType .newUnionType()
248247 .name(name)
249248 .definition(definition)
250- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
249+ .description(getDocumentation(definition, options ))
251250
252251 builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .UNION ))
253252
@@ -278,7 +277,7 @@ class SchemaParser internal constructor(
278277 private fun createField (field : GraphQLFieldDefinition .Builder , fieldDefinition : FieldDefinition , inputObjects : List <GraphQLInputObjectType >): GraphQLFieldDefinition .Builder {
279278 field
280279 .name(fieldDefinition.name)
281- .description(fieldDefinition.description?.content ? : getDocumentation(fieldDefinition))
280+ .description(getDocumentation(fieldDefinition, options ))
282281 .definition(fieldDefinition)
283282 .apply { getDeprecated(fieldDefinition.directives)?.let { deprecate(it) } }
284283 .type(determineOutputType(fieldDefinition.type, inputObjects))
@@ -287,7 +286,7 @@ class SchemaParser internal constructor(
287286 val argumentBuilder = GraphQLArgument .newArgument()
288287 .name(argumentDefinition.name)
289288 .definition(argumentDefinition)
290- .description(if (argumentDefinition.description != null ) argumentDefinition.description.content else getDocumentation(argumentDefinition))
289+ .description(getDocumentation(argumentDefinition, options ))
291290 .type(determineInputType(argumentDefinition.type, inputObjects, setOf ()))
292291 .apply { buildDefaultValue(argumentDefinition.defaultValue)?.let { defaultValue(it) } }
293292 .withDirectives(* buildDirectives(argumentDefinition.directives, Introspection .DirectiveLocation .ARGUMENT_DEFINITION ))
0 commit comments