From 9ba6b9c5c62f54b73ca2b99119b73af48fcf997e Mon Sep 17 00:00:00 2001 From: "Stuebinger, Bernd" Date: Tue, 15 Oct 2024 17:55:20 +0200 Subject: [PATCH] Support repeatable directives --- .../com/apurebase/kgraphql/schema/directive/Directive.kt | 9 ++++++--- .../kgraphql/schema/introspection/__Directive.kt | 2 ++ .../com/apurebase/kgraphql/integration/BaseSchemaTest.kt | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/directive/Directive.kt b/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/directive/Directive.kt index 539b439f..dd6e3613 100644 --- a/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/directive/Directive.kt +++ b/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/directive/Directive.kt @@ -16,7 +16,8 @@ data class Directive( override val locations: List, val execution: DirectiveExecution, override val description: String?, - val arguments: List> + val arguments: List>, + override val isRepeatable: Boolean? ) : __Directive { override val args: List<__InputValue> @@ -26,14 +27,16 @@ data class Directive( val name: String, val locations: List, val execution: DirectiveExecution, - val description: String? = null + val description: String? = null, + val isRepeatable: Boolean? = null ) { fun toDirective(inputValues: List>) = Directive( name = this.name, locations = this.locations, execution = this.execution, description = this.description, - arguments = inputValues + arguments = inputValues, + isRepeatable = isRepeatable ) } diff --git a/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/introspection/__Directive.kt b/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/introspection/__Directive.kt index e4ba0d17..18eba135 100644 --- a/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/introspection/__Directive.kt +++ b/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/introspection/__Directive.kt @@ -7,4 +7,6 @@ interface __Directive : __Described { val locations: List val args: List<__InputValue> + + val isRepeatable: Boolean? } \ No newline at end of file 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 da7e9b66..5c40ae88 100644 --- a/kgraphql/src/test/kotlin/com/apurebase/kgraphql/integration/BaseSchemaTest.kt +++ b/kgraphql/src/test/kotlin/com/apurebase/kgraphql/integration/BaseSchemaTest.kt @@ -38,6 +38,7 @@ abstract class BaseSchemaTest { args(includeDeprecated: true) { ...InputValue } + isRepeatable } } }