@apollo/client 4.0.0-alpha.4 → 4.0.0-alpha.5

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 (168) hide show
  1. package/.changeset/eleven-kangaroos-jump.md +5 -0
  2. package/.changeset/forty-shrimps-fry.md +5 -0
  3. package/.changeset/grumpy-vans-type.md +5 -0
  4. package/.changeset/little-spoons-kick.md +7 -0
  5. package/.changeset/loud-cows-raise.md +7 -0
  6. package/.changeset/many-buses-allow.md +5 -0
  7. package/.changeset/poor-eels-punch.md +5 -0
  8. package/.changeset/pre.json +13 -0
  9. package/.changeset/real-teachers-peel.md +5 -0
  10. package/.changeset/slimy-chicken-melt.md +5 -0
  11. package/.changeset/thick-books-grin.md +5 -0
  12. package/.changeset/tough-rockets-allow.md +5 -0
  13. package/.changeset/tricky-tables-shave.md +5 -0
  14. package/.changeset/warm-ties-sit.md +7 -0
  15. package/CHANGELOG.md +40 -0
  16. package/__cjs/cache/core/cache.cjs +1 -1
  17. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  18. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  19. package/__cjs/cache/inmemory/policies.cjs +4 -4
  20. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  21. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  22. package/__cjs/core/ApolloClient.cjs +3 -3
  23. package/__cjs/core/ApolloClient.cjs.map +1 -1
  24. package/__cjs/core/ApolloClient.d.cts +4 -4
  25. package/__cjs/core/LocalState.cjs +2 -2
  26. package/__cjs/core/ObservableQuery.cjs +15 -12
  27. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  28. package/__cjs/core/QueryManager.cjs +57 -35
  29. package/__cjs/core/QueryManager.cjs.map +1 -1
  30. package/__cjs/core/QueryManager.d.cts +3 -3
  31. package/__cjs/core/types.d.cts +32 -0
  32. package/__cjs/invariantErrorCodes.cjs +57 -77
  33. package/__cjs/link/core/ApolloLink.cjs +2 -2
  34. package/__cjs/link/http/checkFetcher.cjs +1 -1
  35. package/__cjs/link/http/createHttpLink.cjs +1 -1
  36. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  37. package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
  38. package/__cjs/link/persisted-queries/index.cjs +2 -2
  39. package/__cjs/link/utils/validateOperation.cjs +1 -1
  40. package/__cjs/masking/maskDefinition.cjs +2 -2
  41. package/__cjs/masking/maskFragment.cjs +2 -2
  42. package/__cjs/masking/maskOperation.cjs +1 -1
  43. package/__cjs/masking/utils.cjs +1 -1
  44. package/__cjs/react/context/ApolloConsumer.cjs +1 -1
  45. package/__cjs/react/context/ApolloContext.cjs +1 -1
  46. package/__cjs/react/context/ApolloContext.cjs.map +1 -1
  47. package/__cjs/react/context/ApolloContext.d.cts +2 -2
  48. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  49. package/__cjs/react/hooks/internal/wrapHook.cjs +26 -5
  50. package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
  51. package/__cjs/react/hooks/internal/wrapHook.d.cts +3 -1
  52. package/__cjs/react/hooks/useMutation.cjs +14 -19
  53. package/__cjs/react/hooks/useMutation.cjs.map +1 -1
  54. package/__cjs/react/hooks/useMutation.d.cts +4 -4
  55. package/__cjs/react/hooks/useQuery.cjs +82 -187
  56. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  57. package/__cjs/react/hooks/useQuery.d.cts +4 -0
  58. package/__cjs/react/hooks/useSubscription.cjs +8 -57
  59. package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
  60. package/__cjs/react/hooks/useSubscription.d.cts +6 -42
  61. package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -2
  62. package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
  63. package/__cjs/react/internal/index.cjs +3 -1
  64. package/__cjs/react/internal/index.cjs.map +1 -1
  65. package/__cjs/react/internal/index.d.cts +1 -0
  66. package/__cjs/react/ssr/getDataFromTree.cjs +43 -12
  67. package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
  68. package/__cjs/react/ssr/getDataFromTree.d.cts +5 -0
  69. package/__cjs/react/ssr/index.cjs +1 -3
  70. package/__cjs/react/ssr/index.cjs.map +1 -1
  71. package/__cjs/react/ssr/index.d.cts +0 -1
  72. package/__cjs/react/ssr/useSSRQuery.cjs +60 -0
  73. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -0
  74. package/__cjs/react/ssr/useSSRQuery.d.cts +5 -0
  75. package/__cjs/react/types/deprecated.d.cts +1 -1
  76. package/__cjs/react/types/types.documentation.d.cts +4 -12
  77. package/__cjs/testing/matchers/index.cjs +2 -0
  78. package/__cjs/testing/matchers/index.cjs.map +1 -1
  79. package/__cjs/testing/matchers/toEmitStrictTyped.cjs +42 -0
  80. package/__cjs/testing/matchers/toEmitStrictTyped.cjs.map +1 -0
  81. package/__cjs/testing/matchers/toEmitStrictTyped.d.cts +7 -0
  82. package/__cjs/testing/matchers/toEqualStrictTyped.cjs +2 -20
  83. package/__cjs/testing/matchers/toEqualStrictTyped.cjs.map +1 -1
  84. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs +23 -0
  85. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs.map +1 -0
  86. package/__cjs/testing/matchers/utils/getSerializableProperties.d.cts +2 -0
  87. package/__cjs/version.cjs +1 -1
  88. package/__cjs/version.d.cts +1 -1
  89. package/cache/core/cache.js +1 -1
  90. package/cache/inmemory/entityStore.js +3 -3
  91. package/cache/inmemory/key-extractor.js +1 -1
  92. package/cache/inmemory/policies.js +4 -4
  93. package/cache/inmemory/readFromStore.js +2 -2
  94. package/cache/inmemory/writeToStore.js +4 -4
  95. package/core/ApolloClient.d.ts +4 -4
  96. package/core/ApolloClient.js +3 -3
  97. package/core/ApolloClient.js.map +1 -1
  98. package/core/LocalState.js +2 -2
  99. package/core/ObservableQuery.js +15 -12
  100. package/core/ObservableQuery.js.map +1 -1
  101. package/core/QueryManager.d.ts +3 -3
  102. package/core/QueryManager.js +58 -36
  103. package/core/QueryManager.js.map +1 -1
  104. package/core/types.d.ts +32 -0
  105. package/invariantErrorCodes.js +57 -77
  106. package/link/core/ApolloLink.js +2 -2
  107. package/link/http/checkFetcher.js +1 -1
  108. package/link/http/createHttpLink.js +1 -1
  109. package/link/http/parseAndCheckHttpResponse.js +1 -1
  110. package/link/http/serializeFetchParameter.js +1 -1
  111. package/link/persisted-queries/index.js +2 -2
  112. package/link/utils/validateOperation.js +1 -1
  113. package/masking/maskDefinition.js +2 -2
  114. package/masking/maskFragment.js +2 -2
  115. package/masking/maskOperation.js +1 -1
  116. package/masking/utils.js +1 -1
  117. package/package.json +1 -1
  118. package/react/context/ApolloConsumer.js +1 -1
  119. package/react/context/ApolloContext.d.ts +2 -2
  120. package/react/context/ApolloContext.js +1 -1
  121. package/react/context/ApolloContext.js.map +1 -1
  122. package/react/context/ApolloProvider.js +1 -1
  123. package/react/hooks/internal/wrapHook.d.ts +3 -1
  124. package/react/hooks/internal/wrapHook.js +24 -5
  125. package/react/hooks/internal/wrapHook.js.map +1 -1
  126. package/react/hooks/useMutation.d.ts +4 -4
  127. package/react/hooks/useMutation.js +14 -19
  128. package/react/hooks/useMutation.js.map +1 -1
  129. package/react/hooks/useQuery.d.ts +4 -0
  130. package/react/hooks/useQuery.js +83 -188
  131. package/react/hooks/useQuery.js.map +1 -1
  132. package/react/hooks/useSubscription.d.ts +6 -42
  133. package/react/hooks/useSubscription.js +7 -53
  134. package/react/hooks/useSubscription.js.map +1 -1
  135. package/react/hooks/useSuspenseQuery.js +2 -2
  136. package/react/hooks/useSyncExternalStore.js +1 -1
  137. package/react/internal/index.d.ts +1 -0
  138. package/react/internal/index.js +2 -1
  139. package/react/internal/index.js.map +1 -1
  140. package/react/ssr/getDataFromTree.d.ts +5 -0
  141. package/react/ssr/getDataFromTree.js +43 -12
  142. package/react/ssr/getDataFromTree.js.map +1 -1
  143. package/react/ssr/index.d.ts +0 -1
  144. package/react/ssr/index.js +0 -1
  145. package/react/ssr/index.js.map +1 -1
  146. package/react/ssr/useSSRQuery.d.ts +5 -0
  147. package/react/ssr/useSSRQuery.js +56 -0
  148. package/react/ssr/useSSRQuery.js.map +1 -0
  149. package/react/types/deprecated.d.ts +1 -1
  150. package/react/types/types.documentation.d.ts +4 -12
  151. package/testing/matchers/index.js +2 -0
  152. package/testing/matchers/index.js.map +1 -1
  153. package/testing/matchers/toEmitStrictTyped.d.ts +7 -0
  154. package/testing/matchers/toEmitStrictTyped.js +38 -0
  155. package/testing/matchers/toEmitStrictTyped.js.map +1 -0
  156. package/testing/matchers/toEqualStrictTyped.js +1 -19
  157. package/testing/matchers/toEqualStrictTyped.js.map +1 -1
  158. package/testing/matchers/utils/getSerializableProperties.d.ts +2 -0
  159. package/testing/matchers/utils/getSerializableProperties.js +20 -0
  160. package/testing/matchers/utils/getSerializableProperties.js.map +1 -0
  161. package/version.d.ts +1 -1
  162. package/version.js +1 -1
  163. package/__cjs/react/ssr/RenderPromises.cjs +0 -104
  164. package/__cjs/react/ssr/RenderPromises.cjs.map +0 -1
  165. package/__cjs/react/ssr/RenderPromises.d.cts +0 -25
  166. package/react/ssr/RenderPromises.d.ts +0 -25
  167. package/react/ssr/RenderPromises.js +0 -100
  168. package/react/ssr/RenderPromises.js.map +0 -1
