Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fc1e9e0
feat: add support for federated graph schema changes
JivusAyrus Feb 23, 2026
348aca0
refactor: improve handling of federated graph schema changes and upda…
JivusAyrus Feb 24, 2026
33ffa14
feat: introduce schema_check_federated_graph_changes table and update…
JivusAyrus Feb 27, 2026
c879911
fix: lint
JivusAyrus Feb 27, 2026
16f1e69
fix: update default API URL from port 8090 to 8080
JivusAyrus Feb 27, 2026
b26c097
fix: pr suggestions
JivusAyrus Feb 27, 2026
08f299c
fix: update button rendering logic for schema link in composed schema…
JivusAyrus Feb 27, 2026
6e831eb
test: add assertion for client traffic in subgraph schema check
JivusAyrus Feb 27, 2026
04f5577
Merge branch 'main' into suvij/eng-8924-controlplane-breaking-changes…
JivusAyrus Feb 27, 2026
0f08ec5
test: replace clearAllMocks with resetAllMocks in afterEach for schem…
JivusAyrus Feb 27, 2026
c9fb556
Merge branch 'suvij/eng-8924-controlplane-breaking-changes-should-als…
JivusAyrus Feb 27, 2026
2690e70
chore: merge migrations
JivusAyrus Feb 27, 2026
7cc3bb7
refactor: improve traffic inspection logic for federated and subgraph…
JivusAyrus Feb 27, 2026
67c8a92
fix: lint
JivusAyrus Feb 27, 2026
daf42c2
feat: add tests
JivusAyrus Feb 27, 2026
75b79a4
feat: add tests
JivusAyrus Feb 27, 2026
7094ce3
feat: implement open usage functionality in changes tables and refact…
JivusAyrus Feb 27, 2026
feabf95
fix: clarify message for detected breaking changes in federated graph…
JivusAyrus Feb 27, 2026
c510479
feat: enhance schema change detection by including type additions and…
JivusAyrus Mar 4, 2026
eff47be
test: add detailed checks for breaking changes in federated graph sum…
JivusAyrus Mar 4, 2026
9f939e0
Merge branch 'main' of github.com:wundergraph/cosmo into suvij/eng-89…
JivusAyrus Mar 4, 2026
b74ea1b
refactor: format fieldChangeTypes declaration for improved readabilit…
JivusAyrus Mar 4, 2026
3f0d9e0
feat: enhance check operations and toggle change overrides to include…
JivusAyrus Mar 4, 2026
be9321e
refactor: improve code readability by adjusting filter formatting in …
JivusAyrus Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const registerSubgraphVerifySchemaChangesTool = ({ server, opts }: ToolCo
...resp,
isCheckSuccessful: isCheckSuccessful({
isComposable: resp.compositionErrors.length === 0,
isBreaking: resp.breakingChanges.length > 0,
isBreaking: resp.breakingChanges.length > 0 || resp.composedSchemaBreakingChanges.length > 0,
hasClientTraffic:
(resp.operationUsageStats?.totalOperations ?? 0) > 0 &&
(resp.operationUsageStats?.totalOperations ?? 0) !==
Expand Down
51 changes: 44 additions & 7 deletions cli/src/handle-check-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ export const handleCheckResult = (resp: CheckSubgraphSchemaResponse, rowLimit: n
wordWrap: true,
});

const composedSchemaChangesTable = new Table({
head: [
pc.bold(pc.white('CHANGE')),
pc.bold(pc.white('TYPE')),
pc.bold(pc.white('FEDERATED_GRAPH')),
pc.bold(pc.white('DESCRIPTION')),
],
wordWrap: true,
});

const compositionErrorsTable = new Table({
head: [pc.bold(pc.white('GRAPH_NAME')), pc.bold(pc.white('NAMESPACE')), pc.bold(pc.white('ERROR_MESSAGE'))],
colWidths: [30, 30, 120],
Expand Down Expand Up @@ -62,6 +72,7 @@ export const handleCheckResult = (resp: CheckSubgraphSchemaResponse, rowLimit: n
if (
resp.nonBreakingChanges.length === 0 &&
resp.breakingChanges.length === 0 &&
resp.composedSchemaBreakingChanges.length === 0 &&
resp.compositionErrors.length === 0 &&
resp.lintErrors.length === 0 &&
resp.lintWarnings.length === 0 &&
Expand Down Expand Up @@ -104,13 +115,18 @@ export const handleCheckResult = (resp: CheckSubgraphSchemaResponse, rowLimit: n
resp.breakingChanges.length === 0 &&
resp.compositionErrors.length === 0 &&
resp.lintErrors.length === 0 &&
resp.graphPruneErrors.length === 0;
resp.graphPruneErrors.length === 0 &&
resp.composedSchemaBreakingChanges.length === 0;

const { breakingChanges, operationUsageStats, clientTrafficCheckSkipped } = resp;
const { breakingChanges, operationUsageStats, clientTrafficCheckSkipped, composedSchemaBreakingChanges } =
resp;
const { totalOperations, safeOperations, firstSeenAt, lastSeenAt } = operationUsageStats;

if (breakingChanges.length > 0) {
const warningMessage = [logSymbols.warning, ` Found ${pc.bold(breakingChanges.length)} breaking changes.`];
if (breakingChanges.length > 0 || composedSchemaBreakingChanges.length > 0) {
const warningMessage = [
logSymbols.warning,
` Found ${pc.bold(breakingChanges.length + composedSchemaBreakingChanges.length)} breaking changes.`,
];

if (totalOperations > 0) {
warningMessage.push(`${pc.bold(totalOperations - safeOperations)} operations impacted.`);
Expand All @@ -130,15 +146,15 @@ export const handleCheckResult = (resp: CheckSubgraphSchemaResponse, rowLimit: n

console.log(warningMessage.join(''));

finalStatement = `This check has encountered ${pc.bold(`${breakingChanges.length}`)} breaking changes${
finalStatement = `This check has encountered ${pc.bold(`${breakingChanges.length + composedSchemaBreakingChanges.length}`)} breaking changes${
clientTrafficCheckSkipped ? `.` : ` that would break operations from existing client traffic.`
}`;
}
}
}

if (resp.nonBreakingChanges.length > 0 || resp.breakingChanges.length > 0) {
console.log('\nDetected the following changes:');
console.log('\nDetected the following subgraph schema changes:');

if (resp.breakingChanges.length > 0) {
for (const breakingChange of resp.breakingChanges) {
Expand All @@ -163,6 +179,26 @@ export const handleCheckResult = (resp: CheckSubgraphSchemaResponse, rowLimit: n
console.log(changesTable.toString());
}

if (resp.composedSchemaBreakingChanges.length > 0) {
console.log(pc.red('\nDetected the following federated graph schema breaking changes:'));
console.log(
pc.dim(
'These breaking changes were detected in the composed federated graph schema after composition. They are not reported above because they only become visible when all subgraphs are composed together (e.g., field type or nullability conflicts between subgraphs).',
),
);

for (const change of resp.composedSchemaBreakingChanges) {
composedSchemaChangesTable.push([
`${logSymbols.error} ${pc.red('BREAKING')}`,
change.changeType,
change.federatedGraphName,
change.message,
]);
}

console.log(composedSchemaChangesTable.toString());
}

if (resp.compositionErrors.length > 0) {
console.log(pc.red('\nDetected composition errors:'));
for (const compositionError of resp.compositionErrors) {
Expand Down Expand Up @@ -256,7 +292,8 @@ export const handleCheckResult = (resp: CheckSubgraphSchemaResponse, rowLimit: n
resp.counts.breakingChanges + resp.counts.nonBreakingChanges > rowLimit ||
resp.counts.graphPruneErrors + resp.counts.graphPruneWarnings > rowLimit ||
resp.counts.compositionErrors > rowLimit ||
resp.counts.compositionWarnings > rowLimit;
resp.counts.compositionWarnings > rowLimit ||
resp.counts.composedSchemaBreakingChanges > rowLimit;

if (hasExceeded) {
if (studioCheckDestination !== '') {
Expand Down
Loading
Loading