Skip to content

Commit 0f3cc00

Browse files
committed
[federation] fix @key fed v2 definition
Missed default value for the `resolvable` argument. Updated definition ```kotlin directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE ```
1 parent 186c46f commit 0f3cc00

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/directives/KeyDirective.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ internal val KEY_DIRECTIVE_TYPE_V2: graphql.schema.GraphQLDirective = graphql.sc
116116
GraphQLArgument.newArgument()
117117
.name("resolvable")
118118
.type(Scalars.GraphQLBoolean)
119+
.defaultValueProgrammatic(true)
119120
)
120121
.repeatable(true)
121122
.build()

generator/graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/generator/federation/FederatedSchemaV2GeneratorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private val FEDERATED_SDL_V2 =
5555
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
5656
5757
"Space separated list of primary keys needed to access federated object"
58-
directive @key(fields: _FieldSet!, resolvable: Boolean) repeatable on OBJECT | INTERFACE
58+
directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
5959
6060
"Links definitions within the document to external schemas."
6161
directive @link(import: [String], url: String) repeatable on SCHEMA

0 commit comments

Comments
 (0)