@apollo/client 4.0.0-alpha.14 → 4.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.
Files changed (98) hide show
  1. package/.changeset/beige-spiders-hope.md +5 -0
  2. package/.changeset/poor-spiders-hunt.md +23 -0
  3. package/.changeset/pre.json +7 -0
  4. package/.changeset/selfish-spoons-approve.md +44 -0
  5. package/.changeset/slimy-ants-bake.md +5 -0
  6. package/.changeset/sour-colts-tell.md +5 -0
  7. package/.changeset/sour-guests-poke.md +5 -0
  8. package/.changeset/strange-walls-march.md +5 -0
  9. package/CHANGELOG.md +79 -0
  10. package/__cjs/core/ObservableQuery.cjs +6 -0
  11. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  12. package/__cjs/react/hooks/useQuery.cjs +10 -25
  13. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  14. package/__cjs/react/hooks/useQuery.d.cts +0 -1
  15. package/__cjs/react/ssr/useSSRQuery.cjs +11 -2
  16. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
  17. package/__cjs/testing/core/mocking/mockLink.cjs +0 -6
  18. package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
  19. package/__cjs/testing/core/mocking/mockLink.d.cts +19 -20
  20. package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs +0 -4
  21. package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs.map +1 -1
  22. package/__cjs/testing/core/mocking/mockSubscriptionLink.d.cts +7 -6
  23. package/__cjs/testing/core/types/deprecated.cjs +3 -0
  24. package/__cjs/testing/core/types/deprecated.cjs.map +1 -0
  25. package/__cjs/testing/core/types/deprecated.d.cts +10 -0
  26. package/__cjs/testing/index.cjs +6 -13
  27. package/__cjs/testing/index.cjs.map +1 -1
  28. package/__cjs/testing/index.d.cts +3 -2
  29. package/__cjs/testing/internal/index.cjs +3 -1
  30. package/__cjs/testing/internal/index.cjs.map +1 -1
  31. package/__cjs/testing/internal/index.d.cts +1 -0
  32. package/__cjs/testing/internal/scenarios/index.cjs +4 -4
  33. package/__cjs/testing/internal/scenarios/index.cjs.map +1 -1
  34. package/__cjs/testing/internal/scenarios/index.d.cts +8 -8
  35. package/__cjs/testing/{core → internal}/wait.cjs +0 -4
  36. package/__cjs/testing/internal/wait.cjs.map +1 -0
  37. package/__cjs/testing/{core → internal}/wait.d.cts +0 -1
  38. package/__cjs/testing/react/MockedProvider.cjs +2 -2
  39. package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
  40. package/__cjs/testing/react/MockedProvider.d.cts +2 -3
  41. package/__cjs/version.cjs +1 -1
  42. package/core/ObservableQuery.js +6 -0
  43. package/core/ObservableQuery.js.map +1 -1
  44. package/package.json +1 -159
  45. package/react/hooks/useQuery.d.ts +0 -1
  46. package/react/hooks/useQuery.js +10 -25
  47. package/react/hooks/useQuery.js.map +1 -1
  48. package/react/ssr/useSSRQuery.js +11 -2
  49. package/react/ssr/useSSRQuery.js.map +1 -1
  50. package/testing/core/mocking/mockLink.d.ts +19 -20
  51. package/testing/core/mocking/mockLink.js +0 -5
  52. package/testing/core/mocking/mockLink.js.map +1 -1
  53. package/testing/core/mocking/mockSubscriptionLink.d.ts +7 -6
  54. package/testing/core/mocking/mockSubscriptionLink.js +0 -3
  55. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  56. package/testing/core/types/deprecated.d.ts +10 -0
  57. package/testing/core/types/deprecated.js +2 -0
  58. package/testing/core/types/deprecated.js.map +1 -0
  59. package/testing/index.d.ts +3 -2
  60. package/testing/index.js +2 -1
  61. package/testing/index.js.map +1 -1
  62. package/testing/internal/index.d.ts +1 -0
  63. package/testing/internal/index.js +2 -1
  64. package/testing/internal/index.js.map +1 -1
  65. package/testing/internal/scenarios/index.d.ts +8 -8
  66. package/testing/internal/scenarios/index.js +4 -4
  67. package/testing/internal/scenarios/index.js.map +1 -1
  68. package/testing/{core → internal}/wait.d.ts +0 -1
  69. package/testing/{core → internal}/wait.js +0 -3
  70. package/testing/internal/wait.js.map +1 -0
  71. package/testing/react/MockedProvider.d.ts +2 -3
  72. package/testing/react/MockedProvider.js +1 -1
  73. package/testing/react/MockedProvider.js.map +1 -1
  74. package/version.js +1 -1
  75. package/__cjs/testing/core/index.cjs +0 -20
  76. package/__cjs/testing/core/index.cjs.map +0 -1
  77. package/__cjs/testing/core/index.d.cts +0 -7
  78. package/__cjs/testing/core/mocking/mockClient.cjs +0 -17
  79. package/__cjs/testing/core/mocking/mockClient.cjs.map +0 -1
  80. package/__cjs/testing/core/mocking/mockClient.d.cts +0 -4
  81. package/__cjs/testing/core/wait.cjs.map +0 -1
  82. package/__cjs/testing/core/withConsoleSpy.cjs +0 -33
  83. package/__cjs/testing/core/withConsoleSpy.cjs.map +0 -1
  84. package/__cjs/testing/core/withConsoleSpy.d.cts +0 -7
  85. package/legacyEntryPoints/testing/core/core.cjs +0 -1
  86. package/legacyEntryPoints/testing/core/core.d.cts +0 -1
  87. package/legacyEntryPoints/testing/core/index.d.ts +0 -1
  88. package/legacyEntryPoints/testing/core/index.js +0 -1
  89. package/testing/core/index.d.ts +0 -7
  90. package/testing/core/index.js +0 -6
  91. package/testing/core/index.js.map +0 -1
  92. package/testing/core/mocking/mockClient.d.ts +0 -4
  93. package/testing/core/mocking/mockClient.js +0 -14
  94. package/testing/core/mocking/mockClient.js.map +0 -1
  95. package/testing/core/wait.js.map +0 -1
  96. package/testing/core/withConsoleSpy.d.ts +0 -7
  97. package/testing/core/withConsoleSpy.js +0 -28
  98. package/testing/core/withConsoleSpy.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo/client",
