@@ -122,7 +122,7 @@ class SchemaParser internal constructor(
122
122
val builder = GraphQLObjectType .newObject()
123
123
.name(name)
124
124
.definition(objectDefinition)
125
- .description(if (objectDefinition.description != null ) objectDefinition.description.content else getDocumentation(objectDefinition))
125
+ .description(getDocumentation(objectDefinition, options ))
126
126
127
127
builder.withDirectives(* buildDirectives(objectDefinition.directives, Introspection .DirectiveLocation .OBJECT ))
128
128
@@ -133,7 +133,6 @@ class SchemaParser internal constructor(
133
133
}
134
134
135
135
objectDefinition.getExtendedFieldDefinitions(extensionDefinitions).forEach { fieldDefinition ->
136
- fieldDefinition.description
137
136
builder.field { field ->
138
137
createField(field, fieldDefinition, inputObjects)
139
138
codeRegistryBuilder.dataFetcher(
@@ -162,7 +161,7 @@ class SchemaParser internal constructor(
162
161
.name(definition.name)
163
162
.definition(definition)
164
163
.extensionDefinitions(extensionDefinitions)
165
- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
164
+ .description(getDocumentation(definition, options ))
166
165
167
166
builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .INPUT_OBJECT ))
168
167
@@ -171,7 +170,7 @@ class SchemaParser internal constructor(
171
170
val fieldBuilder = GraphQLInputObjectField .newInputObjectField()
172
171
.name(inputDefinition.name)
173
172
.definition(inputDefinition)
174
- .description(if (inputDefinition.description != null ) inputDefinition.description.content else getDocumentation(inputDefinition))
173
+ .description(getDocumentation(inputDefinition, options ))
175
174
.defaultValue(buildDefaultValue(inputDefinition.defaultValue))
176
175
.type(determineInputType(inputDefinition.type, inputObjects))
177
176
.withDirectives(* buildDirectives(inputDefinition.directives, Introspection .DirectiveLocation .INPUT_FIELD_DEFINITION ))
@@ -191,7 +190,7 @@ class SchemaParser internal constructor(
191
190
val builder = GraphQLEnumType .newEnum()
192
191
.name(name)
193
192
.definition(definition)
194
- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
193
+ .description(getDocumentation(definition, options ))
195
194
196
195
builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .ENUM ))
197
196
@@ -204,7 +203,7 @@ class SchemaParser internal constructor(
204
203
getDeprecated(enumDefinition.directives).let {
205
204
val enumValueDefinition = GraphQLEnumValueDefinition .newEnumValueDefinition()
206
205
.name(enumName)
207
- .description(if (enumDefinition.description != null ) enumDefinition.description.content else getDocumentation(enumDefinition))
206
+ .description(getDocumentation(enumDefinition, options ))
208
207
.value(enumValue)
209
208
.deprecationReason(it)
210
209
.withDirectives(* enumValueDirectives)
@@ -223,7 +222,7 @@ class SchemaParser internal constructor(
223
222
val builder = GraphQLInterfaceType .newInterface()
224
223
.name(name)
225
224
.definition(interfaceDefinition)
226
- .description(if (interfaceDefinition.description != null ) interfaceDefinition.description.content else getDocumentation(interfaceDefinition))
225
+ .description(getDocumentation(interfaceDefinition, options ))
227
226
228
227
builder.withDirectives(* buildDirectives(interfaceDefinition.directives, Introspection .DirectiveLocation .INTERFACE ))
229
228
@@ -239,7 +238,7 @@ class SchemaParser internal constructor(
239
238
val builder = GraphQLUnionType .newUnionType()
240
239
.name(name)
241
240
.definition(definition)
242
- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
241
+ .description(getDocumentation(definition, options ))
243
242
244
243
builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .UNION ))
245
244
@@ -270,7 +269,7 @@ class SchemaParser internal constructor(
270
269
private fun createField (field : GraphQLFieldDefinition .Builder , fieldDefinition : FieldDefinition , inputObjects : List <GraphQLInputObjectType >): GraphQLFieldDefinition .Builder {
271
270
field
272
271
.name(fieldDefinition.name)
273
- .description(fieldDefinition.description?.content ? : getDocumentation(fieldDefinition))
272
+ .description(getDocumentation(fieldDefinition, options ))
274
273
.definition(fieldDefinition)
275
274
.apply { getDeprecated(fieldDefinition.directives)?.let { deprecate(it) } }
276
275
.type(determineOutputType(fieldDefinition.type, inputObjects))
@@ -279,7 +278,7 @@ class SchemaParser internal constructor(
279
278
val argumentBuilder = GraphQLArgument .newArgument()
280
279
.name(argumentDefinition.name)
281
280
.definition(argumentDefinition)
282
- .description(if (argumentDefinition.description != null ) argumentDefinition.description.content else getDocumentation(argumentDefinition))
281
+ .description(getDocumentation(argumentDefinition, options ))
283
282
.type(determineInputType(argumentDefinition.type, inputObjects))
284
283
.apply { buildDefaultValue(argumentDefinition.defaultValue)?.let { defaultValue(it) } }
285
284
.withDirectives(* buildDirectives(argumentDefinition.directives, Introspection .DirectiveLocation .ARGUMENT_DEFINITION ))
0 commit comments