@isograph/react 0.4.1 → 0.4.2

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.
@@ -1,5 +1,5 @@
1
1
  ../.. |  WARN  Unsupported engine: wanted: {"node":"22.9.0"} (current: {"node":"v22.19.0","pnpm":"10.15.0"})
2
2
 
3
- > @isograph/react@0.4.1 compile-libs /home/runner/work/isograph/isograph/libs/isograph-react
3
+ > @isograph/react@0.4.2 compile-libs /home/runner/work/isograph/isograph/libs/isograph-react
4
4
  > rimraf dist && tsc -p tsconfig.pkg.json
5
5
 
@@ -101,16 +101,17 @@ function checkFromRecord(environment, normalizationAst, variables, record, recor
101
101
  }
102
102
  case 'InlineFragment': {
103
103
  const existingRecordTypename = record['__typename'];
104
- if (existingRecordTypename == null ||
105
- existingRecordTypename !== normalizationAstNode.type) {
104
+ if (existingRecordTypename == null) {
106
105
  return {
107
106
  kind: 'MissingData',
108
107
  record: recordLink,
109
108
  };
110
109
  }
111
- const result = checkFromRecord(environment, normalizationAstNode.selections, variables, record, recordLink);
112
- if (result.kind === 'MissingData') {
113
- return result;
110
+ if (existingRecordTypename === normalizationAstNode.type) {
111
+ const result = checkFromRecord(environment, normalizationAstNode.selections, variables, record, recordLink);
112
+ if (result.kind === 'MissingData') {
113
+ return result;
114
+ }
114
115
  }
115
116
  continue normalizationAstLoop;
116
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isograph/react",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Use Isograph with React",
5
5
  "homepage": "https://isograph.dev",
6
6
  "main": "dist/index.js",
package/src/core/check.ts CHANGED
@@ -172,26 +172,25 @@ function checkFromRecord(
172
172
  case 'InlineFragment': {
173
173
  const existingRecordTypename = record['__typename'];
174
174
 
175
- if (
176
- existingRecordTypename == null ||
177
- existingRecordTypename !== normalizationAstNode.type
178
- ) {
175
+ if (existingRecordTypename == null) {
179
176
  return {
180
177
  kind: 'MissingData',
181
178
  record: recordLink,
182
179
  };
183
180
  }
184
181
 
185
- const result = checkFromRecord(
186
- environment,
187
- normalizationAstNode.selections,
188
- variables,
189
- record,
190
- recordLink,
191
- );
192
-
193
- if (result.kind === 'MissingData') {
194
- return result;
182
+ if (existingRecordTypename === normalizationAstNode.type) {
183
+ const result = checkFromRecord(
184
+ environment,
185
+ normalizationAstNode.selections,
186
+ variables,
187
+ record,
188
+ recordLink,
189
+ );
190
+
191
+ if (result.kind === 'MissingData') {
192
+ return result;
193
+ }
195
194
  }
196
195
 
197
196
  continue normalizationAstLoop;