Skip to content

Commit

Permalink
[federation] fix @key fed v2 definition (#1489)
Browse files Browse the repository at this point in the history
Missed default value for the `resolvable` argument. Updated definition

```kotlin
directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
```
  • Loading branch information
dariuszkuc committed Jul 27, 2022
1 parent 26ec987 commit 87e1412
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import graphql.schema.GraphQLArgument
* directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE
*
* # federation v2 definition
* directive @key(fields: _FieldSet!, resolvable: Boolean) repeatable on OBJECT | INTERFACE
* directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
* ```
*
* The @key directive is used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface. Key directive should be specified on the root entity type as
Expand Down Expand Up @@ -116,6 +116,7 @@ internal val KEY_DIRECTIVE_TYPE_V2: graphql.schema.GraphQLDirective = graphql.sc
GraphQLArgument.newArgument()
.name("resolvable")
.type(Scalars.GraphQLBoolean)
.defaultValueProgrammatic(true)
)
.repeatable(true)
.build()
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private val FEDERATED_SDL_V2 =
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
"Space separated list of primary keys needed to access federated object"
directive @key(fields: _FieldSet!, resolvable: Boolean) repeatable on OBJECT | INTERFACE
directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
"Links definitions within the document to external schemas."
directive @link(import: [String], url: String) repeatable on SCHEMA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ type Product {
directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE

# federation v2 definition
directive @key(fields: _FieldSet!, resolvable: Boolean) repeatable on OBJECT | INTERFACE
directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
```

The `@key` directive is used to indicate a combination of fields that can be used to uniquely identify and fetch an
Expand Down

0 comments on commit 87e1412

Please sign in to comment.