Skip to content

Commit 0ad812e

Browse files
authored
Merge branch 'main' into ludwig/eng-7466-add-support-for-deprecated-directive
2 parents f73d563 + 783f875 commit 0ad812e

File tree

26 files changed

+974
-511
lines changed

26 files changed

+974
-511
lines changed

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"helm/cosmo": "0.13.1",
3-
"helm/cosmo/charts/router": "0.13.1"
2+
"helm/cosmo": "0.13.2",
3+
"helm/cosmo/charts/router": "0.14.0"
44
}

cli/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Binaries are attached to the github release otherwise all images can be found [h
44
All notable changes to this project will be documented in this file.
55
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
66

7+
## [0.90.2](https://github.com/wundergraph/cosmo/compare/wgc@0.90.1...wgc@0.90.2) (2025-08-15)
8+
9+
**Note:** Version bump only for package wgc
10+
711
## [0.90.1](https://github.com/wundergraph/cosmo/compare/wgc@0.90.0...wgc@0.90.1) (2025-08-12)
812

913
### Bug Fixes

cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wgc",
3-
"version": "0.90.1",
3+
"version": "0.90.2",
44
"description": "The official CLI tool to manage the GraphQL Federation Platform Cosmo",
55
"type": "module",
66
"main": "dist/src/index.js",
@@ -48,7 +48,7 @@
4848
"@wundergraph/cosmo-shared": "workspace:*",
4949
"@wundergraph/protographic": "workspace:*",
5050
"ajv": "^8.17.1",
51-
"axios": "^1.8.4",
51+
"axios": "^1.11.0",
5252
"boxen": "^7.1.1",
5353
"cli-progress": "^3.12.0",
5454
"cli-table3": "^0.6.3",
@@ -72,7 +72,7 @@
7272
"ora": "^8.2.0",
7373
"pathe": "^1.1.1",
7474
"picocolors": "^1.0.0",
75-
"posthog-node": "^4.17.1",
75+
"posthog-node": "^4.18.0",
7676
"prompts": "^2.4.2",
7777
"pupa": "^3.1.0",
7878
"semver": "^7.7.1",

cli/src/commands/router/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ export default (opts: BaseCommandOptions) => {
4040
);
4141

4242
cmd.hook('preAction', async (thisCmd) => {
43-
if (['compose', 'download-binary', 'compatibility-version', 'plugin'].includes(thisCmd.args[0])) {
43+
if (['compose', 'download-binary', 'compatibility-version'].includes(thisCmd.args[0])) {
44+
return;
45+
}
46+
47+
if (thisCmd.args[0] === 'plugin' && ['build', 'generate', 'init', 'test'].includes(thisCmd.args[1])) {
4448
return;
4549
}
4650
await checkAuth();

composition-go/index.global.js

Lines changed: 41 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composition/src/errors/errors.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,9 @@ export function undefinedEntityInterfaceImplementationsError(
847847
entityInterfaceFederationDataByTypeName: Map<string, EntityInterfaceFederationData>,
848848
): Error {
849849
let message =
850-
`Federation was unsuccessful because any one subgraph that defines a specific entity interface` +
851-
` must also define each and every entity object that implements that entity interface.\n`;
850+
`Federation was unsuccessful because any one subgraph that defines a specific entity Interface` +
851+
` must also define each and every entity Object that implements that entity Interface.\n` +
852+
`Each entity Object must also explicitly define its implementation of the entity Interface.\n`;
852853
for (const [typeName, undefinedImplementations] of invalidEntityInterfacesByTypeName) {
853854
const entityInterfaceDatas = getOrThrowError(
854855
entityInterfaceFederationDataByTypeName,
@@ -864,8 +865,8 @@ export function undefinedEntityInterfaceImplementationsError(
864865
`"\n` +
865866
` However, the definition of at least one of these implementations is missing in a subgraph that` +
866867
` defines the entity interface "${typeName}":\n`;
867-
for (const { subgraphName, concreteTypeNames } of undefinedImplementations) {
868-
const disparities = getEntriesNotInHashSet(implementedConcreteTypeNames, concreteTypeNames);
868+
for (const { subgraphName, definedConcreteTypeNames } of undefinedImplementations) {
869+
const disparities = getEntriesNotInHashSet(implementedConcreteTypeNames, definedConcreteTypeNames);
869870
message +=
870871
` Subgraph "${subgraphName}" does not define the following implementations: "` +
871872
disparities.join(QUOTATION_JOIN) +

composition/src/utils/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ export type InvalidRequiredInputValueData = {
3737
};
3838

3939
export type InvalidEntityInterface = {
40+
definedConcreteTypeNames: Set<string>;
41+
requiredConcreteTypeNames: Set<string>;
4042
subgraphName: string;
41-
concreteTypeNames: Set<string>;
4243
};
4344

4445
export type InputNodeKind = Kind.ENUM_TYPE_DEFINITION | Kind.INPUT_OBJECT_TYPE_DEFINITION | Kind.SCALAR_TYPE_DEFINITION;

composition/src/v1/federation/federation-factory.ts

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ import {
230230
InvalidRequiredInputValueData,
231231
} from '../../utils/types';
232232
import { FederateSubgraphsContractV1Params, FederateSubgraphsWithContractsV1Params, FederationParams } from './types';
233-
import { ContractName, FieldCoords, TypeName } from '../../types/types';
233+
import { ContractName, FieldCoords, SubgraphName, TypeName } from '../../types/types';
234234

235235
export class FederationFactory {
236236
authorizationDataByParentTypeName: Map<string, AuthorizationData>;
@@ -1617,7 +1617,7 @@ export class FederationFactory {
16171617
if (!isObjectDefinitionData(concreteTypeData)) {
16181618
continue;
16191619
}
1620-
// The subgraph locations of the interface object must be added to the concrete types that implement it
1620+
// The subgraph locations of the Interface Object must be added to the concrete types that implement it
16211621
const entityData = getOrThrowError(this.entityDataByTypeName, concreteTypeName, 'entityDataByTypeName');
16221622
entityData.subgraphNames.add(subgraphName);
16231623
const configurationData = configurationDataByTypeName.get(concreteTypeName);
@@ -1673,10 +1673,16 @@ export class FederationFactory {
16731673
}
16741674
}
16751675
const existingFieldData = concreteTypeData.fieldDataByName.get(fieldName);
1676+
// @shareable and @external need to be propagated (e.g., to satisfy interfaces)
16761677
if (existingFieldData) {
16771678
const isShareable = fieldData.isShareableBySubgraphName.get(subgraphName) ?? false;
16781679
existingFieldData.isShareableBySubgraphName.set(subgraphName, isShareable);
16791680
existingFieldData.subgraphNames.add(subgraphName);
1681+
const externalData = fieldData.externalFieldDataBySubgraphName.get(subgraphName);
1682+
if (!externalData) {
1683+
continue;
1684+
}
1685+
existingFieldData.externalFieldDataBySubgraphName.set(subgraphName, { ...externalData });
16801686
continue;
16811687
}
16821688
const isInaccessible =
@@ -3061,18 +3067,31 @@ function initializeFederationFactory({
30613067
}
30623068
}
30633069
const entityInterfaceErrors = new Array<Error>();
3070+
const definedConcreteTypeNamesBySubgraphName = new Map<SubgraphName, Set<TypeName>>();
30643071
for (const [typeName, entityInterfaceData] of entityInterfaceFederationDataByTypeName) {
30653072
const implementations = entityInterfaceData.concreteTypeNames.size;
30663073
for (const [subgraphName, subgraphData] of entityInterfaceData.subgraphDataByTypeName) {
3074+
const definedConcreteTypeNames = getValueOrDefault(
3075+
definedConcreteTypeNamesBySubgraphName,
3076+
subgraphName,
3077+
() => new Set<TypeName>(),
3078+
);
3079+
addIterableValuesToSet(subgraphData.concreteTypeNames, definedConcreteTypeNames);
30673080
if (!subgraphData.isInterfaceObject) {
30683081
if (subgraphData.resolvable && subgraphData.concreteTypeNames.size !== implementations) {
3069-
getValueOrDefault(invalidEntityInterfacesByTypeName, typeName, () => []).push({
3082+
getValueOrDefault(
3083+
invalidEntityInterfacesByTypeName,
3084+
typeName,
3085+
() => new Array<InvalidEntityInterface>(),
3086+
).push({
30703087
subgraphName,
3071-
concreteTypeNames: subgraphData.concreteTypeNames,
3088+
definedConcreteTypeNames: new Set<TypeName>(subgraphData.concreteTypeNames),
3089+
requiredConcreteTypeNames: new Set<TypeName>(entityInterfaceData.concreteTypeNames),
30723090
});
30733091
}
30743092
continue;
30753093
}
3094+
addIterableValuesToSet(entityInterfaceData.concreteTypeNames, definedConcreteTypeNames);
30763095
const { parentDefinitionDataByTypeName } = getOrThrowError(
30773096
result.internalSubgraphBySubgraphName,
30783097
subgraphName,
@@ -3091,6 +3110,26 @@ function initializeFederationFactory({
30913110
}
30923111
}
30933112
}
3113+
for (const [typeName, invalidInterfaces] of invalidEntityInterfacesByTypeName) {
3114+
const checkedInvalidInterfaces = new Array<InvalidEntityInterface>();
3115+
for (const invalidInterface of invalidInterfaces) {
3116+
const validTypeNames = definedConcreteTypeNamesBySubgraphName.get(invalidInterface.subgraphName);
3117+
if (!validTypeNames) {
3118+
checkedInvalidInterfaces.push(invalidInterface);
3119+
continue;
3120+
}
3121+
const definedTypeNames = invalidInterface.requiredConcreteTypeNames.intersection(validTypeNames);
3122+
if (invalidInterface.requiredConcreteTypeNames.size !== definedTypeNames.size) {
3123+
invalidInterface.definedConcreteTypeNames = definedTypeNames;
3124+
checkedInvalidInterfaces.push(invalidInterface);
3125+
}
3126+
}
3127+
if (checkedInvalidInterfaces.length > 0) {
3128+
invalidEntityInterfacesByTypeName.set(typeName, checkedInvalidInterfaces);
3129+
continue;
3130+
}
3131+
invalidEntityInterfacesByTypeName.delete(typeName);
3132+
}
30943133
if (invalidEntityInterfacesByTypeName.size > 0) {
30953134
entityInterfaceErrors.push(
30963135
undefinedEntityInterfaceImplementationsError(

0 commit comments

Comments
 (0)