rescript-relay 1.0.0-beta.18 → 1.0.0-beta.19

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
@@ -1,6 +1,6 @@
1
1
  # master
2
2
 
3
- # 1.0.0-beta.18
3
+ # 1.0.0-beta.19
4
4
 
5
5
  _[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/5831c2f1f0f13eedc1cb60468c32fd32b2dc01d3)_
6
6
 
@@ -49,6 +49,10 @@ You can go ahead and remove these packages, that are no longer needed, as the co
49
49
 
50
50
  ### unreleased
51
51
 
52
+ ### beta.19
53
+
54
+ - Fix top level node interface issue.
55
+
52
56
  ### beta.18
53
57
 
54
58
  - Fix `useTransition` bindings, where `startTransition` broke after going to React 18. Kudos to [Emilios1995](https://github.com/Emilios1995) for researching and finding the issue!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rescript-relay",
3
- "version": "1.0.0-beta.18",
3
+ "version": "1.0.0-beta.19",
4
4
  "main": "src/RescriptRelay.res",
5
5
  "license": "MIT",
6
6
  "author": "Gabriel Nordeborn",
package/src/utils.js CHANGED
@@ -174,6 +174,9 @@ function traverse(
174
174
  }
175
175
 
176
176
  if (isTopLevelNodeField) {
177
+ // If this is a top level node field we should try and convert, ensure
178
+ // it conforms to the desired shape (has the correct typename). If not,
179
+ // null it and return right away.
177
180
  if (
178
181
  v == null ||
179
182
  !v.hasOwnProperty("__typename") ||
@@ -181,6 +184,7 @@ function traverse(
181
184
  ) {
182
185
  newObj = getNewObj(newObj, currentObj);
183
186
  newObj[key] = nullableValue;
187
+ return newObj;
184
188
  }
185
189
  }
186
190
 
package/src/utils.mjs CHANGED
@@ -174,6 +174,9 @@ function traverse(
174
174
  }
175
175
 
176
176
  if (isTopLevelNodeField) {
177
+ // If this is a top level node field we should try and convert, ensure
178
+ // it conforms to the desired shape (has the correct typename). If not,
179
+ // null it and return right away.
177
180
  if (
178
181
  v == null ||
179
182
  !v.hasOwnProperty("__typename") ||
@@ -181,6 +184,7 @@ function traverse(
181
184
  ) {
182
185
  newObj = getNewObj(newObj, currentObj);
183
186
  newObj[key] = nullableValue;
187
+ return newObj;
184
188
  }
185
189
  }
186
190