@reventlessdev/reventless-graphql-server 1.0.0-alpha.31 → 1.0.0-alpha.32

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.32 (2026-07-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **graphql:** keep a repeat mutation registration from duplicating SDL ([b54e844](https://github.com/ReventlessDev/reventless-core/commit/b54e8446236e16196a40a1a7df9f7ba84b03b167))
11
+
12
+
6
13
  # 1.0.0-alpha.31 (2026-07-27)
7
14
 
8
15
  **Note:** Version bump only for package @reventlessdev/reventless-graphql-server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-graphql-server",
3
- "version": "1.0.0-alpha.31",
3
+ "version": "1.0.0-alpha.32",
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": {
@@ -85,7 +85,16 @@ let make = (~label: string="GraphQL"): t => {
85
85
  let lastFullSdl: ref<option<string>> = ref(None)
86
86
 
87
87
  let registerMutations = (~sdlFields: array<string>, ~resolvers: dict<resolverFn>) => {
88
- mutationFields.contents = mutationFields.contents->Array.concat(sdlFields)
88
+ // A mutation field has two legitimate writers: the admin base fragment
89
+ // carries the Plugin aggregate's lifecycle fields, and the aggregate
90
+ // auto-flow registers the same fields when the admin is constructed again
91
+ // for a later deploy onto the same server. buildASTSchema rejects a schema
92
+ // that defines a field twice, so keep the first SDL definition and drop
93
+ // repeats by field name — mirroring the resolver dict, where a repeat
94
+ // registration overwrites by key (last resolver wins).
95
+ let existing = Set.fromArray(mutationFields.contents->Array.map(extractFieldName))
96
+ let fresh = sdlFields->Array.filter(f => !(existing->Set.has(extractFieldName(f))))
97
+ mutationFields.contents = mutationFields.contents->Array.concat(fresh)
89
98
  resolvers->Dict.toArray->Array.forEach(((k, v)) => mutationResolvers.contents->Dict.set(k, v))
90
99
  }
91
100
 
@@ -52,7 +52,9 @@ function make(labelOpt) {
52
52
  contents: undefined
53
53
  };
54
54
  let registerMutations = (sdlFields, resolvers) => {
55
- mutationFields.contents = mutationFields.contents.concat(sdlFields);
55
+ let existing = new Set(mutationFields.contents.map(extractFieldName));
56
+ let fresh = sdlFields.filter(f => !existing.has(extractFieldName(f)));
57
+ mutationFields.contents = mutationFields.contents.concat(fresh);
56
58
  Object.entries(resolvers).forEach(param => {
57
59
  mutationResolvers.contents[param[0]] = param[1];
58
60
  });