3
- "version": "4.0.0-alpha.14",
3
+ "version": "4.0.0-alpha.15",
4
4
  "description": "A fully-featured caching GraphQL client.",
5
5
  "private": false,
6
6
  "keywords": [
@@ -36,200 +36,120 @@
36
36
  "./*.d.ts": "./legacyEntryPoints/*.d.ts",
37
37
  "./*.d.cts": "./legacyEntryPoints/*.d.cts",
38
38
  ".": {
39
- "types": {
40
- "require": "./__cjs/core/index.d.cts",
41
- "import": "./core/index.d.ts"
42
- },
43
39
  "module": "./core/index.js",
44
40
  "module-sync": "./core/index.js",
45
41
  "require": "./__cjs/core/index.cjs",
46
42
  "default": "./core/index.js"
47
43
  },
48
44
  "./cache": {
49
- "types": {
50
- "require": "./__cjs/cache/index.d.cts",
51
- "import": "./cache/index.d.ts"
52
- },
53
45
  "module": "./cache/index.js",
54
46
  "module-sync": "./cache/index.js",
55
47
  "require": "./__cjs/cache/index.cjs",
56
48
  "default": "./cache/index.js"
57
49
  },
58
50
  "./core": {
59
- "types": {
60
- "require": "./__cjs/core/index.d.cts",
61
- "import": "./core/index.d.ts"
62
- },
63
51
  "module": "./core/index.js",
64
52
  "module-sync": "./core/index.js",
65
53
  "require": "./__cjs/core/index.cjs",
66
54
  "default": "./core/index.js"
67
55
  },
68
56
  "./dev": {
69
- "types": {
70
- "require": "./__cjs/dev/index.d.cts",
71
- "import": "./dev/index.d.ts"
72
- },
73
57
  "module": "./dev/index.js",
74
58
  "module-sync": "./dev/index.js",
75
59
  "require": "./__cjs/dev/index.cjs",
76
60
  "default": "./dev/index.js"
77
61
  },
78
62
  "./errors": {
79
- "types": {
80
- "require": "./__cjs/errors/index.d.cts",
81
- "import": "./errors/index.d.ts"
82
- },
83
63
  "module": "./errors/index.js",
84
64
  "module-sync": "./errors/index.js",
85
65
  "require": "./__cjs/errors/index.cjs",
86
66
  "default": "./errors/index.js"
87
67
  },
88
68
  "./link": {
89
- "types": {
90
- "require": "./__cjs/link/index.d.cts",
91
- "import": "./link/index.d.ts"
92
- },
93
69
  "module": "./link/index.js",
94
70
  "module-sync": "./link/index.js",
95
71
  "require": "./__cjs/link/index.cjs",
96
72
  "default": "./link/index.js"
97
73
  },
98
74
  "./link/batch": {
99
- "types": {
100
- "require": "./__cjs/link/batch/index.d.cts",
101
- "import": "./link/batch/index.d.ts"
102
- },
103
75
  "module": "./link/batch/index.js",
104
76
  "module-sync": "./link/batch/index.js",
105
77
  "require": "./__cjs/link/batch/index.cjs",
106
78
  "default": "./link/batch/index.js"
107
79
  },
108
80
  "./link/batch-http": {
109
- "types": {
110
- "require": "./__cjs/link/batch-http/index.d.cts",
111
- "import": "./link/batch-http/index.d.ts"
112
- },
113
81
  "module": "./link/batch-http/index.js",
114
82
  "module-sync": "./link/batch-http/index.js",
115
83
  "require": "./__cjs/link/batch-http/index.cjs",
116
84
  "default": "./link/batch-http/index.js"
117
85
  },
118
86
  "./link/context": {
119
- "types": {
120
- "require": "./__cjs/link/context/index.d.cts",
121
- "import": "./link/context/index.d.ts"
122
- },
123
87
  "module": "./link/context/index.js",
124
88
  "module-sync": "./link/context/index.js",
125
89
  "require": "./__cjs/link/context/index.cjs",
126
90
  "default": "./link/context/index.js"
127
91
  },
128
92
  "./link/error": {
129
- "types": {
130
- "require": "./__cjs/link/error/index.d.cts",
131
- "import": "./link/error/index.d.ts"
132
- },
133
93
  "module": "./link/error/index.js",
134
94
  "module-sync": "./link/error/index.js",
135
95
  "require": "./__cjs/link/error/index.cjs",
136
96
  "default": "./link/error/index.js"
137
97
  },
138
98
  "./link/http": {
139
- "types": {
140
- "require": "./__cjs/link/http/index.d.cts",
141
- "import": "./link/http/index.d.ts"
142
- },
143
99
  "module": "./link/http/index.js",
144
100
  "module-sync": "./link/http/index.js",
145
101
  "require": "./__cjs/link/http/index.cjs",
146
102
  "default": "./link/http/index.js"
147
103
  },
148
104
  "./link/persisted-queries": {
149
- "types": {
150
- "require": "./__cjs/link/persisted-queries/index.d.cts",
151
- "import": "./link/persisted-queries/index.d.ts"
152
- },
153
105
  "module": "./link/persisted-queries/index.js",
154
106
  "module-sync": "./link/persisted-queries/index.js",
155
107
  "require": "./__cjs/link/persisted-queries/index.cjs",
156
108
  "default": "./link/persisted-queries/index.js"
157
109
  },
158
110
  "./link/retry": {
159
- "types": {
160
- "require": "./__cjs/link/retry/index.d.cts",
161
- "import": "./link/retry/index.d.ts"
162
- },
163
111
  "module": "./link/retry/index.js",
164
112
  "module-sync": "./link/retry/index.js",
165
113
  "require": "./__cjs/link/retry/index.cjs",
166
114
  "default": "./link/retry/index.js"
167
115
  },
168
116
  "./link/remove-typename": {
169
- "types": {
170
- "require": "./__cjs/link/remove-typename/index.d.cts",
171
- "import": "./link/remove-typename/index.d.ts"
172
- },
173
117
  "module": "./link/remove-typename/index.js",
174
118
  "module-sync": "./link/remove-typename/index.js",
175
119
  "require": "./__cjs/link/remove-typename/index.cjs",
176
120
  "default": "./link/remove-typename/index.js"
177
121
  },
178
122
  "./link/schema": {
179
- "types": {
180
- "require": "./__cjs/link/schema/index.d.cts",
181
- "import": "./link/schema/index.d.ts"
182
- },
183
123
  "module": "./link/schema/index.js",
184
124
  "module-sync": "./link/schema/index.js",
185
125
  "require": "./__cjs/link/schema/index.cjs",
186
126
  "default": "./link/schema/index.js"
187
127
  },
188
128
  "./link/subscriptions": {
189
- "types": {
190
- "require": "./__cjs/link/subscriptions/index.d.cts",
191
- "import": "./link/subscriptions/index.d.ts"
192
- },
193
129
  "module": "./link/subscriptions/index.js",
194
130
  "module-sync": "./link/subscriptions/index.js",
195
131
  "require": "./__cjs/link/subscriptions/index.cjs",
196
132
  "default": "./link/subscriptions/index.js"
197
133
  },
198
134
  "./link/utils": {
199
- "types": {
200
- "require": "./__cjs/link/utils/index.d.cts",
201
- "import": "./link/utils/index.d.ts"
202
- },
203
135
  "module": "./link/utils/index.js",
204
136
  "module-sync": "./link/utils/index.js",
205
137
  "require": "./__cjs/link/utils/index.cjs",
206
138
  "default": "./link/utils/index.js"
207
139
  },
208
140
  "./link/ws": {
209
- "types": {
210
- "require": "./__cjs/link/ws/index.d.cts",
211
- "import": "./link/ws/index.d.ts"
212
- },
213
141
  "module": "./link/ws/index.js",
214
142
  "module-sync": "./link/ws/index.js",
215
143
  "require": "./__cjs/link/ws/index.cjs",
216
144
  "default": "./link/ws/index.js"
217
145
  },
218
146
  "./local-state": {
219
- "types": {
220
- "require": "./__cjs/local-state/index.d.cts",
221
- "import": "./local-state/index.d.ts"
222
- },
223
147
  "module": "./local-state/index.js",
224
148
  "module-sync": "./local-state/index.js",
225
149
  "require": "./__cjs/local-state/index.cjs",
226
150
  "default": "./local-state/index.js"
227
151
  },
228
152
  "./masking": {
229
- "types": {
230
- "require": "./__cjs/masking/index.d.cts",
231
- "import": "./masking/index.d.ts"
232
- },
233
153
  "module": "./masking/index.js",
234
154
  "module-sync": "./masking/index.js",
235
155
  "require": "./__cjs/masking/index.cjs",
@@ -237,20 +157,12 @@
237
157
  },
238
158
  "./react": {
239
159
  "react-server": {
240
- "types": {
241
- "require": "./__cjs/react/index.react-server.d.cts",
242
- "import": "./react/index.react-server.d.ts"
243
- },
244
160
  "module": "./react/index.react-server.js",
245
161
  "module-sync": "./react/index.react-server.js",
246
162
  "require": "./__cjs/react/index.react-server.cjs",
247
163
  "default": "./react/index.react-server.js"
248
164
  },
249
165
  "default": {
250
- "types": {
251
- "require": "./__cjs/react/index.d.cts",
252
- "import": "./react/index.d.ts"
253
- },
254
166
  "module": "./react/index.js",
255
167
  "module-sync": "./react/index.js",
256
168
  "require": "./__cjs/react/index.cjs",
@@ -258,70 +170,36 @@
258
170
  }
259
171
  },
260
172
  "./react/internal": {
261
- "types": {
262
- "require": "./__cjs/react/internal/index.d.cts",
263
- "import": "./react/internal/index.d.ts"
264
- },
265
173
  "module": "./react/internal/index.js",
266
174
  "module-sync": "./react/internal/index.js",
267
175
  "require": "./__cjs/react/internal/index.cjs",
268
176
  "default": "./react/internal/index.js"
269
177
  },
270
178
  "./react/ssr": {
271
- "types": {
272
- "require": "./__cjs/react/ssr/index.d.cts",
273
- "import": "./react/ssr/index.d.ts"
274
- },
275
179
  "module": "./react/ssr/index.js",
276
180
  "module-sync": "./react/ssr/index.js",
277
181
  "require": "./__cjs/react/ssr/index.cjs",
278
182
  "default": "./react/ssr/index.js"
279
183
  },
280
184
  "./testing": {
281
- "types": {
282
- "require": "./__cjs/testing/index.d.cts",
283
- "import": "./testing/index.d.ts"
284
- },
285
185
  "module": "./testing/index.js",
286
186
  "module-sync": "./testing/index.js",
287
187
  "require": "./__cjs/testing/index.cjs",
288
188
  "default": "./testing/index.js"
289
189
  },
290
- "./testing/core": {
291
- "types": {
292
- "require": "./__cjs/testing/core/index.d.cts",
293
- "import": "./testing/core/index.d.ts"
294
- },
295
- "module": "./testing/core/index.js",
296
- "module-sync": "./testing/core/index.js",
297
- "require": "./__cjs/testing/core/index.cjs",
298
- "default": "./testing/core/index.js"
299
- },
300
190
  "./testing/react": {
301
- "types": {
302
- "require": "./__cjs/testing/react/index.d.cts",
303
- "import": "./testing/react/index.d.ts"
304
- },
305
191
  "module": "./testing/react/index.js",
306
192
  "module-sync": "./testing/react/index.js",
307
193
  "require": "./__cjs/testing/react/index.cjs",
308
194
  "default": "./testing/react/index.js"
309
195
  },
310
196
  "./testing/internal": {
311
- "types": {
312
- "require": "./__cjs/testing/internal/index.d.cts",
313
- "import": "./testing/internal/index.d.ts"
314
- },
315
197
  "module": "./testing/internal/index.js",
316
198
  "module-sync": "./testing/internal/index.js",
317
199
  "require": "./__cjs/testing/internal/index.cjs",
318
200
  "default": "./testing/internal/index.js"
319
201
  },
320
202
  "./utilities": {
321
- "types": {
322
- "require": "./__cjs/utilities/index.d.cts",
323
- "import": "./utilities/index.d.ts"
324
- },
325
203
  "module": "./utilities/index.js",
326
204
  "module-sync": "./utilities/index.js",
327
205
  "require": "./__cjs/utilities/index.cjs",
@@ -329,20 +207,12 @@
329
207
  },
330
208
  "./utilities/internal": {
331
209
  "production": {
332
- "types": {
333
- "require": "./__cjs/utilities/internal/index.production.d.cts",
334
- "import": "./utilities/internal/index.production.d.ts"
335
- },
336
210
  "module": "./utilities/internal/index.production.js",
337
211
  "module-sync": "./utilities/internal/index.production.js",
338
212
  "require": "./__cjs/utilities/internal/index.production.cjs",
339
213
  "default": "./utilities/internal/index.production.js"
340
214
  },
341
215
  "default": {
342
- "types": {
343
- "require": "./__cjs/utilities/internal/index.d.cts",
344
- "import": "./utilities/internal/index.d.ts"
345
- },
346
216
  "module": "./utilities/internal/index.js",
347
217
  "module-sync": "./utilities/internal/index.js",
348
218
  "require": "./__cjs/utilities/internal/index.cjs",
@@ -350,20 +220,12 @@
350
220
  }
351
221
  },
352
222
  "./utilities/internal/globals": {
353
- "types": {
354
- "require": "./__cjs/utilities/internal/globals/index.d.cts",
355
- "import": "./utilities/internal/globals/index.d.ts"
356
- },
357
223
  "module": "./utilities/internal/globals/index.js",
358
224
  "module-sync": "./utilities/internal/globals/index.js",
359
225
  "require": "./__cjs/utilities/internal/globals/index.cjs",
360
226
  "default": "./utilities/internal/globals/index.js"
361
227
  },
362
228
  "./utilities/subscriptions/relay": {
363
- "types": {
364
- "require": "./__cjs/utilities/subscriptions/relay/index.d.cts",
365
- "import": "./utilities/subscriptions/relay/index.d.ts"
366
- },
367
229
  "module": "./utilities/subscriptions/relay/index.js",
368
230
  "module-sync": "./utilities/subscriptions/relay/index.js",
369
231
  "require": "./__cjs/utilities/subscriptions/relay/index.cjs",
@@ -371,20 +233,12 @@
371
233
  },
372
234
  "./utilities/invariant": {
373
235
  "development": {
374
- "types": {
375
- "require": "./__cjs/utilities/invariant/index.development.d.cts",
376
- "import": "./utilities/invariant/index.development.d.ts"
377
- },
378
236
  "module": "./utilities/invariant/index.development.js",
379
237
  "module-sync": "./utilities/invariant/index.development.js",
380
238
  "require": "./__cjs/utilities/invariant/index.development.cjs",
381
239
  "default": "./utilities/invariant/index.development.js"
382
240
  },
383
241
  "default": {
384
- "types": {
385
- "require": "./__cjs/utilities/invariant/index.d.cts",
386
- "import": "./utilities/invariant/index.d.ts"
387
- },
388
242
  "module": "./utilities/invariant/index.js",
389
243
  "module-sync": "./utilities/invariant/index.js",
390
244
  "require": "./__cjs/utilities/invariant/index.cjs",
@@ -393,30 +247,18 @@
393
247
  },
394
248
  "./utilities/environment": {
395
249
  "production": {
396
- "types": {
397
- "require": "./__cjs/utilities/environment/index.production.d.cts",
398
- "import": "./utilities/environment/index.production.d.ts"
399
- },
400
250
  "module": "./utilities/environment/index.production.js",
401
251
  "module-sync": "./utilities/environment/index.production.js",
402
252
  "require": "./__cjs/utilities/environment/index.production.cjs",
403
253
  "default": "./utilities/environment/index.production.js"
404
254
  },
405
255
  "development": {
406
- "types": {
407
- "require": "./__cjs/utilities/environment/index.development.d.cts",
408
- "import": "./utilities/environment/index.development.d.ts"
409
- },
410
256
  "module": "./utilities/environment/index.development.js",
411
257
  "module-sync": "./utilities/environment/index.development.js",
412
258
  "require": "./__cjs/utilities/environment/index.development.cjs",
413
259
  "default": "./utilities/environment/index.development.js"
414
260
  },
415
261
  "default": {
416
- "types": {
417
- "require": "./__cjs/utilities/environment/index.d.cts",
418
- "import": "./utilities/environment/index.d.ts"
419
- },
420
262
  "module": "./utilities/environment/index.js",
421
263
  "module-sync": "./utilities/environment/index.js",
422
264
  "require": "./__cjs/utilities/environment/index.cjs",
@@ -304,6 +304,5 @@ export declare function useQuery<TData = unknown, TVariables extends OperationVa
304
304
  ] : [options: useQuery.Options<NoInfer<TData>, NoInfer<TVariables>>]): useQuery.Result<TData, TVariables>;
305
305
  export declare namespace useQuery {
306
306
  var ssrDisabledResult: ApolloQueryResult<any>;
307
- var skipStandbyResult: ApolloQueryResult<any>;
308
307
  }
309
308
  //# sourceMappingURL=useQuery.d.ts.map
@@ -101,20 +101,7 @@ function useQuery_(query, options = {}) {
101
101
  useResubscribeIfNecessary(resultData, // might get mutated during render
102
102
  observable, // might get mutated during render
103
103
  watchQueryOptions);
104
- const ssrDisabledOverride = useSyncExternalStore(() => () => { }, () => void 0, () => (ssr === false ? useQuery.ssrDisabledResult : void 0));
105
- const resultOverride = skip || watchQueryOptions.fetchPolicy === "standby" ?
106
- // When skipping a query (ie. we're not querying for data but still want to
107
- // render children), make sure the `data` is cleared out and `loading` is
108
- // set to `false` (since we aren't loading anything).
109
- //
110
- // NOTE: We no longer think this is the correct behavior. Skipping should
111
- // not automatically set `data` to `undefined`, but instead leave the
112
- // previous data in place. In other words, skipping should not mandate that
113
- // previously received data is all of a sudden removed. Unfortunately,
114
- // changing this is breaking, so we'll have to wait until Apollo Client 4.0
115
- // to address this.
116
- useQuery.skipStandbyResult
117
- : ssrDisabledOverride;
104
+ const resultOverride = useSyncExternalStore(() => () => { }, () => void 0, () => (ssr === false ? useQuery.ssrDisabledResult : void 0));
118
105
  const result = useResultSubscription(observable, resultData, resultOverride);
119
106
  const obsQueryFields = React.useMemo(() => ({
120
107
  refetch: observable.refetch.bind(observable),
@@ -167,7 +154,9 @@ function useResultSubscription(observable, resultData, resultOverride) {
167
154
  equal(previousResult.error, result.error)) {
168
155
  return;
169
156
  }
170
- if (previousResult && previousResult.data) {
157
+ if (previousResult &&
158
+ previousResult.data &&
159
+ !equal(previousResult.data, result.data)) {
171
160
  // eslint-disable-next-line react-compiler/react-compiler
172
161
  resultData.previousData = previousResult.data;
173
162
  }
@@ -205,9 +194,12 @@ observable, watchQueryOptions) {
205
194
  // Make sure getCurrentResult returns a fresh ApolloQueryResult<TData>,
206
195
  // but save the current data as this.previousData, just like setResult
207
196
  // usually does.
208
- resultData.previousData =
209
- resultData.current.data || resultData.previousData;
210
- resultData.current = observable.getCurrentResult();
197
+ const result = observable.getCurrentResult();
198
+ if (!equal(result.data, resultData.current.data)) {
199
+ resultData.previousData =
200
+ resultData.current.data || resultData.previousData;
201
+ }
202
+ resultData.current = result;
211
203
  }
212
204
  observable[lastWatchOptions] = watchQueryOptions;
213
205
  }
@@ -218,11 +210,4 @@ useQuery.ssrDisabledResult = maybeDeepFreeze({
218
210
  networkStatus: NetworkStatus.loading,
219
211
  partial: true,
220
212
  });
221
- useQuery.skipStandbyResult = maybeDeepFreeze({
222
- loading: false,
223
- data: void 0,
224
- error: void 0,
225
- networkStatus: NetworkStatus.ready,
226
- partial: true,
227
- });
228
213
  //# sourceMappingURL=useQuery.js.map