Skip to content

Commit

Permalink
[federation] fix override directive definition (#1554)
Browse files Browse the repository at this point in the history
`@override` directive is not repeatable. Fixing copy and paste bug.
  • Loading branch information
dariuszkuc authored Sep 16, 2022
1 parent 815fec9 commit 3d721c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ import graphql.schema.GraphQLNonNull
* ```
*
* 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
* to be overriden has to match the name of the subgraph that was used to publish their schema.
* to be overridden has to match the name of the subgraph that was used to publish their schema.
*
* >NOTE: Only one subgraph can `@override` any given field. If multiple subgraphs attempt to `@override` the same field, a composition error occurs.
*
* @param from name of the subgraph to override field resolution
*
* @see <a href="https://www.apollographql.com/docs/rover/subgraphs/#publishing-a-subgraph-schema-to-apollo-studio">Publishing schema to Apollo Studio</a>
*/
@Repeatable
@GraphQLDirective(
name = OVERRIDE_DIRECTIVE_NAME,
description = OVERRIDE_DIRECTIVE_DESCRIPTION,
Expand All @@ -56,5 +55,4 @@ internal val OVERRIDE_DIRECTIVE_TYPE: graphql.schema.GraphQLDirective = graphql.
.name("from")
.type(GraphQLNonNull.nonNull(Scalars.GraphQLString))
)
.repeatable(true)
.build()
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FederatedSchemaV2GeneratorTest {
directive @link(import: [String], url: String) repeatable on SCHEMA
"Overrides fields resolution logic from other subgraph. Used for migrating fields from one subgraph to another."
directive @override(from: String!) repeatable on FIELD_DEFINITION
directive @override(from: String!) on FIELD_DEFINITION
"Specifies the base type field set that will be selectable by the gateway"
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
Expand Down

0 comments on commit 3d721c7

Please sign in to comment.