Skip to content

Commit 76f1bac

Browse files
authored
[federation] fix override directive definition (#1555)
`@override` directive is not repeatable. Fixing copy and paste bug.
1 parent 665d73e commit 76f1bac

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJE
126126
directive @link(import: [String], url: String) repeatable on SCHEMA
127127
128128
"Overrides fields resolution logic from other subgraph. Used for migrating fields from one subgraph to another."
129-
directive @override(from: String!) repeatable on FIELD_DEFINITION
129+
directive @override(from: String!) on FIELD_DEFINITION
130130
131131
"Specifies the base type field set that will be selectable by the gateway"
132132
directive @provides(fields: FieldSet!) on FIELD_DEFINITION

0 commit comments

Comments
 (0)