@apollo/client 4.0.0-rc.3 → 4.0.0-rc.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 (128) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/__cjs/cache/core/cache.cjs +2 -6
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +42 -13
  5. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  6. package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
  7. package/__cjs/cache/inmemory/entityStore.d.cts +1 -1
  8. package/__cjs/cache/inmemory/inMemoryCache.cjs +1 -1
  9. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  10. package/__cjs/cache/inmemory/types.d.cts +1 -1
  11. package/__cjs/core/ApolloClient.cjs +45 -7
  12. package/__cjs/core/ApolloClient.cjs.map +1 -1
  13. package/__cjs/core/ApolloClient.d.cts +17 -4
  14. package/__cjs/core/ObservableQuery.cjs +40 -10
  15. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  16. package/__cjs/core/ObservableQuery.d.cts +73 -9
  17. package/__cjs/core/types.d.cts +87 -10
  18. package/__cjs/link/http/HttpLink.cjs.map +1 -1
  19. package/__cjs/link/http/HttpLink.d.cts +11 -1
  20. package/__cjs/react/hooks/useBackgroundQuery.d.cts +4 -0
  21. package/__cjs/react/hooks/useFragment.cjs +4 -5
  22. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  23. package/__cjs/react/hooks/useFragment.d.cts +4 -7
  24. package/__cjs/react/hooks/useLazyQuery.d.cts +5 -1
  25. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  26. package/__cjs/react/hooks/useLoadableQuery.d.cts +209 -10
  27. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  28. package/__cjs/react/hooks/useQuery.d.cts +270 -246
  29. package/__cjs/react/hooks/useQueryRefHandlers.d.cts +4 -0
  30. package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
  31. package/__cjs/react/hooks/useSubscription.d.cts +79 -62
  32. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  33. package/__cjs/react/hooks/useSuspenseFragment.d.cts +2 -2
  34. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  35. package/__cjs/react/hooks/useSuspenseQuery.d.cts +185 -161
  36. package/__cjs/react/index.cjs +1 -3
  37. package/__cjs/react/index.cjs.map +1 -1
  38. package/__cjs/react/index.d.cts +0 -1
  39. package/__cjs/react/internal/cache/FragmentReference.cjs +1 -1
  40. package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
  41. package/__cjs/react/types/types.documentation.d.cts +12 -1
  42. package/__cjs/utilities/internal/getStoreKeyName.cjs +8 -5
  43. package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
  44. package/__cjs/utilities/internal/index.cjs +4 -2
  45. package/__cjs/utilities/internal/index.cjs.map +1 -1
  46. package/__cjs/utilities/internal/index.d.cts +2 -0
  47. package/__cjs/utilities/internal/removeFragmentSpreads.cjs +14 -0
  48. package/__cjs/utilities/internal/removeFragmentSpreads.cjs.map +1 -0
  49. package/__cjs/utilities/internal/removeFragmentSpreads.d.cts +3 -0
  50. package/__cjs/utilities/internal/types/DocumentationTypes.cjs +3 -0
  51. package/__cjs/utilities/internal/types/DocumentationTypes.cjs.map +1 -0
  52. package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +82 -0
  53. package/__cjs/version.cjs +1 -1
  54. package/cache/core/cache.d.ts +42 -13
  55. package/cache/core/cache.js +2 -6
  56. package/cache/core/cache.js.map +1 -1
  57. package/cache/inmemory/entityStore.d.ts +1 -1
  58. package/cache/inmemory/entityStore.js +3 -3
  59. package/cache/inmemory/entityStore.js.map +1 -1
  60. package/cache/inmemory/inMemoryCache.js +1 -1
  61. package/cache/inmemory/inMemoryCache.js.map +1 -1
  62. package/cache/inmemory/types.d.ts +1 -1
  63. package/cache/inmemory/types.js.map +1 -1
  64. package/core/ApolloClient.d.ts +17 -4
  65. package/core/ApolloClient.js +46 -8
  66. package/core/ApolloClient.js.map +1 -1
  67. package/core/ObservableQuery.d.ts +73 -9
  68. package/core/ObservableQuery.js +40 -10
  69. package/core/ObservableQuery.js.map +1 -1
  70. package/core/types.d.ts +87 -10
  71. package/core/types.js.map +1 -1
  72. package/link/http/HttpLink.d.ts +11 -1
  73. package/link/http/HttpLink.js.map +1 -1
  74. package/package.json +1 -1
  75. package/react/hooks/useBackgroundQuery.d.ts +4 -0
  76. package/react/hooks/useFragment.d.ts +4 -7
  77. package/react/hooks/useFragment.js +4 -5
  78. package/react/hooks/useFragment.js.map +1 -1
  79. package/react/hooks/useLazyQuery.d.ts +5 -1
  80. package/react/hooks/useLoadableQuery.d.ts +209 -10
  81. package/react/hooks/useLoadableQuery.js.map +1 -1
  82. package/react/hooks/useQuery.d.ts +270 -246
  83. package/react/hooks/useQuery.js.map +1 -1
  84. package/react/hooks/useQueryRefHandlers.d.ts +4 -0
  85. package/react/hooks/useSubscription.d.ts +79 -62
  86. package/react/hooks/useSubscription.js.map +1 -1
  87. package/react/hooks/useSuspenseFragment.d.ts +2 -2
  88. package/react/hooks/useSuspenseFragment.js.map +1 -1
  89. package/react/hooks/useSuspenseQuery.d.ts +185 -161
  90. package/react/hooks/useSuspenseQuery.js.map +1 -1
  91. package/react/hooks-compiled/useBackgroundQuery.d.ts +4 -0
  92. package/react/hooks-compiled/useFragment.d.ts +4 -7
  93. package/react/hooks-compiled/useFragment.js +4 -5
  94. package/react/hooks-compiled/useFragment.js.map +1 -1
  95. package/react/hooks-compiled/useLazyQuery.d.ts +5 -1
  96. package/react/hooks-compiled/useLoadableQuery.d.ts +209 -10
  97. package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
  98. package/react/hooks-compiled/useQuery.d.ts +270 -246
  99. package/react/hooks-compiled/useQuery.js.map +1 -1
  100. package/react/hooks-compiled/useQueryRefHandlers.d.ts +4 -0
  101. package/react/hooks-compiled/useSubscription.d.ts +79 -62
  102. package/react/hooks-compiled/useSubscription.js.map +1 -1
  103. package/react/hooks-compiled/useSuspenseFragment.d.ts +2 -2
  104. package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
  105. package/react/hooks-compiled/useSuspenseQuery.d.ts +185 -161
  106. package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
  107. package/react/index.compiled.d.ts +0 -1
  108. package/react/index.compiled.js +0 -1
  109. package/react/index.compiled.js.map +1 -1
  110. package/react/index.d.ts +0 -1
  111. package/react/index.js +0 -1
  112. package/react/index.js.map +1 -1
  113. package/react/internal/cache/FragmentReference.js +1 -1
  114. package/react/internal/cache/FragmentReference.js.map +1 -1
  115. package/react/types/types.documentation.d.ts +12 -1
  116. package/react/types/types.documentation.js.map +1 -1
  117. package/utilities/internal/getStoreKeyName.js +8 -5
  118. package/utilities/internal/getStoreKeyName.js.map +1 -1
  119. package/utilities/internal/index.d.ts +2 -0
  120. package/utilities/internal/index.js +1 -0
  121. package/utilities/internal/index.js.map +1 -1
  122. package/utilities/internal/removeFragmentSpreads.d.ts +3 -0
  123. package/utilities/internal/removeFragmentSpreads.js +11 -0
  124. package/utilities/internal/removeFragmentSpreads.js.map +1 -0
  125. package/utilities/internal/types/DocumentationTypes.d.ts +82 -0
  126. package/utilities/internal/types/DocumentationTypes.js +2 -0
  127. package/utilities/internal/types/DocumentationTypes.js.map +1 -0
  128. package/version.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FragmentReference.js","sourceRoot":"","sources":["../../../../src/react/internal/cache/FragmentReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAUtC,OAAO,EACL,sBAAsB,EACtB,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAY3C,MAAM,OAAO,iBAAiB;IAIZ,UAAU,CAAyC;IACnD,GAAG,GAAgB,EAAE,CAAC;IAC/B,OAAO,CAA0C;IAEhD,OAAO,CAAqD;IAC5D,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AAK,EAAE,GAAG,MAAM,CAAC;QACzB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;QAEjD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAoB;YACzC,GAAG,OAAO;YACV,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC;YACtD,iBAAiB,EAAE,IAAI;YACvB,EAAE,EAAE,IAAI;YACR,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC;gBAC1C,QAAQ;gBACR,YAAY;gBACZ,IAAI,EAAE,IAAI,CAAC,MAAM;aAClB,CAAuB;SACzB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { equal } from \"@wry/equality\";\nimport type { Observable, Subscription } from \"rxjs\";\n\nimport type { ApolloClient, OperationVariables } from \"@apollo/client\";\nimport type {\n WatchFragmentOptions,\n WatchFragmentResult,\n} from \"@apollo/client/cache\";\nimport type { MaybeMasked } from \"@apollo/client/masking\";\nimport type { DecoratedPromise } from \"@apollo/client/utilities/internal\";\nimport {\n createFulfilledPromise,\n decoratePromise,\n} from \"@apollo/client/utilities/internal\";\n\nimport type { FragmentKey } from \"./types.js\";\n\ntype FragmentRefPromise<TData> = DecoratedPromise<TData>;\ntype Listener<TData> = (promise: FragmentRefPromise<TData>) => void;\n\ninterface FragmentReferenceOptions {\n autoDisposeTimeoutMs?: number;\n onDispose?: () => void;\n}\n\nexport class FragmentReference<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> {\n public readonly observable: Observable<WatchFragmentResult<TData>>;\n public readonly key: FragmentKey = {};\n public promise!: FragmentRefPromise<MaybeMasked<TData>>;\n\n private resolve: ((result: MaybeMasked<TData>) => void) | undefined;\n private reject: ((error: unknown) => void) | undefined;\n\n private subscription!: Subscription;\n private listeners = new Set<Listener<MaybeMasked<TData>>>();\n private autoDisposeTimeoutId?: NodeJS.Timeout;\n\n private references = 0;\n\n constructor(\n client: ApolloClient,\n watchFragmentOptions: WatchFragmentOptions<TData, TVariables> & {\n from: string;\n },\n options: FragmentReferenceOptions\n ) {\n this.dispose = this.dispose.bind(this);\n this.handleNext = this.handleNext.bind(this);\n this.handleError = this.handleError.bind(this);\n\n this.observable = client.watchFragment(watchFragmentOptions);\n\n if (options.onDispose) {\n this.onDispose = options.onDispose;\n }\n\n const diff = this.getDiff(client, watchFragmentOptions);\n\n // Start a timer that will automatically dispose of the query if the\n // suspended resource does not use this fragmentRef in the given time. This\n // helps prevent memory leaks when a component has unmounted before the\n // query has finished loading.\n const startDisposeTimer = () => {\n if (!this.references) {\n this.autoDisposeTimeoutId = setTimeout(\n this.dispose,\n options.autoDisposeTimeoutMs ?? 30_000\n );\n }\n };\n\n this.promise =\n diff.complete ?\n createFulfilledPromise(diff.result)\n : this.createPendingPromise();\n this.subscribeToFragment();\n\n this.promise.then(startDisposeTimer, startDisposeTimer);\n }\n\n listen(listener: Listener<MaybeMasked<TData>>) {\n this.listeners.add(listener);\n\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n retain() {\n this.references++;\n clearTimeout(this.autoDisposeTimeoutId);\n let disposed = false;\n\n return () => {\n if (disposed) {\n return;\n }\n\n disposed = true;\n this.references--;\n\n setTimeout(() => {\n if (!this.references) {\n this.dispose();\n }\n });\n };\n }\n\n private dispose() {\n this.subscription.unsubscribe();\n }\n\n private onDispose() {\n // noop. overridable by options\n }\n\n private subscribeToFragment() {\n this.subscription = this.observable.subscribe(\n this.handleNext.bind(this),\n this.handleError.bind(this)\n );\n // call `onDispose` when the subscription is finalized, either because it is\n // unsubscribed as a consequence of a `dispose` call or because the\n // ObservableQuery completes because of a `ApolloClient.stop()` call.\n this.subscription.add(this.onDispose);\n }\n\n private handleNext(result: WatchFragmentResult<TData>) {\n switch (this.promise.status) {\n case \"pending\": {\n if (result.complete) {\n return this.resolve?.(result.data);\n }\n\n this.deliver(this.promise);\n break;\n }\n case \"fulfilled\": {\n // This can occur when we already have a result written to the cache and\n // we subscribe for the first time. We create a fulfilled promise in the\n // constructor with a value that is the same as the first emitted value\n // so we want to skip delivering it.\n if (equal(this.promise.value, result.data)) {\n return;\n }\n\n this.promise =\n result.complete ?\n createFulfilledPromise(result.data)\n : this.createPendingPromise();\n\n this.deliver(this.promise);\n }\n }\n }\n\n private handleError(error: unknown) {\n this.reject?.(error);\n }\n\n private deliver(promise: FragmentRefPromise<MaybeMasked<TData>>) {\n this.listeners.forEach((listener) => listener(promise));\n }\n\n private createPendingPromise() {\n return decoratePromise(\n new Promise<MaybeMasked<TData>>((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n })\n );\n }\n\n private getDiff<TData, TVariables extends OperationVariables>(\n client: ApolloClient,\n options: WatchFragmentOptions<TData, TVariables> & { from: string }\n ) {\n const { cache } = client;\n const { from, fragment, fragmentName } = options;\n\n const diff = cache.diff<TData, TVariables>({\n ...options,\n query: cache[\"getFragmentDoc\"](fragment, fragmentName),\n returnPartialData: true,\n id: from,\n optimistic: true,\n });\n\n return {\n ...diff,\n result: client[\"queryManager\"].maskFragment({\n fragment,\n fragmentName,\n data: diff.result,\n }) as MaybeMasked<TData>,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"FragmentReference.js","sourceRoot":"","sources":["../../../../src/react/internal/cache/FragmentReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAUtC,OAAO,EACL,sBAAsB,EACtB,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAY3C,MAAM,OAAO,iBAAiB;IAIZ,UAAU,CAAyC;IACnD,GAAG,GAAgB,EAAE,CAAC;IAC/B,OAAO,CAA0C;IAEhD,OAAO,CAAqD;IAC5D,MAAM,CAAyC;IAE/C,YAAY,CAAgB;IAC5B,SAAS,GAAG,IAAI,GAAG,EAAgC,CAAC;IACpD,oB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AG,OAAO,CAAC;QAEjD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAoB;YACzC,GAAG,OAAO;YACV,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAC5B,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,EAC7B,YAAY,CACb;YACD,iBAAiB,EAAE,IAAI;YACvB,EAAE,EAAE,IAAI;YACR,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC;gBAC1C,QAAQ;gBACR,YAAY;gBACZ,IAAI,EAAE,IAAI,CAAC,MAAM;aAClB,CAAuB;SACzB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { equal } from \"@wry/equality\";\nimport type { Observable, Subscription } from \"rxjs\";\n\nimport type { ApolloClient, OperationVariables } from \"@apollo/client\";\nimport type {\n WatchFragmentOptions,\n WatchFragmentResult,\n} from \"@apollo/client/cache\";\nimport type { MaybeMasked } from \"@apollo/client/masking\";\nimport type { DecoratedPromise } from \"@apollo/client/utilities/internal\";\nimport {\n createFulfilledPromise,\n decoratePromise,\n} from \"@apollo/client/utilities/internal\";\n\nimport type { FragmentKey } from \"./types.js\";\n\ntype FragmentRefPromise<TData> = DecoratedPromise<TData>;\ntype Listener<TData> = (promise: FragmentRefPromise<TData>) => void;\n\ninterface FragmentReferenceOptions {\n autoDisposeTimeoutMs?: number;\n onDispose?: () => void;\n}\n\nexport class FragmentReference<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> {\n public readonly observable: Observable<WatchFragmentResult<TData>>;\n public readonly key: FragmentKey = {};\n public promise!: FragmentRefPromise<MaybeMasked<TData>>;\n\n private resolve: ((result: MaybeMasked<TData>) => void) | undefined;\n private reject: ((error: unknown) => void) | undefined;\n\n private subscription!: Subscription;\n private listeners = new Set<Listener<MaybeMasked<TData>>>();\n private autoDisposeTimeoutId?: NodeJS.Timeout;\n\n private references = 0;\n\n constructor(\n client: ApolloClient,\n watchFragmentOptions: WatchFragmentOptions<TData, TVariables> & {\n from: string;\n },\n options: FragmentReferenceOptions\n ) {\n this.dispose = this.dispose.bind(this);\n this.handleNext = this.handleNext.bind(this);\n this.handleError = this.handleError.bind(this);\n\n this.observable = client.watchFragment(watchFragmentOptions);\n\n if (options.onDispose) {\n this.onDispose = options.onDispose;\n }\n\n const diff = this.getDiff(client, watchFragmentOptions);\n\n // Start a timer that will automatically dispose of the query if the\n // suspended resource does not use this fragmentRef in the given time. This\n // helps prevent memory leaks when a component has unmounted before the\n // query has finished loading.\n const startDisposeTimer = () => {\n if (!this.references) {\n this.autoDisposeTimeoutId = setTimeout(\n this.dispose,\n options.autoDisposeTimeoutMs ?? 30_000\n );\n }\n };\n\n this.promise =\n diff.complete ?\n createFulfilledPromise(diff.result)\n : this.createPendingPromise();\n this.subscribeToFragment();\n\n this.promise.then(startDisposeTimer, startDisposeTimer);\n }\n\n listen(listener: Listener<MaybeMasked<TData>>) {\n this.listeners.add(listener);\n\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n retain() {\n this.references++;\n clearTimeout(this.autoDisposeTimeoutId);\n let disposed = false;\n\n return () => {\n if (disposed) {\n return;\n }\n\n disposed = true;\n this.references--;\n\n setTimeout(() => {\n if (!this.references) {\n this.dispose();\n }\n });\n };\n }\n\n private dispose() {\n this.subscription.unsubscribe();\n }\n\n private onDispose() {\n // noop. overridable by options\n }\n\n private subscribeToFragment() {\n this.subscription = this.observable.subscribe(\n this.handleNext.bind(this),\n this.handleError.bind(this)\n );\n // call `onDispose` when the subscription is finalized, either because it is\n // unsubscribed as a consequence of a `dispose` call or because the\n // ObservableQuery completes because of a `ApolloClient.stop()` call.\n this.subscription.add(this.onDispose);\n }\n\n private handleNext(result: WatchFragmentResult<TData>) {\n switch (this.promise.status) {\n case \"pending\": {\n if (result.complete) {\n return this.resolve?.(result.data);\n }\n\n this.deliver(this.promise);\n break;\n }\n case \"fulfilled\": {\n // This can occur when we already have a result written to the cache and\n // we subscribe for the first time. We create a fulfilled promise in the\n // constructor with a value that is the same as the first emitted value\n // so we want to skip delivering it.\n if (equal(this.promise.value, result.data)) {\n return;\n }\n\n this.promise =\n result.complete ?\n createFulfilledPromise(result.data)\n : this.createPendingPromise();\n\n this.deliver(this.promise);\n }\n }\n }\n\n private handleError(error: unknown) {\n this.reject?.(error);\n }\n\n private deliver(promise: FragmentRefPromise<MaybeMasked<TData>>) {\n this.listeners.forEach((listener) => listener(promise));\n }\n\n private createPendingPromise() {\n return decoratePromise(\n new Promise<MaybeMasked<TData>>((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n })\n );\n }\n\n private getDiff<TData, TVariables extends OperationVariables>(\n client: ApolloClient,\n options: WatchFragmentOptions<TData, TVariables> & { from: string }\n ) {\n const { cache } = client;\n const { from, fragment, fragmentName } = options;\n\n const diff = cache.diff<TData, TVariables>({\n ...options,\n query: cache[\"getFragmentDoc\"](\n client[\"transform\"](fragment),\n fragmentName\n ),\n returnPartialData: true,\n id: from,\n optimistic: true,\n });\n\n return {\n ...diff,\n result: client[\"queryManager\"].maskFragment({\n fragment,\n fragmentName,\n data: diff.result,\n }) as MaybeMasked<TData>,\n };\n }\n}\n"]}
