diff --git a/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/model/MutableSchemaDefinition.kt b/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/model/MutableSchemaDefinition.kt index 379ad633..13fb8ed0 100644 --- a/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/model/MutableSchemaDefinition.kt +++ b/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/model/MutableSchemaDefinition.kt @@ -227,6 +227,13 @@ private fun create__DirectiveDefinition() = TypeDSL( } deprecate("Use `locations`.") } + transformation(__Directive::args) { args: List<__InputValue>, includeDeprecated: Boolean? -> + if (includeDeprecated == true) { + args + } else { + args.filterNot { it.isDeprecated } + } + } }.toKQLObject() private fun List.containsAny(vararg elements: T) = elements.any { this.contains(it) } diff --git a/kgraphql/src/test/kotlin/com/apurebase/kgraphql/integration/BaseSchemaTest.kt b/kgraphql/src/test/kotlin/com/apurebase/kgraphql/integration/BaseSchemaTest.kt index 856eaeb5..da7e9b66 100644 --- a/kgraphql/src/test/kotlin/com/apurebase/kgraphql/integration/BaseSchemaTest.kt +++ b/kgraphql/src/test/kotlin/com/apurebase/kgraphql/integration/BaseSchemaTest.kt @@ -35,7 +35,7 @@ abstract class BaseSchemaTest { name description locations - args { + args(includeDeprecated: true) { ...InputValue } }