Skip to content

Commit

Permalink
Support deprecation of input values (directive args)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuebingerb committed Oct 15, 2024
1 parent 9c5d320 commit 38963dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <T> List<T>.containsAny(vararg elements: T) = elements.any { this.contains(it) }
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class BaseSchemaTest {
name
description
locations
args {
args(includeDeprecated: true) {
...InputValue
}
}
Expand Down

0 comments on commit 38963dc

Please sign in to comment.