@@ -177,7 +177,8 @@ export interface QueryResultDocumentation {
177
177
  */
178
178
  previousData: unknown;
179
179
  /**
180
- * If the query produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
180
+ * A single ErrorLike object describing the error that occured during the latest
181
+ * query execution.
181
182
  *
182
183
  * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
183
184
  *
@@ -263,8 +264,18 @@ export interface QueryResultDocumentation {
263
264
  * the result is still streaming in.
264
265
  * - `complete`: `data` is a fully satisfied query result fulfilled
265
266
  * either from the cache or network.
267
+ *
268
+ * @docGroup 1. Operation data
266
269
  */
267
270
  dataState: unknown;
271
+ /**
272
+ * Describes whether `data` is a complete or partial result. This flag is only
273
+ * set when `returnPartialData` is `true` in query options.
274
+ *
275
+ * @deprecated This field will be removed in a future version of Apollo Client.
276
+ * @docGroup 1. Operation data
277
+ */
278
+ partial: boolean;
268
279
  }
269
280
  export interface MutationOptionsDocumentation {
270
281
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.documentation.js","sourceRoot":"","sources":["../../../src/react/types/types.documentation.ts"],"names":[],"mappings":"","sourcesContent":["export interface QueryOptionsDocumentation {\n /**\n * A GraphQL query string parsed into an AST with the gql template literal.\n *\n * @docGroup 1. Operation options\n */\n query: unknown;\n\n /**\n * An object containing all of the GraphQL variables your query requires to execute.\n *\n * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.\n *\n * @docGroup 1. Operation options\n */\n variables: unknown;\n\n /**\n * Specifies how the query handles a response that returns both GraphQL errors and partial results.\n *\n * For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).\n *\n * The default value is `none`, meaning that the query result includes error details but not partial results.\n *\n * @docGroup 1. Operation options\n */\n errorPolicy: unknown;\n\n /**\n * If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.\n *\n * @docGroup 2. Networking options\n */\n context: unknown;\n\n /**\n * Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).\n *\n * For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).\n *\n * The default value is `cache-first`.\n *\n * @docGroup 3. Caching options\n */\n fetchPolicy: unknown;\n\n /**\n * Specifies the `FetchPolicy` to be used after this query has completed.\n *\n * @docGroup 3. Caching options\n */\n nextFetchPolicy: unknown;\n\n /**\n * Defaults to the initial value of options.fetchPolicy, but can be explicitly\n * configured to specify the WatchQueryFetchPolicy to revert back to whenever\n * variables change (unless nextFetchPolicy intervenes).\n *\n * @docGroup 3. Caching options\n */\n initialFetchPolicy: unknown;\n\n /**\n * Specifies the interval (in milliseconds) at which the query polls for updated results.\n *\n * The default value is `0` (no polling).\n *\n * @docGroup 2. Networking options\n */\n pollInterval: unknown;\n\n /**\n * If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.\n *\n * The default value is `true`.\n *\n * @docGroup 2. Networking options\n */\n notifyOnNetworkStatusChange: unknown;\n\n /**\n * If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.\n *\n * The default value is `false`.\n *\n * @docGroup 3. Caching options\n */\n returnPartialData: unknown;\n\n /**\n * Specifies whether a `NetworkStatus.refetch` operation should merge\n * incoming field data with existing data, or overwrite the existing data.\n * Overwriting is probably preferable, but merging is currently the default\n * behavior, for backwards compatibility with Apollo Client 3.x.\n *\n * @docGroup 3. Caching options\n */\n refetchWritePolicy: unknown;\n\n /**\n * Watched queries must opt into overwriting existing data on refetch, by passing refetchWritePolicy: \"overwrite\" in their WatchQueryOptions.\n *\n * The default value is \"overwrite\".\n *\n * @docGroup 3. Caching options\n */\n refetchWritePolicy_suspense: unknown;\n\n /**\n * If true, the query is not executed.\n *\n * The default value is `false`.\n *\n * @docGroup 1. Operation options\n */\n skip: unknown;\n\n /**\n * If `true`, the query is not executed. The default value is `false`.\n *\n * @deprecated We recommend using `skipToken` in place of the `skip` option as\n * it is more type-safe.\n *\n * This option is deprecated and only supported to ease the migration from useQuery. It will be removed in a future release.\n *\n * @docGroup 1. Operation options\n */\n skip_deprecated: unknown;\n\n /**\n * The instance of `ApolloClient` to use to execute the query.\n *\n * By default, the instance that's passed down via context is used, but you\n * can provide a different instance here.\n *\n * @docGroup 1. Operation options\n */\n client: unknown;\n\n /**\n * A unique identifier for the query. Each item in the array must be a stable\n * identifier to prevent infinite fetches.\n *\n * This is useful when using the same query and variables combination in more\n * than one component, otherwise the components may clobber each other. This\n * can also be used to force the query to re-evaluate fresh.\n *\n * @docGroup 1. Operation options\n */\n queryKey: unknown;\n\n /**\n * Pass `false` to skip executing the query during [server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering/).\n *\n * @docGroup 2. Networking options\n */\n ssr: unknown;\n\n /**\n * A callback function that's called whenever a refetch attempt occurs\n * while polling. If the function returns `true`, the refetch is\n * skipped and not reattempted until the next poll interval.\n *\n * @docGroup 2. Networking options\n */\n skipPollAttempt: unknown;\n}\n\nexport interface QueryResultDocumentation {\n /**\n * The instance of Apollo Client that executed the query.\n * Can be useful for manually executing followup queries or writing data to the cache.\n *\n * @docGroup 2. Network info\n */\n client: unknown;\n /**\n * A reference to the internal `ObservableQuery` used by the hook.\n */\n observable: unknown;\n /**\n * An object containing the result of your GraphQL query after it completes.\n *\n * This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).\n *\n * @docGroup 1. Operation data\n */\n data: unknown;\n /**\n * An object containing the result from the most recent _previous_ execution of this query.\n *\n * This value is `undefined` if this is the query's first execution.\n *\n * @docGroup 1. Operation data\n */\n previousData: unknown;\n /**\n * If the query produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.\n *\n * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).\n *\n * @docGroup 1. Operation data\n */\n error: unknown;\n /**\n * If `true`, the query is still in flight and results have not yet been returned.\n *\n * @docGroup 2. Network info\n */\n loading: unknown;\n /**\n * A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)\n *\n * Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.\n *\n * @docGroup 2. Network info\n */\n networkStatus: unknown;\n /**\n * An object containing the variables that were provided for the query.\n *\n * @docGroup 1. Operation data\n */\n variables: unknown;\n\n /**\n * A function that enables you to re-execute the query, optionally passing in new `variables`.\n *\n * To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).\n *\n * See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).\n *\n * @docGroup 3. Helper functions\n */\n refetch: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#fetchMore:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n fetchMore: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#startPolling:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n startPolling: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#stopPolling:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n stopPolling: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#subscribeToMore:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n subscribeToMore: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#updateQuery:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n updateQuery: unknown;\n\n /**\n * Describes the completeness of `data`.\n * - `empty`: No data could be fulfilled from the cache or the result is\n * incomplete. `data` is `undefined`.\n * - `partial`: Some data could be fulfilled from the cache but `data` is\n * incomplete. This is only possible when `returnPartialData` is `true`.\n * - `streaming`: `data` is incomplete as a result of a deferred query and\n * the result is still streaming in.\n * - `complete`: `data` is a fully satisfied query result fulfilled\n * either from the cache or network.\n */\n dataState: unknown;\n}\n\nexport interface MutationOptionsDocumentation {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single mutation inside of it.\n *\n * @docGroup 1. Operation options\n */\n mutation: unknown;\n\n /**\n * Provide `no-cache` if the mutation's result should _not_ be written to the Apollo Client cache.\n *\n * The default value is `network-only` (which means the result _is_ written to the cache).\n *\n * Unlike queries, mutations _do not_ support [fetch policies](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy) besides `network-only` and `no-cache`.\n *\n * @docGroup 3. Caching options\n */\n fetchPolicy: unknown;\n\n /**\n * To avoid retaining sensitive information from mutation root field\n * arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`\n * fields from the cache after each mutation finishes. If you need this\n * information to remain in the cache, you can prevent the removal by passing\n * `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are\n * also passed to the mutation `update` function, so we recommend obtaining\n * the results that way, rather than using this option, if possible.\n */\n keepRootFields: unknown;\n\n /**\n * By providing either an object or a callback function that, when invoked after\n * a mutation, allows you to return optimistic data and optionally skip updates\n * via the `IGNORE` sentinel object, Apollo Client caches this temporary\n * (and potentially incorrect) response until the mutation completes, enabling\n * more responsive UI updates.\n *\n * For more information, see [Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui/).\n *\n * @docGroup 3. Caching options\n */\n optimisticResponse: unknown;\n\n /**\n * A `MutationQueryReducersMap`, which is map from query names to\n * mutation query reducers. Briefly, this map defines how to incorporate the\n * results of the mutation into the results of queries that are currently\n * being watched by your application.\n */\n updateQueries: unknown;\n\n /**\n * An array (or a function that _returns_ an array) that specifies which queries you want to refetch after the mutation occurs.\n *\n * Each array value can be either:\n *\n * - An object containing the `query` to execute, along with any `variables`\n *\n * - A string indicating the operation name of the query to refetch\n *\n * @docGroup 1. Operation options\n */\n refetchQueries: unknown;\n\n /**\n * If `true`, makes sure all queries included in `refetchQueries` are completed before the mutation is considered complete.\n *\n * The default value is `false` (queries are refetched asynchronously).\n *\n * @docGroup 1. Operation options\n */\n awaitRefetchQueries: unknown;\n\n /**\n * A function used to update the Apollo Client cache after the mutation completes.\n *\n * For more information, see [Updating the cache after a mutation](https://www.apollographql.com/docs/react/data/mutations#updating-the-cache-after-a-mutation).\n *\n * @docGroup 3. Caching options\n */\n update: unknown;\n\n /**\n * Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the `refetchQueries: [...]` list passed to `client.mutate`.\n *\n * Returning a `Promise` from `onQueryUpdated` will cause the final mutation `Promise` to await the returned `Promise`. Returning `false` causes the query to be ignored.\n *\n * @docGroup 1. Operation options\n */\n onQueryUpdated: unknown;\n\n /**\n * Specifies how the mutation handles a response that returns both GraphQL errors and partial results.\n *\n * For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).\n *\n * The default value is `none`, meaning that the mutation result includes error details but _not_ partial results.\n *\n * @docGroup 1. Operation options\n */\n errorPolicy: unknown;\n\n /**\n * An object containing all of the GraphQL variables your mutation requires to execute.\n *\n * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.\n *\n * @docGroup 1. Operation options\n */\n variables: unknown;\n\n /**\n * If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.\n *\n * @docGroup 2. Networking options\n */\n context: unknown;\n\n /**\n * The instance of `ApolloClient` to use to execute the mutation.\n *\n * By default, the instance that's passed down via context is used, but you can provide a different instance here.\n *\n * @docGroup 2. Networking options\n */\n client: unknown;\n /**\n * If `true`, the in-progress mutation's associated component re-renders whenever the network status changes or a network error occurs.\n *\n * The default value is `true`.\n *\n * @docGroup 2. Networking options\n */\n notifyOnNetworkStatusChange: unknown;\n /**\n * A callback function that's called when your mutation successfully completes with zero errors (or if `errorPolicy` is `ignore` and partial data is returned).\n *\n * This function is passed the mutation's result `data` and any options passed to the mutation.\n *\n * @docGroup 1. Operation options\n */\n onCompleted: unknown;\n /**\n * A callback function that's called when the mutation encounters one or more errors (unless `errorPolicy` is `ignore`).\n *\n * This function is passed an [`ApolloError`](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/errors/index.ts#L36-L39) object that contains either a `networkError` object or a `graphQLErrors` array, depending on the error(s) that occurred, as well as any options passed the mutation.\n *\n * @docGroup 1. Operation options\n */\n onError: unknown;\n /**\n * If `true`:\n *\n * - The initial state update (setting loading to true) is skipped\n * - The success state update (setting data and setting loading to false) is skipped\n * - Error updates will still occur\n *\n * The default value is `false`.\n *\n * This option is useful when you want to execute a mutation but don't need to track its progress or result in the UI, potentially improving performance by reducing re-renders.\n *\n * @docGroup 1. Operation options\n */\n ignoreResults: unknown;\n}\n\nexport interface MutationResultDocumentation {\n /**\n * The data returned from your mutation. Can be `undefined` if `ignoreResults` is `true`.\n */\n data: unknown;\n /**\n * If the mutation produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.\n *\n * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).\n */\n error: unknown;\n /**\n * If `true`, the mutation is currently in flight.\n */\n loading: unknown;\n /**\n * If `true`, the mutation's mutate function has been called.\n */\n called: unknown;\n /**\n * The instance of Apollo Client that executed the mutation.\n *\n * Can be useful for manually executing followup operations or writing data to the cache.\n */\n client: unknown;\n /**\n * A function that you can call to reset the mutation's result to its initial, uncalled state.\n */\n reset: unknown;\n /**\n * Custom extensions returned from the GraphQL server\n */\n extensions: unknown;\n}\n\nexport interface SubscriptionOptionsDocumentation {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single subscription inside of it.\n */\n query: unknown;\n /**\n * An object containing all of the variables your subscription needs to execute\n */\n variables: unknown;\n\n /**\n * Specifies the `ErrorPolicy` to be used for this operation\n */\n errorPolicy: unknown;\n\n /**\n * How you want your component to interact with the Apollo cache. For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).\n */\n fetchPolicy: unknown;\n\n /**\n * Determines if your subscription should be unsubscribed and subscribed again when an input to the hook (such as `subscription` or `variables`) changes.\n */\n shouldResubscribe: unknown;\n\n /**\n * If `true`, the hook will not cause the component to rerender. This is useful when you want to control the rendering of your component yourself with logic in the `onData` and `onError` callbacks.\n *\n * Changing this to `true` when the hook already has `data` will reset the `data` to `undefined`.\n */\n ignoreResults: unknown;\n /**\n * An `ApolloClient` instance. By default `useSubscription` / `Subscription` uses the client passed down via context, but a different client can be passed in.\n */\n client: unknown;\n\n /**\n * Determines if the current subscription should be skipped. Useful if, for example, variables depend on previous queries and are not ready yet.\n */\n skip: unknown;\n\n /**\n * Shared context between your component and your network interface (Apollo Link).\n */\n context: unknown;\n\n /**\n * Shared context between your component and your network interface (Apollo Link).\n */\n extensions: unknown;\n\n /**\n * Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component completes the subscription.\n *\n * @since 3.7.0\n */\n onComplete: unknown;\n\n /**\n * Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component receives data. The callback `options` object param consists of the current Apollo Client instance in `client`, and the received subscription data in `data`.\n *\n * @since 3.7.0\n */\n onData: unknown;\n\n /**\n * Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component receives an error.\n *\n * @since 3.7.0\n */\n onError: unknown;\n}\n\nexport interface SubscriptionResultDocumentation {\n /**\n * A boolean that indicates whether any initial data has been returned\n */\n loading: unknown;\n /**\n * An object containing the result of your GraphQL subscription. Defaults to an empty object.\n */\n data: unknown;\n /**\n * A runtime error with `graphQLErrors` and `networkError` properties\n */\n error: unknown;\n}\n"]}
1
+ {"version":3,"file":"types.documentation.js","sourceRoot":"","sources":["../../../src/react/types/types.documentation.ts"],"names":[],"mappings":"","sourcesContent":["export interface QueryOptionsDocumentation {\n /**\n * A GraphQL query string parsed into an AST with the gql template literal.\n *\n * @docGroup 1. Operation options\n */\n query: unknown;\n\n /**\n * An object containing all of the GraphQL variables your query requires to execute.\n *\n * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.\n *\n * @docGroup 1. Operation options\n */\n variables: unknown;\n\n /**\n * Specifies how the query handles a response that returns both GraphQL errors and partial results.\n *\n * For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).\n *\n * The default value is `none`, meaning that the query result includes error details but not partial results.\n *\n * @docGroup 1. Operation options\n */\n errorPolicy: unknown;\n\n /**\n * If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.\n *\n * @docGroup 2. Networking options\n */\n context: unknown;\n\n /**\n * Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).\n *\n * For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).\n *\n * The default value is `cache-first`.\n *\n * @docGroup 3. Caching options\n */\n fetchPolicy: unknown;\n\n /**\n * Specifies the `FetchPolicy` to be used after this query has completed.\n *\n * @docGroup 3. Caching options\n */\n nextFetchPolicy: unknown;\n\n /**\n * Defaults to the initial value of options.fetchPolicy, but can be explicitly\n * configured to specify the WatchQueryFetchPolicy to revert back to whenever\n * variables change (unless nextFetchPolicy intervenes).\n *\n * @docGroup 3. Caching options\n */\n initialFetchPolicy: unknown;\n\n /**\n * Specifies the interval (in milliseconds) at which the query polls for updated results.\n *\n * The default value is `0` (no polling).\n *\n * @docGroup 2. Networking options\n */\n pollInterval: unknown;\n\n /**\n * If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.\n *\n * The default value is `true`.\n *\n * @docGroup 2. Networking options\n */\n notifyOnNetworkStatusChange: unknown;\n\n /**\n * If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.\n *\n * The default value is `false`.\n *\n * @docGroup 3. Caching options\n */\n returnPartialData: unknown;\n\n /**\n * Specifies whether a `NetworkStatus.refetch` operation should merge\n * incoming field data with existing data, or overwrite the existing data.\n * Overwriting is probably preferable, but merging is currently the default\n * behavior, for backwards compatibility with Apollo Client 3.x.\n *\n * @docGroup 3. Caching options\n */\n refetchWritePolicy: unknown;\n\n /**\n * Watched queries must opt into overwriting existing data on refetch, by passing refetchWritePolicy: \"overwrite\" in their WatchQueryOptions.\n *\n * The default value is \"overwrite\".\n *\n * @docGroup 3. Caching options\n */\n refetchWritePolicy_suspense: unknown;\n\n /**\n * If true, the query is not executed.\n *\n * The default value is `false`.\n *\n * @docGroup 1. Operation options\n */\n skip: unknown;\n\n /**\n * If `true`, the query is not executed. The default value is `false`.\n *\n * @deprecated We recommend using `skipToken` in place of the `skip` option as\n * it is more type-safe.\n *\n * This option is deprecated and only supported to ease the migration from useQuery. It will be removed in a future release.\n *\n * @docGroup 1. Operation options\n */\n skip_deprecated: unknown;\n\n /**\n * The instance of `ApolloClient` to use to execute the query.\n *\n * By default, the instance that's passed down via context is used, but you\n * can provide a different instance here.\n *\n * @docGroup 1. Operation options\n */\n client: unknown;\n\n /**\n * A unique identifier for the query. Each item in the array must be a stable\n * identifier to prevent infinite fetches.\n *\n * This is useful when using the same query and variables combination in more\n * than one component, otherwise the components may clobber each other. This\n * can also be used to force the query to re-evaluate fresh.\n *\n * @docGroup 1. Operation options\n */\n queryKey: unknown;\n\n /**\n * Pass `false` to skip executing the query during [server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering/).\n *\n * @docGroup 2. Networking options\n */\n ssr: unknown;\n\n /**\n * A callback function that's called whenever a refetch attempt occurs\n * while polling. If the function returns `true`, the refetch is\n * skipped and not reattempted until the next poll interval.\n *\n * @docGroup 2. Networking options\n */\n skipPollAttempt: unknown;\n}\n\nexport interface QueryResultDocumentation {\n /**\n * The instance of Apollo Client that executed the query.\n * Can be useful for manually executing followup queries or writing data to the cache.\n *\n * @docGroup 2. Network info\n */\n client: unknown;\n /**\n * A reference to the internal `ObservableQuery` used by the hook.\n */\n observable: unknown;\n /**\n * An object containing the result of your GraphQL query after it completes.\n *\n * This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).\n *\n * @docGroup 1. Operation data\n */\n data: unknown;\n /**\n * An object containing the result from the most recent _previous_ execution of this query.\n *\n * This value is `undefined` if this is the query's first execution.\n *\n * @docGroup 1. Operation data\n */\n previousData: unknown;\n /**\n * A single ErrorLike object describing the error that occured during the latest\n * query execution.\n *\n * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).\n *\n * @docGroup 1. Operation data\n */\n error: unknown;\n /**\n * If `true`, the query is still in flight and results have not yet been returned.\n *\n * @docGroup 2. Network info\n */\n loading: unknown;\n /**\n * A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)\n *\n * Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.\n *\n * @docGroup 2. Network info\n */\n networkStatus: unknown;\n /**\n * An object containing the variables that were provided for the query.\n *\n * @docGroup 1. Operation data\n */\n variables: unknown;\n\n /**\n * A function that enables you to re-execute the query, optionally passing in new `variables`.\n *\n * To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).\n *\n * See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).\n *\n * @docGroup 3. Helper functions\n */\n refetch: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#fetchMore:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n fetchMore: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#startPolling:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n startPolling: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#stopPolling:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n stopPolling: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#subscribeToMore:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n subscribeToMore: unknown;\n /**\n * {@inheritDoc @apollo/client!ObservableQuery#updateQuery:member(1)}\n *\n * @docGroup 3. Helper functions\n */\n updateQuery: unknown;\n\n /**\n * Describes the completeness of `data`.\n * - `empty`: No data could be fulfilled from the cache or the result is\n * incomplete. `data` is `undefined`.\n * - `partial`: Some data could be fulfilled from the cache but `data` is\n * incomplete. This is only possible when `returnPartialData` is `true`.\n * - `streaming`: `data` is incomplete as a result of a deferred query and\n * the result is still streaming in.\n * - `complete`: `data` is a fully satisfied query result fulfilled\n * either from the cache or network.\n *\n * @docGroup 1. Operation data\n */\n dataState: unknown;\n\n /**\n * Describes whether `data` is a complete or partial result. This flag is only\n * set when `returnPartialData` is `true` in query options.\n *\n * @deprecated This field will be removed in a future version of Apollo Client.\n * @docGroup 1. Operation data\n */\n partial: boolean;\n}\n\nexport interface MutationOptionsDocumentation {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single mutation inside of it.\n *\n * @docGroup 1. Operation options\n */\n mutation: unknown;\n\n /**\n * Provide `no-cache` if the mutation's result should _not_ be written to the Apollo Client cache.\n *\n * The default value is `network-only` (which means the result _is_ written to the cache).\n *\n * Unlike queries, mutations _do not_ support [fetch policies](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy) besides `network-only` and `no-cache`.\n *\n * @docGroup 3. Caching options\n */\n fetchPolicy: unknown;\n\n /**\n * To avoid retaining sensitive information from mutation root field\n * arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`\n * fields from the cache after each mutation finishes. If you need this\n * information to remain in the cache, you can prevent the removal by passing\n * `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are\n * also passed to the mutation `update` function, so we recommend obtaining\n * the results that way, rather than using this option, if possible.\n */\n keepRootFields: unknown;\n\n /**\n * By providing either an object or a callback function that, when invoked after\n * a mutation, allows you to return optimistic data and optionally skip updates\n * via the `IGNORE` sentinel object, Apollo Client caches this temporary\n * (and potentially incorrect) response until the mutation completes, enabling\n * more responsive UI updates.\n *\n * For more information, see [Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui/).\n *\n * @docGroup 3. Caching options\n */\n optimisticResponse: unknown;\n\n /**\n * A `MutationQueryReducersMap`, which is map from query names to\n * mutation query reducers. Briefly, this map defines how to incorporate the\n * results of the mutation into the results of queries that are currently\n * being watched by your application.\n */\n updateQueries: unknown;\n\n /**\n * An array (or a function that _returns_ an array) that specifies which queries you want to refetch after the mutation occurs.\n *\n * Each array value can be either:\n *\n * - An object containing the `query` to execute, along with any `variables`\n *\n * - A string indicating the operation name of the query to refetch\n *\n * @docGroup 1. Operation options\n */\n refetchQueries: unknown;\n\n /**\n * If `true`, makes sure all queries included in `refetchQueries` are completed before the mutation is considered complete.\n *\n * The default value is `false` (queries are refetched asynchronously).\n *\n * @docGroup 1. Operation options\n */\n awaitRefetchQueries: unknown;\n\n /**\n * A function used to update the Apollo Client cache after the mutation completes.\n *\n * For more information, see [Updating the cache after a mutation](https://www.apollographql.com/docs/react/data/mutations#updating-the-cache-after-a-mutation).\n *\n * @docGroup 3. Caching options\n */\n update: unknown;\n\n /**\n * Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the `refetchQueries: [...]` list passed to `client.mutate`.\n *\n * Returning a `Promise` from `onQueryUpdated` will cause the final mutation `Promise` to await the returned `Promise`. Returning `false` causes the query to be ignored.\n *\n * @docGroup 1. Operation options\n */\n onQueryUpdated: unknown;\n\n /**\n * Specifies how the mutation handles a response that returns both GraphQL errors and partial results.\n *\n * For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).\n *\n * The default value is `none`, meaning that the mutation result includes error details but _not_ partial results.\n *\n * @docGroup 1. Operation options\n */\n errorPolicy: unknown;\n\n /**\n * An object containing all of the GraphQL variables your mutation requires to execute.\n *\n * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.\n *\n * @docGroup 1. Operation options\n */\n variables: unknown;\n\n /**\n * If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.\n *\n * @docGroup 2. Networking options\n */\n context: unknown;\n\n /**\n * The instance of `ApolloClient` to use to execute the mutation.\n *\n * By default, the instance that's passed down via context is used, but you can provide a different instance here.\n *\n * @docGroup 2. Networking options\n */\n client: unknown;\n /**\n * If `true`, the in-progress mutation's associated component re-renders whenever the network status changes or a network error occurs.\n *\n * The default value is `true`.\n *\n * @docGroup 2. Networking options\n */\n notifyOnNetworkStatusChange: unknown;\n /**\n * A callback function that's called when your mutation successfully completes with zero errors (or if `errorPolicy` is `ignore` and partial data is returned).\n *\n * This function is passed the mutation's result `data` and any options passed to the mutation.\n *\n * @docGroup 1. Operation options\n */\n onCompleted: unknown;\n /**\n * A callback function that's called when the mutation encounters one or more errors (unless `errorPolicy` is `ignore`).\n *\n * This function is passed an [`ApolloError`](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/errors/index.ts#L36-L39) object that contains either a `networkError` object or a `graphQLErrors` array, depending on the error(s) that occurred, as well as any options passed the mutation.\n *\n * @docGroup 1. Operation options\n */\n onError: unknown;\n /**\n * If `true`:\n *\n * - The initial state update (setting loading to true) is skipped\n * - The success state update (setting data and setting loading to false) is skipped\n * - Error updates will still occur\n *\n * The default value is `false`.\n *\n * This option is useful when you want to execute a mutation but don't need to track its progress or result in the UI, potentially improving performance by reducing re-renders.\n *\n * @docGroup 1. Operation options\n */\n ignoreResults: unknown;\n}\n\nexport interface MutationResultDocumentation {\n /**\n * The data returned from your mutation. Can be `undefined` if `ignoreResults` is `true`.\n */\n data: unknown;\n /**\n * If the mutation produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.\n *\n * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).\n */\n error: unknown;\n /**\n * If `true`, the mutation is currently in flight.\n */\n loading: unknown;\n /**\n * If `true`, the mutation's mutate function has been called.\n */\n called: unknown;\n /**\n * The instance of Apollo Client that executed the mutation.\n *\n * Can be useful for manually executing followup operations or writing data to the cache.\n */\n client: unknown;\n /**\n * A function that you can call to reset the mutation's result to its initial, uncalled state.\n */\n reset: unknown;\n /**\n * Custom extensions returned from the GraphQL server\n */\n extensions: unknown;\n}\n\nexport interface SubscriptionOptionsDocumentation {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single subscription inside of it.\n */\n query: unknown;\n /**\n * An object containing all of the variables your subscription needs to execute\n */\n variables: unknown;\n\n /**\n * Specifies the `ErrorPolicy` to be used for this operation\n */\n errorPolicy: unknown;\n\n /**\n * How you want your component to interact with the Apollo cache. For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).\n */\n fetchPolicy: unknown;\n\n /**\n * Determines if your subscription should be unsubscribed and subscribed again when an input to the hook (such as `subscription` or `variables`) changes.\n */\n shouldResubscribe: unknown;\n\n /**\n * If `true`, the hook will not cause the component to rerender. This is useful when you want to control the rendering of your component yourself with logic in the `onData` and `onError` callbacks.\n *\n * Changing this to `true` when the hook already has `data` will reset the `data` to `undefined`.\n */\n ignoreResults: unknown;\n /**\n * An `ApolloClient` instance. By default `useSubscription` / `Subscription` uses the client passed down via context, but a different client can be passed in.\n */\n client: unknown;\n\n /**\n * Determines if the current subscription should be skipped. Useful if, for example, variables depend on previous queries and are not ready yet.\n */\n skip: unknown;\n\n /**\n * Shared context between your component and your network interface (Apollo Link).\n */\n context: unknown;\n\n /**\n * Shared context between your component and your network interface (Apollo Link).\n */\n extensions: unknown;\n\n /**\n * Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component completes the subscription.\n *\n * @since 3.7.0\n */\n onComplete: unknown;\n\n /**\n * Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component receives data. The callback `options` object param consists of the current Apollo Client instance in `client`, and the received subscription data in `data`.\n *\n * @since 3.7.0\n */\n onData: unknown;\n\n /**\n * Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component receives an error.\n *\n * @since 3.7.0\n */\n onError: unknown;\n}\n\nexport interface SubscriptionResultDocumentation {\n /**\n * A boolean that indicates whether any initial data has been returned\n */\n loading: unknown;\n /**\n * An object containing the result of your GraphQL subscription. Defaults to an empty object.\n */\n data: unknown;\n /**\n * A runtime error with `graphQLErrors` and `networkError` properties\n */\n error: unknown;\n}\n"]}
@@ -33,11 +33,12 @@ export const getStoreKeyName = Object.assign(function (fieldName, args, directiv
33
33
  filterKeys.forEach((key) => {
34
34
  filteredArgs[key] = args[key];
35
35
  });
36
- return `${directives["connection"]["key"]}(${storeKeyNameStringify(filteredArgs)})`;
37
- }
38
- else {
39
- return directives["connection"]["key"];
36
+ const stringifiedArgs = storeKeyNameStringify(filteredArgs);
37
+ if (stringifiedArgs !== "{}") {
38
+ return `${directives["connection"]["key"]}(${stringifiedArgs})`;
39
+ }
40
40
  }
41
+ return directives["connection"]["key"];
41
42
  }
42
43
  let completeFieldName = fieldName;
43
44
  if (args) {
@@ -45,7 +46,9 @@ export const getStoreKeyName = Object.assign(function (fieldName, args, directiv
45
46
  // and can lead to different store key names being created even though
46
47
  // the `args` object used during creation has the same properties/values.
47
48
  const stringifiedArgs = storeKeyNameStringify(args);
48
- completeFieldName += `(${stringifiedArgs})`;
49
+ if (stringifiedArgs !== "{}") {
50
+ completeFieldName += `(${stringifiedArgs})`;
51
+ }
49
52
  }
50
53
  if (directives) {
51
54
  Object.keys(directives).forEach((key) => {
@@ -1 +1 @@
1
- {"version":3,"file":"getStoreKeyName.js","sources":["../../../src/utilities/internal/getStoreKeyName.ts"],"sourcesContent":["// eslint-disable-next-line local-rules/import-from-inside-other-export\nimport { canonicalStringify } from \"../shared/canonicalStringify.js\";\n\ntype Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n \"connection\",\n \"include\",\n \"skip\",\n \"client\",\n \"rest\",\n \"export\",\n \"nonreactive\",\n];\n\n// Default stable JSON.stringify implementation used by getStoreKeyName. Can be\n// updated/replaced with something better by calling\n// getStoreKeyName.setStringify(newStringifyFunction).\nlet storeKeyNameStringify: (value: any) => string = canonicalStringify;\n\n/** @internal */\nexport const getStoreKeyName = Object.assign(\n function (\n fieldName: string,\n args?: Record<string, any> | null,\n directives?: Directives\n ): string {\n if (\n args &&\n directives &&\n directives[\"connection\"] &&\n directives[\"connection\"][\"key\"]\n ) {\n if (\n directives[\"connection\"][\"filter\"] &&\n (directives[\"connection\"][\"filter\"] as string[]).length > 0\n ) {\n const filterKeys =\n directives[\"connection\"][\"filter\"] ?\n (directives[\"connection\"][\"filter\"] as string[])\n : [];\n filterKeys.sort();\n\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach((key) => {\n filteredArgs[key] = args[key];\n });\n\n return `${directives[\"connection\"][\"key\"]}(${storeKeyNameStringify(\n filteredArgs\n )})`;\n } else {\n return directives[\"connection\"][\"key\"];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = storeKeyNameStringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach((key) => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${storeKeyNameStringify(\n directives[key]\n )})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n },\n {\n setStringify(s: typeof storeKeyNameStringify) {\n const previous = storeKeyNameStringify;\n storeKeyNameStringify = s;\n return previous;\n },\n }\n);\n"],"names":[],"mappings":"AAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAmC,CAAnC,CAAA,C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],"sourcesContent":["// eslint-disable-next-line local-rules/import-from-inside-other-export\nimport { canonicalStringify } from \"../shared/canonicalStringify.js\";\n\ntype Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n \"connection\",\n \"include\",\n \"skip\",\n \"client\",\n \"rest\",\n \"export\",\n \"nonreactive\",\n];\n\n// Default stable JSON.stringify implementation used by getStoreKeyName. Can be\n// updated/replaced with something better by calling\n// getStoreKeyName.setStringify(newStringifyFunction).\nlet storeKeyNameStringify: (value: any) => string = canonicalStringify;\n\n/** @internal */\nexport const getStoreKeyName = Object.assign(\n function (\n fieldName: string,\n args?: Record<string, any> | null,\n directives?: Directives\n ): string {\n if (\n args &&\n directives &&\n directives[\"connection\"] &&\n directives[\"connection\"][\"key\"]\n ) {\n if (\n directives[\"connection\"][\"filter\"] &&\n (directives[\"connection\"][\"filter\"] as string[]).length > 0\n ) {\n const filterKeys =\n directives[\"connection\"][\"filter\"] ?\n (directives[\"connection\"][\"filter\"] as string[])\n : [];\n filterKeys.sort();\n\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach((key) => {\n filteredArgs[key] = args[key];\n });\n\n const stringifiedArgs: string = storeKeyNameStringify(filteredArgs);\n if (stringifiedArgs !== \"{}\") {\n return `${directives[\"connection\"][\"key\"]}(${stringifiedArgs})`;\n }\n }\n return directives[\"connection\"][\"key\"];\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = storeKeyNameStringify(args);\n if (stringifiedArgs !== \"{}\") {\n completeFieldName += `(${stringifiedArgs})`;\n }\n }\n\n if (directives) {\n Object.keys(directives).forEach((key) => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${storeKeyNameStringify(\n directives[key]\n )})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n },\n {\n setStringify(s: typeof storeKeyNameStringify) {\n const previous = storeKeyNameStringify;\n storeKeyNameStringify = s;\n return previous;\n },\n }\n);\n"],"names":[],"mappings":"AAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAmC,CAAnC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoE;AAQpE,CAAA,CAAA,CAAA,CAAA,EAAM,CAAN,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAmC;IACjC,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc;IACZ,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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jB,CAAC;AACL,CAAG,CACF;"}
@@ -11,6 +11,7 @@ export type { Primitive } from "./types/Primitive.js";
11
11
  export type { RejectedPromise } from "./types/RejectedPromise.js";
12
12
  export type { RemoveIndexSignature } from "./types/RemoveIndexSignature.js";
13
13
  export type { VariablesOption } from "./types/VariablesOption.js";
14
+ export type { DocumentationTypes } from "./types/DocumentationTypes.js";
14
15
  export { argumentsObjectFromField } from "./argumentsObjectFromField.js";
15
16
  export { canUseDOM } from "./canUseDOM.js";
16
17
  export { checkDocument } from "./checkDocument.js";
@@ -51,6 +52,7 @@ export { mergeOptions } from "./mergeOptions.js";
51
52
  export { omitDeep } from "./omitDeep.js";
52
53
  export { preventUnhandledRejection } from "./preventUnhandledRejection.js";
53
54
  export { removeDirectivesFromDocument } from "./removeDirectivesFromDocument.js";
55
+ export { removeMaskedFragmentSpreads } from "./removeFragmentSpreads.js";
54
56
  export { resultKeyNameFromField } from "./resultKeyNameFromField.js";
55
57
  export { shouldInclude } from "./shouldInclude.js";
56
58
  export { storeKeyNameFromField } from "./storeKeyNameFromField.js";
@@ -38,6 +38,7 @@ export { mergeOptions } from "./mergeOptions.js";
38
38
  export { omitDeep } from "./omitDeep.js";
39
39
  export { preventUnhandledRejection } from "./preventUnhandledRejection.js";
40
40
  export { removeDirectivesFromDocument } from "./removeDirectivesFromDocument.js";
41
+ export { removeMaskedFragmentSpreads } from "./removeFragmentSpreads.js";
41
42
  export { resultKeyNameFromField } from "./resultKeyNameFromField.js";
42
43
  export { shouldInclude } from "./shouldInclude.js";
43
44
  export { storeKeyNameFromField } from "./storeKeyNameFromField.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/internal/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC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it.js\";\nexport type { FragmentMap } from \"./types/FragmentMap.js\";\nexport type { FragmentMapFunction } from \"./types/FragmentMapFunction.js\";\nexport type { FulfilledPromise } from \"./types/FulfilledPromise.js\";\nexport type { IsAny } from \"./types/IsAny.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { PendingPromise } from \"./types/PendingPromise.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { RejectedPromise } from \"./types/RejectedPromise.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\nexport type { VariablesOption } from \"./types/VariablesOption.js\";\n\nexport { argumentsObjectFromField } from \"./argumentsObjectFromField.js\";\nexport { canUseDOM } from \"./canUseDOM.js\";\nexport { checkDocument } from \"./checkDocument.js\";\nexport { cloneDeep } from \"./cloneDeep.js\";\nexport { compact } from \"./compact.js\";\nexport { createFragmentMap } from \"./createFragmentMap.js\";\nexport { createFulfilledPromise } from \"./createFulfilledPromise.js\";\nexport { createRejectedPromise } from \"./createRejectedPromise.js\";\nexport { dealias } from \"./dealias.js\";\nexport { decoratePromise } from \"./decoratePromise.js\";\nexport { DeepMerger } from \"./DeepMerger.js\";\nexport { getDefaultValues } from \"./getDefaultValues.js\";\nexport { getFragmentFromSelection } from \"./getFragmentFromSelection.js\";\nexport { getFragmentQueryDocument } from \"./getFragmentQueryDocument.js\";\nexport { getFragmentDefinition } from \"./getFragmentDefinition.js\";\nexport { getFragmentDefinitions } from \"./getFragmentDefinitions.js\";\nexport { getGraphQLErrorsFromResult } from \"./getGraphQLErrorsFromResult.js\";\nexport { getMainDefinition } from \"./getMainDefinition.js\";\nexport { getOperationDefinition } from \"./getOperationDefinition.js\";\nexport { getOperationName } from \"./getOperationName.js\";\nexport { getQueryDefinition } from \"./getQueryDefinition.js\";\nexport { getStoreKeyName } from \"./getStoreKeyName.js\";\nexport { graphQLResultHasError } from \"./graphQLResultHasError.js\";\nexport { hasDirectives } from \"./hasDirectives.js\";\nexport { hasForcedResolvers } from \"./hasForcedResolvers.js\";\nexport { isArray } from \"./isArray.js\";\nexport { isDocumentNode } from \"./isDocumentNode.js\";\nexport { isField } from \"./isField.js\";\nexport { isNonEmptyArray } from \"./isNonEmptyArray.js\";\nexport { isNonNullObject } from \"./isNonNullObject.js\";\nexport { isPlainObject } from \"./isPlainObject.js\";\nexport { makeReference } from \"./makeReference.js\";\nexport { makeUniqueId } from \"./makeUniqueId.js\";\nexport { maybeDeepFreeze } from \"./maybeDeepFreeze.js\";\nexport { mergeDeep } from \"./mergeDeep.js\";\nexport { mergeDeepArray } from \"./mergeDeepArray.js\";\nexport { mergeOptions } from \"./mergeOptions.js\";\nexport { omitDeep } from \"./omitDeep.js\";\nexport { preventUnhandledRejection } from \"./preventUnhandledRejection.js\";\nexport { removeDirectivesFromDocument } from \"./removeDirectivesFromDocument.js\";\nexport { resultKeyNameFromField } from \"./resultKeyNameFromField.js\";\nexport { shouldInclude } from \"./shouldInclude.js\";\nexport { storeKeyNameFromField } from \"./storeKeyNameFromField.js\";\nexport { stringifyForDisplay } from \"./stringifyForDisplay.js\";\nexport { toQueryResult } from \"./toQueryResult.js\";\nexport { filterMap } from \"./filterMap.js\";\n\nexport {\n getApolloCacheMemoryInternals,\n getApolloClientMemoryInternals,\n getInMemoryCacheMemoryInternals,\n registerGlobalCache,\n} from \"../internal/getMemoryInternals.js\";\n\nexport { AutoCleanedStrongCache, AutoCleanedWeakCache } from \"./caches.js\";\n\nexport type { ApplyHKT } from \"./types/ApplyHKT.js\";\nexport type { ApplyHKTImplementationWithDefault } from \"./types/ApplyHKTImplementationWithDefault.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/internal/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,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["export type { DecoratedPromise } from \"./types/DecoratedPromise.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { FragmentMap } from \"./types/FragmentMap.js\";\nexport type { FragmentMapFunction } from \"./types/FragmentMapFunction.js\";\nexport type { FulfilledPromise } from \"./types/FulfilledPromise.js\";\nexport type { IsAny } from \"./types/IsAny.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { PendingPromise } from \"./types/PendingPromise.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { RejectedPromise } from \"./types/RejectedPromise.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\nexport type { VariablesOption } from \"./types/VariablesOption.js\";\nexport type { DocumentationTypes } from \"./types/DocumentationTypes.js\";\n\nexport { argumentsObjectFromField } from \"./argumentsObjectFromField.js\";\nexport { canUseDOM } from \"./canUseDOM.js\";\nexport { checkDocument } from \"./checkDocument.js\";\nexport { cloneDeep } from \"./cloneDeep.js\";\nexport { compact } from \"./compact.js\";\nexport { createFragmentMap } from \"./createFragmentMap.js\";\nexport { createFulfilledPromise } from \"./createFulfilledPromise.js\";\nexport { createRejectedPromise } from \"./createRejectedPromise.js\";\nexport { dealias } from \"./dealias.js\";\nexport { decoratePromise } from \"./decoratePromise.js\";\nexport { DeepMerger } from \"./DeepMerger.js\";\nexport { getDefaultValues } from \"./getDefaultValues.js\";\nexport { getFragmentFromSelection } from \"./getFragmentFromSelection.js\";\nexport { getFragmentQueryDocument } from \"./getFragmentQueryDocument.js\";\nexport { getFragmentDefinition } from \"./getFragmentDefinition.js\";\nexport { getFragmentDefinitions } from \"./getFragmentDefinitions.js\";\nexport { getGraphQLErrorsFromResult } from \"./getGraphQLErrorsFromResult.js\";\nexport { getMainDefinition } from \"./getMainDefinition.js\";\nexport { getOperationDefinition } from \"./getOperationDefinition.js\";\nexport { getOperationName } from \"./getOperationName.js\";\nexport { getQueryDefinition } from \"./getQueryDefinition.js\";\nexport { getStoreKeyName } from \"./getStoreKeyName.js\";\nexport { graphQLResultHasError } from \"./graphQLResultHasError.js\";\nexport { hasDirectives } from \"./hasDirectives.js\";\nexport { hasForcedResolvers } from \"./hasForcedResolvers.js\";\nexport { isArray } from \"./isArray.js\";\nexport { isDocumentNode } from \"./isDocumentNode.js\";\nexport { isField } from \"./isField.js\";\nexport { isNonEmptyArray } from \"./isNonEmptyArray.js\";\nexport { isNonNullObject } from \"./isNonNullObject.js\";\nexport { isPlainObject } from \"./isPlainObject.js\";\nexport { makeReference } from \"./makeReference.js\";\nexport { makeUniqueId } from \"./makeUniqueId.js\";\nexport { maybeDeepFreeze } from \"./maybeDeepFreeze.js\";\nexport { mergeDeep } from \"./mergeDeep.js\";\nexport { mergeDeepArray } from \"./mergeDeepArray.js\";\nexport { mergeOptions } from \"./mergeOptions.js\";\nexport { omitDeep } from \"./omitDeep.js\";\nexport { preventUnhandledRejection } from \"./preventUnhandledRejection.js\";\nexport { removeDirectivesFromDocument } from \"./removeDirectivesFromDocument.js\";\nexport { removeMaskedFragmentSpreads } from \"./removeFragmentSpreads.js\";\nexport { resultKeyNameFromField } from \"./resultKeyNameFromField.js\";\nexport { shouldInclude } from \"./shouldInclude.js\";\nexport { storeKeyNameFromField } from \"./storeKeyNameFromField.js\";\nexport { stringifyForDisplay } from \"./stringifyForDisplay.js\";\nexport { toQueryResult } from \"./toQueryResult.js\";\nexport { filterMap } from \"./filterMap.js\";\n\nexport {\n getApolloCacheMemoryInternals,\n getApolloClientMemoryInternals,\n getInMemoryCacheMemoryInternals,\n registerGlobalCache,\n} from \"../internal/getMemoryInternals.js\";\n\nexport { AutoCleanedStrongCache, AutoCleanedWeakCache } from \"./caches.js\";\n\nexport type { ApplyHKT } from \"./types/ApplyHKT.js\";\nexport type { ApplyHKTImplementationWithDefault } from \"./types/ApplyHKTImplementationWithDefault.js\";\n"]}
@@ -0,0 +1,3 @@
1
+ import type { DocumentNode } from "graphql";
2
+ export declare function removeMaskedFragmentSpreads(document: DocumentNode): DocumentNode;
3
+ //# sourceMappingURL=removeFragmentSpreads.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { visit } from "graphql";
2
+ export function removeMaskedFragmentSpreads(document) {
3
+ return visit(document, {
4
+ FragmentSpread(node) {
5
+ if (!node.directives?.some(({ name }) => name.value === "unmask")) {
6
+ return null;
7
+ }
8
+ },
9
+ });
10
+ }
11
+ //# sourceMappingURL=removeFragmentSpreads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeFragmentSpreads.js","sourceRoot":"","sources":["../../../src/utilities/internal/removeFragmentSpreads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,UAAU,2BAA2B,CAAC,QAAsB;IAChE,OAAO,KAAK,CAAC,QAAQ,EAAE;QACrB,cAAc,CAAC,IAAI;YACjB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,EAAE,CAAC;gBAClE,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { DocumentNode } from \"graphql\";\nimport { visit } from \"graphql\";\n\nexport function removeMaskedFragmentSpreads(document: DocumentNode) {\n return visit(document, {\n FragmentSpread(node) {\n if (!node.directives?.some(({ name }) => name.value === \"unmask\")) {\n return null;\n }\n },\n });\n}\n"]}
@@ -0,0 +1,82 @@
1
+ import type { Observable, Observer, OperatorFunction, Subscription } from "rxjs";
2
+ import type { DataValue, ErrorLike, MaybeMasked, NetworkStatus } from "@apollo/client";
3
+ /**
4
+ * This namespace contains simplified interface versions of existing, complicated, types in Apollo Client.
5
+ * These interfaces are used in the documentation to provide a more readable
6
+ * and understandable API reference.
7
+ */
8
+ export declare namespace DocumentationTypes {
9
+ interface DataState<TData> {
10
+ /**
11
+ * An object containing the result of your GraphQL query after it completes.
12
+ *
13
+ * This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
14
+ *
15
+ * @docGroup
16
+ *
17
+ * 1. Operation data
18
+ */
19
+ data?: DataValue.Complete<TData> | DataValue.Streaming<TData> | DataValue.Partial<TData> | undefined;
20
+ /**
21
+ * Describes the completeness of `data`. - `empty`: No data could be fulfilled from the cache or the result is incomplete. `data` is `undefined`. - `partial`: Some data could be fulfilled from the cache but `data` is incomplete. This is only possible when `returnPartialData` is `true`. - `streaming`: `data` is incomplete as a result of a deferred query and the result is still streaming in. - `complete`: `data` is a fully satisfied query result fulfilled either from the cache or network.
22
+ *
23
+ * @docGroup
24
+ *
25
+ * 1. Operation data
26
+ */
27
+ dataState: "complete" | "streaming" | "partial" | "empty";
28
+ }
29
+ interface ApolloQueryResult<TData> extends DataState<TData> {
30
+ /**
31
+ * A single ErrorLike object describing the error that occured during the latest query execution.
32
+ *
33
+ * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
34
+ *
35
+ * @docGroup
36
+ *
37
+ * 1. Operation data
38
+ */
39
+ error?: ErrorLike;
40
+ /**
41
+ * If `true`, the query is still in flight and results have not yet been returned.
42
+ *
43
+ * @docGroup
44
+ *
45
+ * 2. Network info
46
+ */
47
+ loading: boolean;
48
+ /**
49
+ * A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)
50
+ *
51
+ * Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
52
+ *
53
+ * @docGroup
54
+ *
55
+ * 2. Network info
56
+ */
57
+ networkStatus: NetworkStatus;
58
+ /**
59
+ * Describes whether `data` is a complete or partial result. This flag is only set when `returnPartialData` is `true` in query options.
60
+ *
61
+ * @deprecated
62
+ *
63
+ * This field will be removed in a future version of Apollo Client.
64
+ *
65
+ * @docGroup
66
+ *
67
+ * 1. Operation data
68
+ */
69
+ partial: boolean;
70
+ }
71
+ interface RxjsObservable<TData> {
72
+ pipe<OperatorResult>(...operators: [
73
+ OperatorFunction<Observable<ApolloQueryResult<TData>>, OperatorResult>
74
+ ] | [
75
+ OperatorFunction<Observable<ApolloQueryResult<TData>>, unknown>,
76
+ ...OperatorFunction<unknown, unknown>[],
77
+ OperatorFunction<unknown, OperatorResult>
78
+ ]): Observable<OperatorResult>;
79
+ subscribe(observer: Partial<Observer<ApolloQueryResult<MaybeMasked<TData>>>> | ((value: ApolloQueryResult<MaybeMasked<TData>>) => void)): Subscription;
80
+ }
81
+ }
82
+ //# sourceMappingURL=DocumentationTypes.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DocumentationTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentationTypes.js","sourceRoot":"","sources":["../../../../src/utilities/internal/types/DocumentationTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n Observable,\n Observer,\n OperatorFunction,\n Subscription,\n} from \"rxjs\";\n\nimport type {\n DataValue,\n ErrorLike,\n MaybeMasked,\n NetworkStatus,\n} from \"@apollo/client\";\n\n/**\n * This namespace contains simplified interface versions of existing, complicated, types in Apollo Client.\n * These interfaces are used in the documentation to provide a more readable\n * and understandable API reference.\n */\nexport declare namespace DocumentationTypes {\n export interface DataState<TData> {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#data:member} */\n data?:\n | DataValue.Complete<TData>\n | DataValue.Streaming<TData>\n | DataValue.Partial<TData>\n | undefined;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#dataState:member} */\n dataState: \"complete\" | \"streaming\" | \"partial\" | \"empty\";\n }\n\n export interface ApolloQueryResult<TData> extends DataState<TData> {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#error:member} */\n error?: ErrorLike;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#loading:member} */\n loading: boolean;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#networkStatus:member} */\n networkStatus: NetworkStatus;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#partial:member} */\n partial: boolean;\n }\n\n export interface RxjsObservable<TData> {\n pipe<OperatorResult>(\n ...operators:\n | [\n OperatorFunction<\n Observable<ApolloQueryResult<TData>>,\n OperatorResult\n >,\n ]\n | [\n OperatorFunction<Observable<ApolloQueryResult<TData>>, unknown>,\n ...OperatorFunction<unknown, unknown>[],\n OperatorFunction<unknown, OperatorResult>,\n ]\n ): Observable<OperatorResult>;\n\n subscribe(\n observer:\n | Partial<Observer<ApolloQueryResult<MaybeMasked<TData>>>>\n | ((value: ApolloQueryResult<MaybeMasked<TData>>) => void)\n ): Subscription;\n }\n}\n"]}
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const version = "4.0.0-rc.3";
1
+ export const version = "4.0.0-rc.5";
2
2
  export const build = "esm";
3
3
  //# sourceMappingURL=version.js.map