Skip to content

Commit

Permalink
Support repeatable directives
Browse files Browse the repository at this point in the history
  • Loading branch information
stuebingerb committed Oct 17, 2024
1 parent bb403bf commit 9ba6b9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ data class Directive(
override val locations: List<DirectiveLocation>,
val execution: DirectiveExecution,
override val description: String?,
val arguments: List<InputValue<*>>
val arguments: List<InputValue<*>>,
override val isRepeatable: Boolean?
) : __Directive {

override val args: List<__InputValue>
Expand All @@ -26,14 +27,16 @@ data class Directive(
val name: String,
val locations: List<DirectiveLocation>,
val execution: DirectiveExecution,
val description: String? = null
val description: String? = null,
val isRepeatable: Boolean? = null
) {
fun toDirective(inputValues: List<InputValue<*>>) = Directive(
name = this.name,
locations = this.locations,
execution = this.execution,
description = this.description,
arguments = inputValues
arguments = inputValues,
isRepeatable = isRepeatable
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ interface __Directive : __Described {
val locations: List<DirectiveLocation>

val args: List<__InputValue>

val isRepeatable: Boolean?
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ abstract class BaseSchemaTest {
args(includeDeprecated: true) {
...InputValue
}
isRepeatable
}
}
}
Expand Down

0 comments on commit 9ba6b9c

Please sign in to comment.