@@ -9,7 +9,7 @@ import type { DefaultOptions } from "./ApolloClient.js";
9
9
  import type { LocalState } from "./LocalState.js";
10
10
  import { NetworkStatus } from "./networkStatus.js";
11
11
  import { ObservableQuery } from "./ObservableQuery.js";
12
- import type { ApolloQueryResult, DefaultContext, InternalRefetchQueriesInclude, InternalRefetchQueriesMap, InternalRefetchQueriesOptions, MutationUpdaterFunction, OnQueryUpdated, OperationVariables } from "./types.js";
12
+ import type { ApolloQueryResult, DefaultContext, InternalRefetchQueriesInclude, InternalRefetchQueriesMap, InternalRefetchQueriesOptions, MutateResult, MutationUpdaterFunction, OnQueryUpdated, OperationVariables, SubscribeResult } from "./types.js";
13
13
  import type { ErrorPolicy, MutationFetchPolicy, MutationOptions, QueryOptions, SubscriptionOptions, WatchQueryFetchPolicy, WatchQueryOptions } from "./watchQueryOptions.js";
14
14
  interface MutationStoreValue {
15
15
  mutation: DocumentNode;
@@ -89,7 +89,7 @@ export declare class QueryManager {
89
89
  */
90
90
  stop(): void;
91
91
  private cancelPendingFetches;
92
- mutate<TData, TVariables extends OperationVariables, TContext extends Record<string, any>, TCache extends ApolloCache>({ mutation, variables, optimisticResponse, updateQueries, refetchQueries, awaitRefetchQueries, update: updateWithProxyFn, onQueryUpdated, fetchPolicy, errorPolicy, keepRootFields, context, }: MutationOptions<TData, TVariables, TContext>): Promise<FetchResult<MaybeMasked<TData>>>;
92
+ mutate<TData, TVariables extends OperationVariables, TContext extends Record<string, any>, TCache extends ApolloCache>({ mutation, variables, optimisticResponse, updateQueries, refetchQueries, awaitRefetchQueries, update: updateWithProxyFn, onQueryUpdated, fetchPolicy, errorPolicy, keepRootFields, context, }: MutationOptions<TData, TVariables, TContext>): Promise<MutateResult<MaybeMasked<TData>>>;
93
93
  markMutationResult<TData, TVariables extends OperationVariables, TContext, TCache extends ApolloCache>(mutation: {
94
94
  mutationId: string;
95
95
  result: FetchResult<TData>;
@@ -134,7 +134,7 @@ export declare class QueryManager {
134
134
  getObservableQueries(include?: InternalRefetchQueriesInclude): Map<string, ObservableQuery<any, OperationVariables>>;
135
135
  reFetchObservableQueries(includeStandby?: boolean): Promise<ApolloQueryResult<any>[]>;
136
136
  setObservableQuery(observableQuery: ObservableQuery<any, any>): void;
137
- startGraphQLSubscription<TData = unknown>(options: SubscriptionOptions): Observable<FetchResult<TData>>;
137
+ startGraphQLSubscription<TData = unknown>(options: SubscriptionOptions): Observable<SubscribeResult<TData>>;
138
138
  stopQuery(queryId: string): void;
139
139
  removeQuery(queryId: string): void;
140
140
  broadcastQueries(): void;
@@ -1,5 +1,5 @@
1
1
  import { Trie } from "@wry/trie";
2
- import { catchError, concat, EMPTY, from, lastValueFrom, map, mergeMap, mergeWith, Observable, of, share, shareReplay, Subject, tap, } from "rxjs";
2
+ import { catchError, concat, EMPTY, filter, from, lastValueFrom, map, mergeMap, mergeWith, Observable, of, share, shareReplay, Subject, tap, } from "rxjs";
3
3
  import { canonicalStringify } from "@apollo/client/cache";
4
4
  import { CombinedGraphQLErrors, graphQLResultHasProtocolErrors, UnconventionalError, } from "@apollo/client/errors";
5
5
  import { PROTOCOL_ERRORS_SYMBOL } from "@apollo/client/errors";
@@ -88,15 +88,15 @@ export class QueryManager {
88
88
  this.queries.forEach((_info, queryId) => {
89
89
  this.removeQuery(queryId);
90
90
  });
91
- this.cancelPendingFetches(newInvariantError(72));
91
+ this.cancelPendingFetches(newInvariantError(68));
92
92
  }
93
93
  cancelPendingFetches(error) {
94
94
  this.fetchCancelFns.forEach((cancel) => cancel(error));
95
95
  this.fetchCancelFns.clear();
96
96
  }
97
97
  async mutate({ mutation, variables, optimisticResponse, updateQueries, refetchQueries = [], awaitRefetchQueries = false, update: updateWithProxyFn, onQueryUpdated, fetchPolicy = this.defaultOptions.mutate?.fetchPolicy || "network-only", errorPolicy = this.defaultOptions.mutate?.errorPolicy || "none", keepRootFields, context, }) {
98
- invariant(mutation, 73);
99
- invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 74);
98
+ invariant(mutation, 69);
99
+ invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 70);
100
100
  const mutationId = this.generateMutationId();
101
101
  mutation = this.cache.transformForLink(this.transform(mutation));
102
102
  const { hasClientExports } = this.getDocumentInfo(mutation);
@@ -130,7 +130,8 @@ export class QueryManager {
130
130
  optimisticResponse: isOptimistic ? optimisticResponse : void 0,
131
131
  }, variables, {}, false)
132
132
  .pipe(mergeMap((result) => {
133
- if (graphQLResultHasError(result) && errorPolicy === "none") {
133
+ const hasErrors = graphQLResultHasError(result);
134
+ if (hasErrors && errorPolicy === "none") {
134
135
  throw new CombinedGraphQLErrors(getGraphQLErrorsFromResult(result));
135
136
  }
136
137
  if (mutationStoreValue) {
@@ -141,8 +142,7 @@ export class QueryManager {
141
142
  if (typeof refetchQueries === "function") {
142
143
  refetchQueries = refetchQueries(storeResult);
143
144
  }
144
- if (errorPolicy === "ignore" &&
145
- graphQLResultHasError(storeResult)) {
145
+ if (errorPolicy === "ignore" && hasErrors) {
146
146
  delete storeResult.errors;
147
147
  }
148
148
  return from(this.markMutationResult({
@@ -171,28 +171,40 @@ export class QueryManager {
171
171
  // ExecutionPatchResult has arrived and we have assembled the
172
172
  // multipart response into a single result.
173
173
  if (!("hasNext" in storeResult) || storeResult.hasNext === false) {
174
- resolve({
175
- ...storeResult,
174
+ const result = {
176
175
  data: this.maskOperation({
177
176
  document: mutation,
178
177
  data: storeResult.data,
179
178
  fetchPolicy,
180
179
  id: mutationId,
181
180
  }),
182
- });
181
+ };
182
+ if (graphQLResultHasError(storeResult)) {
183
+ result.error = new CombinedGraphQLErrors(getGraphQLErrorsFromResult(storeResult));
184
+ }
185
+ if (storeResult.extensions) {
186
+ result.extensions = storeResult.extensions;
187
+ }
188
+ resolve(result);
183
189
  }
184
190
  },
185
191
  error: (err) => {
186
- err = maybeWrapError(err);
192
+ const error = maybeWrapError(err);
187
193
  if (mutationStoreValue) {
188
194
  mutationStoreValue.loading = false;
189
- mutationStoreValue.error = err;
195
+ mutationStoreValue.error = error;
190
196
  }
191
197
  if (isOptimistic) {
192
198
  this.cache.removeOptimistic(mutationId);
193
199
  }
194
200
  this.broadcastQueries();
195
- reject(err);
201
+ if (errorPolicy === "ignore") {
202
+ return resolve({ data: undefined });
203
+ }
204
+ if (errorPolicy === "all") {
205
+ return resolve({ data: undefined, error });
206
+ }
207
+ reject(error);
196
208
  },
197
209
  });
198
210
  });
@@ -465,10 +477,10 @@ export class QueryManager {
465
477
  // TODO: catch `EmptyError` and rethrow as network error if `complete`
466
478
  // notification is emitted without a value.
467
479
  query(options, queryId = this.generateQueryId()) {
468
- invariant(options.query, 75);
469
- invariant(options.query.kind === "Document", 76);
470
- invariant(!options.returnPartialData, 77);
471
- invariant(!options.pollInterval, 78);
480
+ invariant(options.query, 71);
481
+ invariant(options.query.kind === "Document", 72);
482
+ invariant(!options.returnPartialData, 73);
483
+ invariant(!options.pollInterval, 74);
472
484
  const query = this.transform(options.query);
473
485
  return this.fetchQuery(queryId, { ...options, query })
474
486
  .then((result) => result && {
@@ -502,7 +514,7 @@ export class QueryManager {
502
514
  // depend on values that previously existed in the data portion of the
503
515
  // store. So, we cancel the promises and observers that we have issued
504
516
  // so far and not yet resolved (in the case of queries).
505
- this.cancelPendingFetches(newInvariantError(79));
517
+ this.cancelPendingFetches(newInvariantError(75));
506
518
  this.queries.forEach((queryInfo) => {
507
519
  if (queryInfo.observableQuery) {
508
520
  // Set loading to true so listeners don't trigger unless they want
@@ -590,10 +602,10 @@ export class QueryManager {
590
602
  if (!included) {
591
603
  const queryName = queryNames.get(nameOrQueryString);
592
604
  if (queryName) {
593
- __DEV__ && invariant.warn(80, queryName);
605
+ __DEV__ && invariant.warn(76, queryName);
594
606
  }
595
607
  else {
596
- __DEV__ && invariant.warn(81);
608
+ __DEV__ && invariant.warn(77);
597
609
  }
598
610
  }
599
611
  });
@@ -622,38 +634,48 @@ export class QueryManager {
622
634
  const { fetchPolicy, errorPolicy = "none", context = {}, extensions = {}, } = options;
623
635
  query = this.transform(query);
624
636
  variables = this.getVariables(query, variables);
625
- const makeObservable = (variables) => this.getObservableFromLink(query, context, variables, extensions).pipe(map((result) => {
637
+ const makeObservable = (variables) => this.getObservableFromLink(query, context, variables, extensions).pipe(map((rawResult) => {
626
638
  if (fetchPolicy !== "no-cache") {
627
639
  // the subscription interface should handle not sending us results we no longer subscribe to.
628
640
  // XXX I don't think we ever send in an object with errors, but we might in the future...
629
- if (shouldWriteResult(result, errorPolicy)) {
641
+ if (shouldWriteResult(rawResult, errorPolicy)) {
630
642
  this.cache.write({
631
643
  query,
632
- result: result.data,
644
+ result: rawResult.data,
633
645
  dataId: "ROOT_SUBSCRIPTION",
634
646
  variables: variables,
635
647
  });
636
648
  }
637
649
  this.broadcastQueries();
638
650
  }
639
- const hasErrors = graphQLResultHasError(result);
640
- const hasProtocolErrors = graphQLResultHasProtocolErrors(result);
641
- if (hasErrors && errorPolicy === "none") {
642
- throw new CombinedGraphQLErrors(result.errors);
651
+ const result = {
652
+ data: rawResult.data ?? undefined,
653
+ };
654
+ if (graphQLResultHasError(rawResult)) {
655
+ result.error = new CombinedGraphQLErrors(rawResult.errors);
656
+ }
657
+ else if (graphQLResultHasProtocolErrors(rawResult)) {
658
+ result.error = rawResult.extensions[PROTOCOL_ERRORS_SYMBOL];
659
+ // Don't emit protocol errors added by HttpLink
660
+ delete rawResult.extensions[PROTOCOL_ERRORS_SYMBOL];
661
+ }
662
+ if (rawResult.extensions &&
663
+ Object.keys(rawResult.extensions).length) {
664
+ result.extensions = rawResult.extensions;
643
665
  }
644
- if (hasProtocolErrors) {
645
- // `errorPolicy` is a mechanism for handling GraphQL errors, according
646
- // to our documentation, so we throw protocol errors regardless of the
647
- // set error policy.
648
- throw result.extensions[PROTOCOL_ERRORS_SYMBOL];
666
+ if (result.error && errorPolicy === "none") {
667
+ result.data = undefined;
649
668
  }
650
669
  if (errorPolicy === "ignore") {
651
- delete result.errors;
670
+ delete result.error;
652
671
  }
653
672
  return result;
654
673
  }), catchError((error) => {
655
- throw maybeWrapError(error);
656
- }));
674
+ if (errorPolicy === "ignore") {
675
+ return of({ data: undefined });
676
+ }
677
+ return of({ data: undefined, error: maybeWrapError(error) });
678
+ }), filter((result) => !!(result.data || result.error)));
657
679
  if (this.getDocumentInfo(query).hasClientExports) {
658
680
  const observablePromise = this.localState
659
681
  .addExportedVariables(query, variables, context)
@@ -1024,7 +1046,7 @@ export class QueryManager {
1024
1046
  !isFullyUnmaskedOperation(document) &&
1025
1047
  !this.noCacheWarningsByQueryId.has(operationId)) {
1026
1048
  this.noCacheWarningsByQueryId.add(operationId);
1027
- __DEV__ && invariant.warn(82, getOperationName(document) ??
1049
+ __DEV__ && invariant.warn(78, getOperationName(document) ??
1028
1050
  `Unnamed ${operationType ?? "operation"}`);
1029
1051
  }
1030
1052
  }