@reventlessdev/reventless-graphql-server 1.0.0-alpha.13 → 1.0.0-alpha.15

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,20 @@
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.15 (2026-07-14)
7
+
8
+ ### Features
9
+
10
+ * surface masked GraphQL resolver errors server-side (local + AWS) ([b3bca51](https://github.com/ReventlessDev/reventless-core/commit/b3bca51b539e40c604b3db338d570de6215ea837))
11
+
12
+
13
+ # 1.0.0-alpha.14 (2026-07-14)
14
+
15
+ ### Features
16
+
17
+ * **local:** plugin=subgraph composition — per-plugin subschemas merged at start (Phase 6, plan complete) ([40f44c5](https://github.com/ReventlessDev/reventless-core/commit/40f44c5c6aa32fbbd64f362841cf41ba4e2fc2e0))
18
+
19
+
6
20
  # 1.0.0-alpha.13 (2026-07-14)
7
21
 
8
22
  **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.13",
3
+ "version": "1.0.0-alpha.15",
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.20",
8
- "@reventlessdev/reventless-core": "3.0.0-alpha.166"
7
+ "@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.22",
8
+ "@reventlessdev/reventless-core": "3.0.0-alpha.168"
9
9
  },
10
10
  "devDependencies": {
11
11
  "rescript": "^12.3.0"
@@ -101,8 +101,15 @@ let make = (~label: string="GraphQL"): t => {
101
101
  )
102
102
  }
103
103
 
104
+ // Identical type blocks dedupe: shared-type registrations (e.g. the
105
+ // CommandResult union family) may be repeated by every component that needs
106
+ // them; a duplicate definition in one document would fail createSchema.
104
107
  let registerTypes = (~sdlTypes: array<string>) => {
105
- typeDefinitions.contents = typeDefinitions.contents->Array.concat(sdlTypes)
108
+ sdlTypes->Array.forEach(t =>
109
+ if !(typeDefinitions.contents->Array.includes(t)) {
110
+ typeDefinitions.contents->Array.push(t)
111
+ }
112
+ )
106
113
  }
107
114
 
108
115
  let getMutationResolver = (fieldName: string): option<resolverFn> =>
@@ -161,12 +168,22 @@ ${mutations}
161
168
  lastFullSdl.contents = Some(sdl)
162
169
  let schema = YG.createSchema({"typeDefs": sdl, "resolvers": resolvers})
163
170
  activeSchema.contents = Some(schema)
171
+ // Route yoga's own logging into the framework logger. error/warn ALWAYS
172
+ // surface (so a masked resolver failure — which yoga reports via logger.error
173
+ // with the original Error even when the client response is masked — is never
174
+ // swallowed), while verbose debug/info stay gated on GRAPHQL_DEBUG.
175
+ let yogaLogging: YG.yogaLogger = {
176
+ debug: a => if debug { log.debug(~comp=label, YG.logArgToString(a)) },
177
+ info: a => if debug { log.info(~comp=label, YG.logArgToString(a)) },
178
+ warn: a => log.warn(~comp=label, YG.logArgToString(a)),
179
+ error: a => log.error(~comp=label, YG.logArgToString(a)),
180
+ }
164
181
  let yoga = switch contextFactory {
165
182
  | Some(ctx) =>
166
183
  YG.createYogaWithContext({
167
184
  "schema": schema,
168
185
  "graphiql": true,
169
- "logging": debug,
186
+ "logging": yogaLogging,
170
187
  "maskedErrors": !debug,
171
188
  "context": ctx,
172
189
  })
@@ -174,7 +191,7 @@ ${mutations}
174
191
  YG.createYoga({
175
192
  "schema": schema,
176
193
  "graphiql": true,
177
- "logging": debug,
194
+ "logging": yogaLogging,
178
195
  "maskedErrors": !debug,
179
196
  })
180
197
  }
@@ -2,7 +2,8 @@
2
2
 
3
3
  import * as Ws from "ws";
4
4
  import * as Http from "http";
5
- import * as GraphqlYoga from "graphql-yoga";
5
+ import * as GraphqlYoga from "@reventlessdev/rescript-graphql-yoga/src/GraphqlYoga.res.mjs";
6
+ import * as GraphqlYoga$1 from "graphql-yoga";
6
7
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
7
8
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
8
9
  import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
@@ -69,7 +70,12 @@ function make(labelOpt) {
69
70
  });
70
71
  };
71
72
  let registerTypes = sdlTypes => {
72
- typeDefinitions.contents = typeDefinitions.contents.concat(sdlTypes);
73
+ sdlTypes.forEach(t => {
74
+ if (!typeDefinitions.contents.includes(t)) {
75
+ typeDefinitions.contents.push(t);
76
+ return;
77
+ }
78
+ });
73
79
  };
74
80
  let getMutationResolver = fieldName => mutationResolvers.contents[fieldName];
75
81
  let getQueryResolver = fieldName => queryResolvers.contents[fieldName];
@@ -106,21 +112,39 @@ type Mutation {
106
112
  }
107
113
  let sdl = buildSdl();
108
114
  lastFullSdl.contents = sdl;
109
- let schema = GraphqlYoga.createSchema({
115
+ let schema = GraphqlYoga$1.createSchema({
110
116
  typeDefs: sdl,
111
117
  resolvers: resolvers
112
118
  });
113
119
  activeSchema.contents = Primitive_option.some(schema);
114
- let yoga = contextFactory !== undefined ? GraphqlYoga.createYoga({
120
+ let yogaLogging_debug = a => {
121
+ if (debug) {
122
+ return log.debug(label, undefined, GraphqlYoga.logArgToString(a));
123
+ }
124
+ };
125
+ let yogaLogging_info = a => {
126
+ if (debug) {
127
+ return log.info(label, undefined, GraphqlYoga.logArgToString(a));
128
+ }
129
+ };
130
+ let yogaLogging_warn = a => log.warn(label, undefined, GraphqlYoga.logArgToString(a));
131
+ let yogaLogging_error = a => log.error(label, undefined, GraphqlYoga.logArgToString(a));
132
+ let yogaLogging = {
133
+ debug: yogaLogging_debug,
134
+ info: yogaLogging_info,
135
+ warn: yogaLogging_warn,
136
+ error: yogaLogging_error
137
+ };
138
+ let yoga = contextFactory !== undefined ? GraphqlYoga$1.createYoga({
115
139
  schema: schema,
116
140
  graphiql: true,
117
- logging: debug,
141
+ logging: yogaLogging,
118
142
  maskedErrors: !debug,
119
143
  context: contextFactory
120
- }) : GraphqlYoga.createYoga({
144
+ }) : GraphqlYoga$1.createYoga({
121
145
  schema: schema,
122
146
  graphiql: true,
123
- logging: debug,
147
+ logging: yogaLogging,
124
148
  maskedErrors: !debug
125
149
  });
126
150
  let server = Http.createServer(yoga);