@apollo/client 4.2.5 → 4.2.6

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,5 +1,13 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 4.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#13315](https://github.com/apollographql/apollo-client/pull/13315) [`a406cc9`](https://github.com/apollographql/apollo-client/commit/a406cc9669246972a8f067462422aec716b6213b) Thanks [@fallintoplace](https://github.com/fallintoplace)! - Prevent relay multipart subscriptions from issuing a fetch request after serializing the request body fails.
8
+
9
+ - [#13307](https://github.com/apollographql/apollo-client/pull/13307) [`abd0781`](https://github.com/apollographql/apollo-client/commit/abd07814bbe80d9307458a450dd28addf1d38ef1) Thanks [@wolfie](https://github.com/wolfie)! - Speed up cache writes by avoiding a full AST `visit` of every written field to detect `@stream`. The check now runs only when the result carries stream info, and only inspects the field node's own directives. As a result, fields that merely contain `@stream` on a nested field are no longer treated as streamed themselves and now overwrite existing lists like regular fields instead of merging chunk-wise.
10
+
3
11
  ## 4.2.5
4
12
 
5
13
  ### Patch Changes
@@ -212,9 +212,9 @@ class StoreWriter {
212
212
  path,
213
213
  };
214
214
  }
215
- else if ((0, internal_1.hasDirectives)(["stream"], field) &&
215
+ else if (context.extensions?.[internal_1.streamInfoSymbol] &&
216
216
  Array.isArray(incomingValue) &&
217
- context.extensions?.[internal_1.streamInfoSymbol]) {
217
+ hasStreamDirective(field)) {
218
218
  childTree.info = {
219
219
  field,
220
220
  typename,
@@ -501,6 +501,10 @@ function mergeMergeTrees(left, right) {
501
501
  }
502
502
  return merged;
503
503
  }
504
+ function hasStreamDirective(field) {
505
+ return (!!field.directives &&
506
+ field.directives.some((directive) => directive.name.value === "stream"));
507
+ }
504
508
  function mergeTreeIsEmpty(tree) {
505
509
  return !tree || !(tree.info || tree.map.size);
506
510
  }