@reventlessdev/reventless-graphql-server 1.0.0-alpha.108 → 1.0.0-alpha.109
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,14 @@
|
|
|
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.109 (2026-09-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# 1.0.0-alpha.108 (2026-09-08)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @reventlessdev/reventless-graphql-server
|
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.109",
|
|
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/rescript-graphql-yoga": "1.0.0-alpha.
|
|
8
|
-
"@reventlessdev/reventless-core": "3.0.0-alpha.
|
|
7
|
+
"@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.28",
|
|
8
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.261"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"rescript": "12.3.0"
|
|
@@ -111,9 +111,9 @@ let make = (~label: string="GraphQL"): t => {
|
|
|
111
111
|
|
|
112
112
|
let registerSubscriptions = (~sdlFields: array<string>, ~resolvers: dict<resolverFn>) => {
|
|
113
113
|
subscriptionFields.contents = subscriptionFields.contents->Array.concat(sdlFields)
|
|
114
|
-
resolvers
|
|
115
|
-
|
|
116
|
-
)
|
|
114
|
+
resolvers
|
|
115
|
+
->Dict.toArray
|
|
116
|
+
->Array.forEach(((k, v)) => subscriptionResolvers.contents->Dict.set(k, v))
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
let registerFieldResolvers = (~typeName: string, ~resolvers: dict<resolverFn>) => {
|
|
@@ -146,9 +146,7 @@ let make = (~label: string="GraphQL"): t => {
|
|
|
146
146
|
|
|
147
147
|
let buildSdl = () => {
|
|
148
148
|
let typesSdl =
|
|
149
|
-
typeDefinitions.contents->Array.length > 0
|
|
150
|
-
? typeDefinitions.contents->Array.join("\n\n")
|
|
151
|
-
: ""
|
|
149
|
+
typeDefinitions.contents->Array.length > 0 ? typeDefinitions.contents->Array.join("\n\n") : ""
|
|
152
150
|
let mutations =
|
|
153
151
|
mutationFields.contents->Array.length > 0
|
|
154
152
|
? mutationFields.contents->Array.join("\n")
|
|
@@ -168,9 +166,7 @@ ${mutations}
|
|
|
168
166
|
? `\n\ntype Subscription {\n${subscriptionFields.contents->Array.join("\n")}\n}`
|
|
169
167
|
: ""
|
|
170
168
|
let base =
|
|
171
|
-
typesSdl->String.length > 0
|
|
172
|
-
? typesSdl ++ "\n\n" ++ queriesMutationsSdl
|
|
173
|
-
: queriesMutationsSdl
|
|
169
|
+
typesSdl->String.length > 0 ? typesSdl ++ "\n\n" ++ queriesMutationsSdl : queriesMutationsSdl
|
|
174
170
|
base ++ subscriptionsSdl
|
|
175
171
|
}
|
|
176
172
|
|
|
@@ -202,8 +198,14 @@ ${mutations}
|
|
|
202
198
|
// with the original Error even when the client response is masked — is never
|
|
203
199
|
// swallowed), while verbose debug/info stay gated on GRAPHQL_DEBUG.
|
|
204
200
|
let yogaLogging: YG.yogaLogger = {
|
|
205
|
-
debug: a =>
|
|
206
|
-
|
|
201
|
+
debug: a =>
|
|
202
|
+
if debug {
|
|
203
|
+
log.debug(~comp=label, YG.logArgToString(a))
|
|
204
|
+
},
|
|
205
|
+
info: a =>
|
|
206
|
+
if debug {
|
|
207
|
+
log.info(~comp=label, YG.logArgToString(a))
|
|
208
|
+
},
|
|
207
209
|
warn: a => log.warn(~comp=label, YG.logArgToString(a)),
|
|
208
210
|
error: a => log.error(~comp=label, YG.logArgToString(a)),
|
|
209
211
|
}
|
|
@@ -231,7 +233,10 @@ ${mutations}
|
|
|
231
233
|
if subscriptionResolvers.contents->Dict.keysToArray->Array.length > 0 {
|
|
232
234
|
let wss = YG.newWebSocketServer({"server": server, "path": "/graphql"})
|
|
233
235
|
YG.wsUseServer({"schema": schema}, wss)
|
|
234
|
-
log.info(
|
|
236
|
+
log.info(
|
|
237
|
+
~comp=label,
|
|
238
|
+
`graphql-ws subscriptions on ws://localhost:${port->Int.toString}/graphql`,
|
|
239
|
+
)
|
|
235
240
|
}
|
|
236
241
|
activeServer.contents = Some(server)
|
|
237
242
|
}
|
|
@@ -33,8 +33,7 @@ let sourceBTopic = (returnTypeName: string) => `on${returnTypeName}_stateChanged
|
|
|
33
33
|
|
|
34
34
|
let makeFieldResolver = (~pubSub: YG.pubSub, topic: string): YG.resolverFn => {
|
|
35
35
|
Obj.magic({
|
|
36
|
-
"subscribe": (_root: JSON.t, _args: JSON.t, _ctx: JSON.t) =>
|
|
37
|
-
pubSub->YG.pubSubSubscribe(topic),
|
|
36
|
+
"subscribe": (_root: JSON.t, _args: JSON.t, _ctx: JSON.t) => pubSub->YG.pubSubSubscribe(topic),
|
|
38
37
|
"resolve": (payload: JSON.t) => payload,
|
|
39
38
|
})
|
|
40
39
|
}
|