Skip to content

Commit 261e39a

Browse files
authored
Merge pull request #696 from ajkerr/support-deprecated-directive-on-arguments-and-input-fields
Support @deprecated on arguments and input fields
2 parents 6a2a523 + 04544ec commit 261e39a

File tree

2 files changed

+390
-0
lines changed

2 files changed

+390
-0
lines changed

src/main/kotlin/graphql/kickstart/tools/SchemaParser.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class SchemaParser internal constructor(
168168
.definition(inputDefinition)
169169
.description(getDocumentation(inputDefinition, options))
170170
.apply { inputDefinition.defaultValue?.let { v -> defaultValueLiteral(v) } }
171+
.apply { getDeprecated(inputDefinition.directives)?.let { deprecate(it) } }
171172
.type(determineInputType(inputDefinition.type, inputObjects, referencingInputObjects))
172173
.withAppliedDirectives(*buildAppliedDirectives(inputDefinition.directives))
173174
builder.field(fieldBuilder.build())
@@ -279,6 +280,7 @@ class SchemaParser internal constructor(
279280
.definition(argumentDefinition)
280281
.description(getDocumentation(argumentDefinition, options))
281282
.type(determineInputType(argumentDefinition.type, inputObjects, setOf()))
283+
.apply { getDeprecated(argumentDefinition.directives)?.let { deprecate(it) } }
282284
.apply { argumentDefinition.defaultValue?.let { defaultValueLiteral(it) } }
283285
.withAppliedDirectives(*buildAppliedDirectives(argumentDefinition.directives))
284286

@@ -305,6 +307,7 @@ class SchemaParser internal constructor(
305307
.definition(arg)
306308
.description(getDocumentation(arg, options))
307309
.type(determineInputType(arg.type, inputObjects, setOf()))
310+
.apply { getDeprecated(arg.directives)?.let { deprecate(it) } }
308311
.apply { arg.defaultValue?.let { defaultValueLiteral(it) } }
309312
.withAppliedDirectives(*buildAppliedDirectives(arg.directives))
310313
.build())

0 commit comments

Comments
 (0)