Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d747d4c

Browse files
Cleanup @graphql-tools/federation (#308)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 261d057 commit d747d4c

21 files changed

+344
-1245
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@graphql-tools/federation': patch
3+
---
4+
5+
dependencies updates:
6+
7+
- Added dependency [`@graphql-yoga/typed-event-target@^3.0.0` ↗︎](https://www.npmjs.com/package/@graphql-yoga/typed-event-target/v/3.0.0) (to `dependencies`)
8+
- Added dependency [`@whatwg-node/disposablestack@^0.0.5` ↗︎](https://www.npmjs.com/package/@whatwg-node/disposablestack/v/0.0.5) (to `dependencies`)
9+
- Added dependency [`@whatwg-node/events@^0.1.2` ↗︎](https://www.npmjs.com/package/@whatwg-node/events/v/0.1.2) (to `dependencies`)

.changeset/fair-glasses-shout.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@graphql-tools/federation': major
3+
---
4+
5+
BREAKING CHANGES;
6+
7+
- Removed `buildSubgraphSchema`, use `@apollo/subgraph` instead.
8+
- Removed the following gateway related functions, and prefer using Supergraph approach instead
9+
- `getSubschemaForFederationWithURL`
10+
- `getSubschemaForFederationWithTypeDefs`
11+
- `getSubschemaForFederationWithExecutor`
12+
- `getSubschemaForFederationWithSchema`
13+
- `federationSubschemaTransformer`
14+
- `SupergraphSchemaManager` is no longer an `EventEmitter` but `EventTarget` instead, and it emits a real `Event` object.
15+
- `SupergraphSchemaManager` is now `Disposable` and it no longer stops based on Nodejs terminate events, so you should use `using` syntax.
16+
17+
```ts
18+
using manager = new SupergraphSchemaManager({ ... });
19+
20+
manager.addEventListener('error', (event: SupergraphSchemaManagerErrorEvent) => {
21+
console.error(event.detail.error);
22+
});
23+
24+
let schema: GraphQLSchema | null = null;
25+
manager.addEventListener('schema', (event: SupergraphSchemaManagerSchemaEvent) => {
26+
schema = event.detail.schema;
27+
});
28+
```

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ jobs:
177177
name: Package binary
178178
run: yarn workspace @graphql-hive/gateway tsx scripts/package-binary
179179
- name: Test
180+
uses: nick-fields/retry@v3
180181
env:
181182
E2E_GATEWAY_RUNNER: ${{matrix.setup.gateway-runner}}
182-
run: yarn test:e2e
183+
with:
184+
timeout_minutes: 10
185+
max_attempts: 2
186+
command: yarn test:e2e

packages/federation/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
"@graphql-tools/stitch": "workspace:^",
4646
"@graphql-tools/utils": "^10.6.2",
4747
"@graphql-tools/wrap": "workspace:^",
48+
"@graphql-yoga/typed-event-target": "^3.0.0",
49+
"@whatwg-node/disposablestack": "^0.0.5",
50+
"@whatwg-node/events": "^0.1.2",
4851
"@whatwg-node/fetch": "^0.10.1",
4952
"tslib": "^2.8.1"
5053
},

packages/federation/src/gateway.ts

Lines changed: 0 additions & 260 deletions
This file was deleted.

packages/federation/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export * from './gateway.js';
21
export * from './managed-federation.js';
3-
export * from './subgraph.js';
42
export * from './supergraph.js';
53
export * from './utils.js';

0 commit comments

Comments
 (0)