@reventlessdev/reventless-graphql-server 1.0.0-alpha.14 → 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,13 @@
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
+
6
13
  # 1.0.0-alpha.14 (2026-07-14)
7
14
 
8
15
  ### Features
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-graphql-server",
3
- "version": "1.0.0-alpha.14",
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.21",
8
- "@reventlessdev/reventless-core": "3.0.0-alpha.167"
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"
@@ -168,12 +168,22 @@ ${mutations}
168
168
  lastFullSdl.contents = Some(sdl)
169
169
  let schema = YG.createSchema({"typeDefs": sdl, "resolvers": resolvers})
170
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
+ }
171
181
  let yoga = switch contextFactory {
172
182
  | Some(ctx) =>
173
183
  YG.createYogaWithContext({
174
184
  "schema": schema,
175
185
  "graphiql": true,
176
- "logging": debug,
186
+ "logging": yogaLogging,
177
187
  "maskedErrors": !debug,
178
188
  "context": ctx,
179
189
  })
@@ -181,7 +191,7 @@ ${mutations}
181
191
  YG.createYoga({
182
192
  "schema": schema,
183
193
  "graphiql": true,
184
- "logging": debug,
194
+ "logging": yogaLogging,
185
195
  "maskedErrors": !debug,
186
196
  })
187
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";
@@ -111,21 +112,39 @@ type Mutation {
111
112
  }
112
113
  let sdl = buildSdl();
113
114
  lastFullSdl.contents = sdl;
114
- let schema = GraphqlYoga.createSchema({
115
+ let schema = GraphqlYoga$1.createSchema({
115
116
  typeDefs: sdl,
116
117
  resolvers: resolvers
117
118
  });
118
119
  activeSchema.contents = Primitive_option.some(schema);
119
- 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({
120
139
  schema: schema,
121
140
  graphiql: true,
122
- logging: debug,
141
+ logging: yogaLogging,
123
142
  maskedErrors: !debug,
124
143
  context: contextFactory
125
- }) : GraphqlYoga.createYoga({
144
+ }) : GraphqlYoga$1.createYoga({
126
145
  schema: schema,
127
146
  graphiql: true,
128
- logging: debug,
147
+ logging: yogaLogging,
129
148
  maskedErrors: !debug
130
149
  });
131
150
  let server = Http.createServer(yoga);