@contractspec/lib.graphql-federation 3.7.6 → 3.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +30 -46
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,69 +1,53 @@
1
1
  # @contractspec/lib.graphql-federation
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **Pothos federation helpers and subgraph schema export utilities.**
5
6
 
6
- GraphQL Federation utilities for Pothos.
7
+ ## What It Provides
7
8
 
8
- ## Purpose
9
-
10
- To enable Apollo Federation support for Pothos schemas. This package configures the `@pothos/plugin-federation` and provides helpers for defining entities and resolving references.
9
+ - **Layer**: lib.
10
+ - **Consumers**: bundles with federated GraphQL.
11
+ - Related ContractSpec packages include `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
12
+ - Related ContractSpec packages include `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
11
13
 
12
14
  ## Installation
13
15
 
14
- ```bash
15
- npm install @contractspec/lib.graphql-federation
16
- # or
17
- bun add @contractspec/lib.graphql-federation
18
- ```
16
+ `npm install @contractspec/lib.graphql-federation`
19
17
 
20
- ## Key Concepts
18
+ or
21
19
 
22
- - **Federation**: Apollo Federation V2 support.
23
- - **Entities**: defining `key` fields and `resolveReference` methods.
20
+ `bun add @contractspec/lib.graphql-federation`
24
21
 
25
22
  ## Usage
26
23
 
27
- ```ts
28
- import { builder } from '@contractspec/lib.graphql-core';
29
- import '@contractspec/lib.graphql-federation'; // Side-effect import to register plugin if needed, or use factory
30
-
31
- builder.asEntity(User, {
32
- key: builder.selection<{ id: string }>('id'),
33
- resolveReference: (ref) => getUser(ref.id),
34
- });
35
- ```
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
24
+ Import the root entrypoint from `@contractspec/lib.graphql-federation`, or choose a documented subpath when you only need one part of the package surface.
60
25
 
26
+ ## Architecture
61
27
 
28
+ - `src/index.ts` is the root public barrel and package entrypoint.
62
29
 
30
+ ## Public Entry Points
63
31
 
32
+ - Export `.` resolves through `./src/index.ts`.
64
33
 
34
+ ## Local Commands
65
35
 
36
+ - `bun run dev` — contractspec-bun-build dev
37
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
38
+ - `bun run typecheck` — tsc --noEmit
39
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
40
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
41
+ - `bun run clean` — rm -rf dist
42
+ - `bun run prebuild` — contractspec-bun-build prebuild
43
+ - `bun run build:bundle` — contractspec-bun-build transpile
44
+ - `bun run build:types` — contractspec-bun-build types
66
45
 
46
+ ## Recent Updates
67
47
 
48
+ - Replace eslint+prettier by biomejs to optimize speed.
68
49
 
50
+ ## Notes
69
51
 
52
+ - Federation directives must comply with the Apollo Federation spec; non-compliant changes break gateway composition.
53
+ - Depends on graphql-core — keep builder factory usage aligned.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.graphql-federation",
3
- "version": "3.7.6",
3
+ "version": "3.7.9",
4
4
  "description": "Pothos federation helpers and subgraph schema export utilities",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -31,15 +31,15 @@
31
31
  "@pothos/plugin-federation": "^4.0.0",
32
32
  "@pothos/plugin-directives": "^4.2.3",
33
33
  "graphql": "^16.13.1",
34
- "@apollo/subgraph": "^2.13.1"
34
+ "@apollo/subgraph": "^2.13.3"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "graphql": ">=16.13.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@contractspec/tool.typescript": "3.7.6",
40
+ "@contractspec/tool.typescript": "3.7.9",
41
41
  "typescript": "^5.9.3",
42
- "@contractspec/tool.bun": "3.7.6"
42
+ "@contractspec/tool.bun": "3.7.9"
43
43
  },
44
44
  "type": "module",
45
45
  "exports": {