diff --git a/composition-js/src/__tests__/override.compose.test.ts b/composition-js/src/__tests__/override.compose.test.ts index 2873cd67f..56a7c0c65 100644 --- a/composition-js/src/__tests__/override.compose.test.ts +++ b/composition-js/src/__tests__/override.compose.test.ts @@ -672,7 +672,7 @@ describe("composition involving @override directive", () => { expect(result.errors).toBeDefined(); expect(errors(result)).toContainEqual([ "OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE", - `@override cannot be used on field "T.u" on subgraph "Subgraph1" since "T.u" on "Subgraph1" is marked with directive "@provides"`, + `@override cannot be used on field "T.u" on subgraph "Subgraph1" since "T.u" on "Subgraph2" is marked with directive "@provides"`, ]); }); @@ -718,7 +718,7 @@ describe("composition involving @override directive", () => { expect(result.errors).toBeDefined(); expect(errors(result)).toContainEqual([ "OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE", - `@override cannot be used on field "T.u" on subgraph "Subgraph1" since "T.u" on "Subgraph1" is marked with directive "@requires"`, + `@override cannot be used on field "T.u" on subgraph "Subgraph1" since "T.u" on "Subgraph2" is marked with directive "@requires"`, ]); }); diff --git a/composition-js/src/merging/merge.ts b/composition-js/src/merging/merge.ts index 36724a0f3..fd639471e 100644 --- a/composition-js/src/merging/merge.ts +++ b/composition-js/src/merging/merge.ts @@ -1154,7 +1154,7 @@ class Merger { return { result: true, conflictingDirective: directive, - subgraph: subgraphName, + subgraph: this.names[fromIdx], }; } }