@reventlessdev/reventless-graphql-server 1.0.0-alpha.1 → 1.0.0-alpha.10
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,77 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 1.0.0-alpha.10 (2026-07-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 1.0.0-alpha.9 (2026-07-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# 1.0.0-alpha.8 (2026-07-13)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# 1.0.0-alpha.7 (2026-07-13)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# 1.0.0-alpha.6 (2026-07-12)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# 1.0.0-alpha.5 (2026-07-12)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
# 1.0.0-alpha.4 (2026-07-12)
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
* **api:** neutralize core-emitted SDL — [@aws](https://github.com/aws)_subscribe moves to the AWS adapter (Phase 2a) ([9b27ec8](https://github.com/ReventlessDev/reventless-core/commit/9b27ec8f6ab2b7453b1c50b9891e89781ec3b31a))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# 1.0.0-alpha.3 (2026-07-11)
|
|
62
|
+
|
|
63
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# 1.0.0-alpha.2 (2026-07-11)
|
|
70
|
+
|
|
71
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
6
77
|
# 1.0.0-alpha.1 (2026-07-11)
|
|
7
78
|
|
|
8
79
|
### Features
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/@reventlessdev/reventless-graphql-server)
|
|
2
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
3
|
+
[](https://docs.reventless.dev)
|
|
4
|
+
|
|
5
|
+
# @reventlessdev/reventless-graphql-server
|
|
6
|
+
|
|
7
|
+
> ⚠️ **Alpha.** APIs and on-disk formats can change without notice between releases.
|
|
8
|
+
> Pin exact versions and expect breaking changes.
|
|
9
|
+
|
|
10
|
+
A **transport-neutral GraphQL server runtime** shared across
|
|
11
|
+
[Reventless](https://docs.reventless.dev) — a spec-driven, event-sourced CQRS
|
|
12
|
+
framework written in [ReScript](https://rescript-lang.org). It stands up
|
|
13
|
+
[Yoga](https://the-guild.dev/graphql/yoga-server)-backed GraphQL servers from
|
|
14
|
+
stitched SDL fragments plus a resolver map, with an optional `graphql-ws`
|
|
15
|
+
WebSocket endpoint and a subscription fan-out bridge over a pluggable PubSub
|
|
16
|
+
backend.
|
|
17
|
+
|
|
18
|
+
## What it provides
|
|
19
|
+
|
|
20
|
+
Two ReScript modules:
|
|
21
|
+
|
|
22
|
+
- **`GraphQL_ServerInstance`** — a server-instance factory. Each instance keeps an
|
|
23
|
+
isolated registry, so a backend can stand up one or more independent servers
|
|
24
|
+
from SDL fragments + a resolver dict, exposed over HTTP with an optional
|
|
25
|
+
`graphql-ws` WebSocket transport for subscriptions. Includes registry
|
|
26
|
+
diagnostics (registered type/field/resolver inventories and SDL-vs-resolver
|
|
27
|
+
mismatch reporting).
|
|
28
|
+
- **`GraphQL_SubscriptionBridge`** — transport-neutral wiring between a server
|
|
29
|
+
instance and a PubSub backend for `graphql-ws` fan-out. The topic vocabulary is
|
|
30
|
+
fixed to core's generated subscription SDL (raw event-stream and state-changed
|
|
31
|
+
fields), but the PubSub instance is a *parameter*: an in-process server passes
|
|
32
|
+
`createPubSub()`, a multi-process gateway passes a cross-process implementation
|
|
33
|
+
of the same interface.
|
|
34
|
+
|
|
35
|
+
## Where it fits
|
|
36
|
+
|
|
37
|
+
`reventless-graphql-server` builds on
|
|
38
|
+
[`@reventlessdev/reventless-core`](https://www.npmjs.com/package/@reventlessdev/reventless-core)
|
|
39
|
+
(for the subscription-schema topic vocabulary and logging) and the framework's
|
|
40
|
+
`graphql-yoga` bindings. It is the reusable serving layer that storage/deployment
|
|
41
|
+
adapters and local platforms wire their generated schema and resolvers into; it
|
|
42
|
+
holds no domain or storage logic of its own.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm add @reventlessdev/reventless-graphql-server
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Register it as a ReScript dependency in `rescript.json`:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"dependencies": ["@reventlessdev/reventless-graphql-server"]
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Requires ReScript `^12.3.0` (peer dependency).
|
|
59
|
+
|
|
60
|
+
## Links
|
|
61
|
+
|
|
62
|
+
- 📚 Documentation — [docs.reventless.dev](https://docs.reventless.dev)
|
|
63
|
+
- 📦 Repository — [ReventlessDev/reventless-core](https://github.com/ReventlessDev/reventless-core)
|
|
64
|
+
- 📋 [Changelog](./CHANGELOG.md)
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
[Apache-2.0](https://opensource.org/licenses/Apache-2.0)
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-graphql-server",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
4
|
"description": "Transport-neutral GraphQL server runtime for Reventless: schema-from-fragments, resolver registration, an HTTP + graphql-ws listener, and a subscription fan-out bridge with a pluggable PubSub backend",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@reventlessdev/
|
|
8
|
-
"@reventlessdev/
|
|
7
|
+
"@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.20",
|
|
8
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.163"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"rescript": "^12.3.0"
|
|
@@ -54,8 +54,9 @@ type subscriptionEntry = {
|
|
|
54
54
|
* The bus→PubSub bridge for each source must already be wired (by the
|
|
55
55
|
* backend) so the topics carry payloads before this registers subscribers.
|
|
56
56
|
*
|
|
57
|
-
* `sdlFields`: the `subscriptions` SDL field strings from the plugin fragment
|
|
58
|
-
*
|
|
57
|
+
* `sdlFields`: the `subscriptions` SDL field strings from the plugin fragment.
|
|
58
|
+
* Core emits provider-neutral subscription SDL (no provider directives), so
|
|
59
|
+
* the fields register as-is.
|
|
59
60
|
*
|
|
60
61
|
* `pubSub`: the backend's PubSub instance; the resolvers subscribe on it.
|
|
61
62
|
*/
|
|
@@ -66,12 +67,6 @@ let registerAll = (
|
|
|
66
67
|
~sourceBEntries: array<subscriptionEntry>,
|
|
67
68
|
~pubSub: YG.pubSub,
|
|
68
69
|
) => {
|
|
69
|
-
// Strip @aws_subscribe directives — only valid in AppSync, not yoga
|
|
70
|
-
let cleanedFields =
|
|
71
|
-
sdlFields->Array.map(field =>
|
|
72
|
-
field->String.split("\n")->Array.filter(line => !(line->String.includes("@aws_subscribe")))->Array.join("\n")
|
|
73
|
-
)
|
|
74
|
-
|
|
75
70
|
let resolvers: dict<YG.resolverFn> = Dict.make()
|
|
76
71
|
|
|
77
72
|
sourceAEntries->Array.forEach(({fieldName, topic}) => {
|
|
@@ -81,7 +76,7 @@ let registerAll = (
|
|
|
81
76
|
resolvers->Dict.set(fieldName, makeFieldResolver(~pubSub, topic))
|
|
82
77
|
})
|
|
83
78
|
|
|
84
|
-
server.registerSubscriptions(~sdlFields
|
|
79
|
+
server.registerSubscriptions(~sdlFields, ~resolvers)
|
|
85
80
|
|
|
86
81
|
// Inject scalar AWSJSON so yoga accepts it in Source A event log types
|
|
87
82
|
server.registerTypes(~sdlTypes=["scalar AWSJSON"])
|
|
@@ -17,7 +17,6 @@ function makeFieldResolver(pubSub, topic) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function registerAll(server, sdlFields, sourceAEntries, sourceBEntries, pubSub) {
|
|
20
|
-
let cleanedFields = sdlFields.map(field => field.split("\n").filter(line => !line.includes("@aws_subscribe")).join("\n"));
|
|
21
20
|
let resolvers = {};
|
|
22
21
|
sourceAEntries.forEach(param => {
|
|
23
22
|
resolvers[param.fieldName] = makeFieldResolver(pubSub, param.topic);
|
|
@@ -25,7 +24,7 @@ function registerAll(server, sdlFields, sourceAEntries, sourceBEntries, pubSub)
|
|
|
25
24
|
sourceBEntries.forEach(param => {
|
|
26
25
|
resolvers[param.fieldName] = makeFieldResolver(pubSub, param.topic);
|
|
27
26
|
});
|
|
28
|
-
server.registerSubscriptions(
|
|
27
|
+
server.registerSubscriptions(sdlFields, resolvers);
|
|
29
28
|
server.registerTypes(["scalar AWSJSON"]);
|
|
30
29
|
}
|
|
31
30
|
|