@mcp-layer/graphql 0.2.1 → 0.2.3
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.
- package/README.md +56 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -88,8 +88,9 @@ Options:
|
|
|
88
88
|
|
|
89
89
|
| Option | Type | Default | Description |
|
|
90
90
|
| --- | --- | --- | --- |
|
|
91
|
-
| `session` | `Session` or `Session[]` | required | Bootstrap session(s) used for catalog extraction and static mode. |
|
|
92
|
-
| `
|
|
91
|
+
| `session` | `Session` or `Session[]` | required unless using `manager` + `catalog` | Bootstrap session(s) used for catalog extraction and static mode. |
|
|
92
|
+
| `catalog` | `{ server?, items? }` | optional | Precomputed bootstrap catalog used when the live session should only be resolved lazily. |
|
|
93
|
+
| `manager` | `{ get(request), close?() }` | optional | Per-request session manager (requires bootstrap `session` or `catalog`). |
|
|
93
94
|
| `prefix` | `string` or `(version, info, name) => string` | derived | Per-session route prefix. |
|
|
94
95
|
| `endpoint` | `string` | `"/graphql"` | GraphQL POST endpoint path under prefix. |
|
|
95
96
|
| `ide.enabled` | `boolean` | `false` | Enables GraphiQL route. |
|
|
@@ -599,7 +600,7 @@ Thrown from: `validateRuntimeOptions` (via `@mcp-layer/gateway`)
|
|
|
599
600
|
This happens when `manager` is provided while `session` is an array.
|
|
600
601
|
|
|
601
602
|
Step-by-step resolution:
|
|
602
|
-
1. In manager mode, pass one bootstrap `session`.
|
|
603
|
+
1. In manager mode, pass one bootstrap `session` or one bootstrap `catalog`.
|
|
603
604
|
2. For multi-session static mounts, remove `manager`.
|
|
604
605
|
3. Register separate plugin instances per static session surface.
|
|
605
606
|
4. Add startup tests for both architecture modes.
|
|
@@ -618,20 +619,20 @@ await fastify.register(mcpGraphql, {
|
|
|
618
619
|
|
|
619
620
|
</details>
|
|
620
621
|
|
|
621
|
-
<a id="error-
|
|
622
|
-
### `session is required when manager is provided (used for catalog bootstrap).`
|
|
622
|
+
<a id="error-aae9b3"></a>
|
|
623
|
+
### `session or catalog is required when manager is provided (used for catalog bootstrap).`
|
|
623
624
|
|
|
624
625
|
Thrown from: `validateRuntimeOptions` (via `@mcp-layer/gateway`)
|
|
625
626
|
|
|
626
|
-
This happens when `manager` is configured without a bootstrap `session`.
|
|
627
|
+
This happens when `manager` is configured without a bootstrap `session` or `catalog`.
|
|
627
628
|
|
|
628
629
|
Step-by-step resolution:
|
|
629
|
-
1. Always provide a bootstrap `session` with `manager`.
|
|
630
|
-
2. Ensure bootstrap session is connected before registration.
|
|
630
|
+
1. Always provide a bootstrap `session` or `catalog` with `manager`.
|
|
631
|
+
2. Ensure the bootstrap session is connected before registration, or ensure the bootstrap catalog matches the managed session surface.
|
|
631
632
|
3. Keep bootstrap and managed sessions aligned in capability surface.
|
|
632
|
-
4. Add tests that fail fast without bootstrap
|
|
633
|
+
4. Add tests that fail fast without bootstrap metadata.
|
|
633
634
|
|
|
634
|
-
Canonical gateway reference: [`@mcp-layer/gateway` runtime errors](../gateway/README.md#error-
|
|
635
|
+
Canonical gateway reference: [`@mcp-layer/gateway` runtime errors](../gateway/README.md#error-b010d3).
|
|
635
636
|
|
|
636
637
|
<details>
|
|
637
638
|
<summary>Fix Example: include bootstrap session in manager mode</summary>
|
|
@@ -645,6 +646,50 @@ await fastify.register(mcpGraphql, {
|
|
|
645
646
|
|
|
646
647
|
</details>
|
|
647
648
|
|
|
649
|
+
<details>
|
|
650
|
+
<summary>Fix Example: include bootstrap catalog in manager mode</summary>
|
|
651
|
+
|
|
652
|
+
```js
|
|
653
|
+
await fastify.register(mcpGraphql, {
|
|
654
|
+
catalog,
|
|
655
|
+
manager
|
|
656
|
+
});
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
</details>
|
|
660
|
+
|
|
661
|
+
<a id="error-f184e1"></a>
|
|
662
|
+
### `catalog must be an object.`
|
|
663
|
+
|
|
664
|
+
Thrown from: `validateRuntimeOptions` (via `@mcp-layer/gateway`)
|
|
665
|
+
|
|
666
|
+
This happens when `catalog` is passed as a primitive, array, or serialized payload instead of the composed catalog object the GraphQL plugin expects at bootstrap.
|
|
667
|
+
|
|
668
|
+
Step-by-step resolution:
|
|
669
|
+
1. Pass the bootstrap catalog as a plain object.
|
|
670
|
+
2. Do not pass stringified JSON or only the `items` array.
|
|
671
|
+
3. Ensure the object shape matches the extracted/composed catalog surface.
|
|
672
|
+
4. Add registration tests that reject malformed catalog bootstrap values.
|
|
673
|
+
|
|
674
|
+
Canonical gateway reference: [`@mcp-layer/gateway` runtime errors](../gateway/README.md#error-17712f).
|
|
675
|
+
|
|
676
|
+
<details>
|
|
677
|
+
<summary>Fix Example: provide bootstrap catalog as an object</summary>
|
|
678
|
+
|
|
679
|
+
```js
|
|
680
|
+
await fastify.register(mcpGraphql, {
|
|
681
|
+
catalog: {
|
|
682
|
+
server: {
|
|
683
|
+
info: { name: 'example-server', version: '1.0.0' }
|
|
684
|
+
},
|
|
685
|
+
items: []
|
|
686
|
+
},
|
|
687
|
+
manager
|
|
688
|
+
});
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
</details>
|
|
692
|
+
|
|
648
693
|
<a id="error-66da32"></a>
|
|
649
694
|
### `session or manager option is required.`
|
|
650
695
|
|
|
@@ -654,7 +699,7 @@ This happens when plugin options omit both `session` and `manager`.
|
|
|
654
699
|
|
|
655
700
|
Step-by-step resolution:
|
|
656
701
|
1. Pass a connected `session` for static mode.
|
|
657
|
-
2. Or pass `manager` plus bootstrap `session` for dynamic mode.
|
|
702
|
+
2. Or pass `manager` plus bootstrap `session` or `catalog` for dynamic mode.
|
|
658
703
|
3. Assert required options before `register`.
|
|
659
704
|
4. Add tests that validate registration failure on missing session source.
|
|
660
705
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-layer/graphql",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Fastify GraphQL plugin and schema builder for MCP catalogs with shared gateway runtime primitives.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"mercurius": "^16.7.0",
|
|
44
44
|
"uri-template": "^2.0.0",
|
|
45
45
|
"@mcp-layer/error": "0.2.1",
|
|
46
|
-
"@mcp-layer/gateway": "0.2.
|
|
46
|
+
"@mcp-layer/gateway": "0.2.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"fastify": "^5.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"fastify": "^5.
|
|
53
|
-
"@mcp-layer/attach": "1.
|
|
52
|
+
"fastify": "^5.12.6",
|
|
53
|
+
"@mcp-layer/attach": "1.2.0",
|
|
54
54
|
"@mcp-layer/manager": "0.2.1",
|
|
55
55
|
"@mcp-layer/test-server": "1.0.4"
|
|
56
56
|
},
|