Skip to content

Commit 3d721c7

Browse files
authored
[federation] fix override directive definition (#1554)
`@override` directive is not repeatable. Fixing copy and paste bug.
1 parent 815fec9 commit 3d721c7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ import graphql.schema.GraphQLNonNull
2828
* ```
2929
*
3030
* The @override directive is used to indicate that the current subgraph is taking responsibility for resolving the marked field away from the subgraph specified in the from argument. Name of the subgraph
31-
* to be overriden has to match the name of the subgraph that was used to publish their schema.
31+
* to be overridden has to match the name of the subgraph that was used to publish their schema.
3232
*
3333
* >NOTE: Only one subgraph can `@override` any given field. If multiple subgraphs attempt to `@override` the same field, a composition error occurs.
3434
*
3535
* @param from name of the subgraph to override field resolution
3636
*
3737
* @see <a href="https://www.apollographql.com/docs/rover/subgraphs/#publishing-a-subgraph-schema-to-apollo-studio">Publishing schema to Apollo Studio</a>
3838
*/
39-
@Repeatable
4039
@GraphQLDirective(
4140
name = OVERRIDE_DIRECTIVE_NAME,
4241
description = OVERRIDE_DIRECTIVE_DESCRIPTION,
@@ -56,5 +55,4 @@ internal val OVERRIDE_DIRECTIVE_TYPE: graphql.schema.GraphQLDirective = graphql.
5655
.name("from")
5756
.type(GraphQLNonNull.nonNull(Scalars.GraphQLString))
5857
)
59-
.repeatable(true)
6058
.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
@@ -64,7 +64,7 @@ class FederatedSchemaV2GeneratorTest {
6464
directive @link(import: [String], url: String) repeatable on SCHEMA
6565
6666
"Overrides fields resolution logic from other subgraph. Used for migrating fields from one subgraph to another."
67-
directive @override(from: String!) repeatable on FIELD_DEFINITION
67+
directive @override(from: String!) on FIELD_DEFINITION
6868
6969
"Specifies the base type field set that will be selectable by the gateway"
7070
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION

0 commit comments

Comments
 (0)