@@ -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(
@@ -163,7 +162,7 @@ class SchemaParser internal constructor(
163
162
.name(definition.name)
164
163
.definition(definition)
165
164
.extensionDefinitions(extensionDefinitions)
166
- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
165
+ .description(getDocumentation(definition, options ))
167
166
168
167
builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .INPUT_OBJECT ))
169
168
@@ -174,7 +173,7 @@ class SchemaParser internal constructor(
174
173
val fieldBuilder = GraphQLInputObjectField .newInputObjectField()
175
174
.name(inputDefinition.name)
176
175
.definition(inputDefinition)
177
- .description(if (inputDefinition.description != null ) inputDefinition.description.content else getDocumentation(inputDefinition))
176
+ .description(getDocumentation(inputDefinition, options ))
178
177
.defaultValue(buildDefaultValue(inputDefinition.defaultValue))
179
178
.type(determineInputType(inputDefinition.type, inputObjects, referencingInputObjects))
180
179
.withDirectives(* buildDirectives(inputDefinition.directives, Introspection .DirectiveLocation .INPUT_FIELD_DEFINITION ))
@@ -194,7 +193,7 @@ class SchemaParser internal constructor(
194
193
val builder = GraphQLEnumType .newEnum()
195
194
.name(name)
196
195
.definition(definition)
197
- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
196
+ .description(getDocumentation(definition, options ))
198
197
199
198
builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .ENUM ))
200
199
@@ -207,7 +206,7 @@ class SchemaParser internal constructor(
207
206
getDeprecated(enumDefinition.directives).let {
208
207
val enumValueDefinition = GraphQLEnumValueDefinition .newEnumValueDefinition()
209
208
.name(enumName)
210
- .description(if (enumDefinition.description != null ) enumDefinition.description.content else getDocumentation(enumDefinition))
209
+ .description(getDocumentation(enumDefinition, options ))
211
210
.value(enumValue)
212
211
.deprecationReason(it)
213
212
.withDirectives(* enumValueDirectives)
@@ -226,7 +225,7 @@ class SchemaParser internal constructor(
226
225
val builder = GraphQLInterfaceType .newInterface()
227
226
.name(name)
228
227
.definition(interfaceDefinition)
229
- .description(if (interfaceDefinition.description != null ) interfaceDefinition.description.content else getDocumentation(interfaceDefinition))
228
+ .description(getDocumentation(interfaceDefinition, options ))
230
229
231
230
builder.withDirectives(* buildDirectives(interfaceDefinition.directives, Introspection .DirectiveLocation .INTERFACE ))
232
231
@@ -247,7 +246,7 @@ class SchemaParser internal constructor(
247
246
val builder = GraphQLUnionType .newUnionType()
248
247
.name(name)
249
248
.definition(definition)
250
- .description(if (definition.description != null ) definition.description.content else getDocumentation(definition))
249
+ .description(getDocumentation(definition, options ))
251
250
252
251
builder.withDirectives(* buildDirectives(definition.directives, Introspection .DirectiveLocation .UNION ))
253
252
@@ -278,7 +277,7 @@ class SchemaParser internal constructor(
278
277
private fun createField (field : GraphQLFieldDefinition .Builder , fieldDefinition : FieldDefinition , inputObjects : List <GraphQLInputObjectType >): GraphQLFieldDefinition .Builder {
279
278
field
280
279
.name(fieldDefinition.name)
281
- .description(fieldDefinition.description?.content ? : getDocumentation(fieldDefinition))
280
+ .description(getDocumentation(fieldDefinition, options ))
282
281
.definition(fieldDefinition)
283
282
.apply { getDeprecated(fieldDefinition.directives)?.let { deprecate(it) } }
284
283
.type(determineOutputType(fieldDefinition.type, inputObjects))
@@ -287,7 +286,7 @@ class SchemaParser internal constructor(
287
286
val argumentBuilder = GraphQLArgument .newArgument()
288
287
.name(argumentDefinition.name)
289
288
.definition(argumentDefinition)
290
- .description(if (argumentDefinition.description != null ) argumentDefinition.description.content else getDocumentation(argumentDefinition))
289
+ .description(getDocumentation(argumentDefinition, options ))
291
290
.type(determineInputType(argumentDefinition.type, inputObjects, setOf ()))
292
291
.apply { buildDefaultValue(argumentDefinition.defaultValue)?.let { defaultValue(it) } }
293
292
.withDirectives(* buildDirectives(argumentDefinition.directives, Introspection .DirectiveLocation .ARGUMENT_DEFINITION ))
0 commit comments