@apollo/client 3.12.11 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +128 -0
- package/apollo-client.cjs +192 -20
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/config/jest/setup.js +2 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ObservableQuery.d.ts +3 -6
- package/core/ObservableQuery.js +6 -8
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +9 -4
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +16 -13
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +16 -13
- package/core/index.d.ts +2 -2
- package/core/index.js.map +1 -1
- package/core/watchQueryOptions.d.ts +50 -4
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +1 -1
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +1 -1
- package/package.json +1 -1
- package/react/hoc/types.d.ts +2 -3
- package/react/hoc/types.js.map +1 -1
- package/react/hooks/hooks.cjs +53 -7
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +53 -7
- package/react/hooks/index.d.ts +2 -0
- package/react/hooks/index.js +1 -0
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/internal/wrapHook.d.ts +2 -1
- package/react/hooks/internal/wrapHook.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +2 -1
- package/react/hooks/useBackgroundQuery.js +3 -1
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +2 -1
- package/react/hooks/useLoadableQuery.js +3 -1
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.js +3 -3
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +2 -1
- package/react/hooks/useQueryRefHandlers.js +3 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +45 -0
- package/react/hooks/useSuspenseFragment.js +49 -0
- package/react/hooks/useSuspenseFragment.js.map +1 -0
- package/react/hooks/useSuspenseQuery.d.ts +1 -1
- package/react/hooks/useSuspenseQuery.js +3 -1
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/internal/cache/FragmentReference.d.ts +37 -0
- package/react/internal/cache/FragmentReference.js +123 -0
- package/react/internal/cache/FragmentReference.js.map +1 -0
- package/react/internal/cache/SuspenseCache.d.ts +7 -2
- package/react/internal/cache/SuspenseCache.js +14 -0
- package/react/internal/cache/SuspenseCache.js.map +1 -1
- package/react/internal/cache/types.d.ts +8 -0
- package/react/internal/cache/types.js.map +1 -1
- package/react/internal/internal.cjs +124 -1
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +124 -1
- package/react/query-preloader/createQueryPreloader.d.ts +1 -37
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/types/types.d.ts +61 -5
- package/react/types/types.js.map +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/version.js +1 -1
|
@@ -8,7 +8,7 @@ var tslib = require('tslib');
|
|
|
8
8
|
var equality = require('@wry/equality');
|
|
9
9
|
var tsInvariant = require('ts-invariant');
|
|
10
10
|
|
|
11
|
-
var version = "3.
|
|
11
|
+
var version = "3.13.0";
|
|
12
12
|
|
|
13
13
|
function maybe(thunk) {
|
|
14
14
|
try {
|
|
@@ -366,10 +366,121 @@ var InternalQueryReference = (function () {
|
|
|
366
366
|
return InternalQueryReference;
|
|
367
367
|
}());
|
|
368
368
|
|
|
369
|
+
var FragmentReference = (function () {
|
|
370
|
+
function FragmentReference(client, watchFragmentOptions, options) {
|
|
371
|
+
var _this = this;
|
|
372
|
+
this.key = {};
|
|
373
|
+
this.listeners = new Set();
|
|
374
|
+
this.references = 0;
|
|
375
|
+
this.dispose = this.dispose.bind(this);
|
|
376
|
+
this.handleNext = this.handleNext.bind(this);
|
|
377
|
+
this.handleError = this.handleError.bind(this);
|
|
378
|
+
this.observable = client.watchFragment(watchFragmentOptions);
|
|
379
|
+
if (options.onDispose) {
|
|
380
|
+
this.onDispose = options.onDispose;
|
|
381
|
+
}
|
|
382
|
+
var diff = this.getDiff(client, watchFragmentOptions);
|
|
383
|
+
var startDisposeTimer = function () {
|
|
384
|
+
var _a;
|
|
385
|
+
if (!_this.references) {
|
|
386
|
+
_this.autoDisposeTimeoutId = setTimeout(_this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
this.promise =
|
|
390
|
+
diff.complete ?
|
|
391
|
+
utilities.createFulfilledPromise(diff.result)
|
|
392
|
+
: this.createPendingPromise();
|
|
393
|
+
this.subscribeToFragment();
|
|
394
|
+
this.promise.then(startDisposeTimer, startDisposeTimer);
|
|
395
|
+
}
|
|
396
|
+
FragmentReference.prototype.listen = function (listener) {
|
|
397
|
+
var _this = this;
|
|
398
|
+
this.listeners.add(listener);
|
|
399
|
+
return function () {
|
|
400
|
+
_this.listeners.delete(listener);
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
FragmentReference.prototype.retain = function () {
|
|
404
|
+
var _this = this;
|
|
405
|
+
this.references++;
|
|
406
|
+
clearTimeout(this.autoDisposeTimeoutId);
|
|
407
|
+
var disposed = false;
|
|
408
|
+
return function () {
|
|
409
|
+
if (disposed) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
disposed = true;
|
|
413
|
+
_this.references--;
|
|
414
|
+
setTimeout(function () {
|
|
415
|
+
if (!_this.references) {
|
|
416
|
+
_this.dispose();
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
FragmentReference.prototype.dispose = function () {
|
|
422
|
+
this.subscription.unsubscribe();
|
|
423
|
+
this.onDispose();
|
|
424
|
+
};
|
|
425
|
+
FragmentReference.prototype.onDispose = function () {
|
|
426
|
+
};
|
|
427
|
+
FragmentReference.prototype.subscribeToFragment = function () {
|
|
428
|
+
this.subscription = this.observable.subscribe(this.handleNext.bind(this), this.handleError.bind(this));
|
|
429
|
+
};
|
|
430
|
+
FragmentReference.prototype.handleNext = function (result) {
|
|
431
|
+
var _a;
|
|
432
|
+
switch (this.promise.status) {
|
|
433
|
+
case "pending": {
|
|
434
|
+
if (result.complete) {
|
|
435
|
+
return (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, result.data);
|
|
436
|
+
}
|
|
437
|
+
this.deliver(this.promise);
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
case "fulfilled": {
|
|
441
|
+
if (equality.equal(this.promise.value, result.data)) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
this.promise =
|
|
445
|
+
result.complete ?
|
|
446
|
+
utilities.createFulfilledPromise(result.data)
|
|
447
|
+
: this.createPendingPromise();
|
|
448
|
+
this.deliver(this.promise);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
FragmentReference.prototype.handleError = function (error) {
|
|
453
|
+
var _a;
|
|
454
|
+
(_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
455
|
+
};
|
|
456
|
+
FragmentReference.prototype.deliver = function (promise) {
|
|
457
|
+
this.listeners.forEach(function (listener) { return listener(promise); });
|
|
458
|
+
};
|
|
459
|
+
FragmentReference.prototype.createPendingPromise = function () {
|
|
460
|
+
var _this = this;
|
|
461
|
+
return utilities.wrapPromiseWithState(new Promise(function (resolve, reject) {
|
|
462
|
+
_this.resolve = resolve;
|
|
463
|
+
_this.reject = reject;
|
|
464
|
+
}));
|
|
465
|
+
};
|
|
466
|
+
FragmentReference.prototype.getDiff = function (client, options) {
|
|
467
|
+
var cache = client.cache;
|
|
468
|
+
var from = options.from, fragment = options.fragment, fragmentName = options.fragmentName;
|
|
469
|
+
var diff = cache.diff(tslib.__assign(tslib.__assign({}, options), { query: cache["getFragmentDoc"](fragment, fragmentName), returnPartialData: true, id: from, optimistic: true }));
|
|
470
|
+
return tslib.__assign(tslib.__assign({}, diff), { result: client["queryManager"].maskFragment({
|
|
471
|
+
fragment: fragment,
|
|
472
|
+
fragmentName: fragmentName,
|
|
473
|
+
data: diff.result,
|
|
474
|
+
}) });
|
|
475
|
+
};
|
|
476
|
+
return FragmentReference;
|
|
477
|
+
}());
|
|
478
|
+
|
|
369
479
|
var SuspenseCache = (function () {
|
|
370
480
|
function SuspenseCache(options) {
|
|
371
481
|
if (options === void 0) { options = Object.create(null); }
|
|
372
482
|
this.queryRefs = new trie.Trie(utilities.canUseWeakMap);
|
|
483
|
+
this.fragmentRefs = new trie.Trie(utilities.canUseWeakMap);
|
|
373
484
|
this.options = options;
|
|
374
485
|
}
|
|
375
486
|
SuspenseCache.prototype.getQueryRef = function (cacheKey, createObservable) {
|
|
@@ -384,6 +495,18 @@ var SuspenseCache = (function () {
|
|
|
384
495
|
}
|
|
385
496
|
return ref.current;
|
|
386
497
|
};
|
|
498
|
+
SuspenseCache.prototype.getFragmentRef = function (cacheKey, client, options) {
|
|
499
|
+
var ref = this.fragmentRefs.lookupArray(cacheKey);
|
|
500
|
+
if (!ref.current) {
|
|
501
|
+
ref.current = new FragmentReference(client, options, {
|
|
502
|
+
autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,
|
|
503
|
+
onDispose: function () {
|
|
504
|
+
delete ref.current;
|
|
505
|
+
},
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
return ref.current;
|
|
509
|
+
};
|
|
387
510
|
SuspenseCache.prototype.add = function (cacheKey, queryRef) {
|
|
388
511
|
var ref = this.queryRefs.lookupArray(cacheKey);
|
|
389
512
|
ref.current = queryRef;
|
|
@@ -1,43 +1,7 @@
|
|
|
1
1
|
import type { ApolloClient, DefaultContext, DocumentNode, ErrorPolicy, OperationVariables, RefetchWritePolicy, TypedDocumentNode, WatchQueryFetchPolicy } from "../../core/index.js";
|
|
2
2
|
import type { DeepPartial, OnlyRequiredProperties } from "../../utilities/index.js";
|
|
3
3
|
import type { PreloadedQueryRef } from "../internal/index.js";
|
|
4
|
-
import type { NoInfer } from "../index.js";
|
|
5
|
-
type VariablesOption<TVariables extends OperationVariables> = [
|
|
6
|
-
TVariables
|
|
7
|
-
] extends [never] ? {
|
|
8
|
-
/**
|
|
9
|
-
* An object containing all of the GraphQL variables your query requires to execute.
|
|
10
|
-
*
|
|
11
|
-
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
12
|
-
*
|
|
13
|
-
* @docGroup
|
|
14
|
-
*
|
|
15
|
-
* 1. Operation options
|
|
16
|
-
*/
|
|
17
|
-
variables?: Record<string, never>;
|
|
18
|
-
} : {} extends OnlyRequiredProperties<TVariables> ? {
|
|
19
|
-
/**
|
|
20
|
-
* An object containing all of the GraphQL variables your query requires to execute.
|
|
21
|
-
*
|
|
22
|
-
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
23
|
-
*
|
|
24
|
-
* @docGroup
|
|
25
|
-
*
|
|
26
|
-
* 1. Operation options
|
|
27
|
-
*/
|
|
28
|
-
variables?: TVariables;
|
|
29
|
-
} : {
|
|
30
|
-
/**
|
|
31
|
-
* An object containing all of the GraphQL variables your query requires to execute.
|
|
32
|
-
*
|
|
33
|
-
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
34
|
-
*
|
|
35
|
-
* @docGroup
|
|
36
|
-
*
|
|
37
|
-
* 1. Operation options
|
|
38
|
-
*/
|
|
39
|
-
variables: TVariables;
|
|
40
|
-
};
|
|
4
|
+
import type { NoInfer, VariablesOption } from "../index.js";
|
|
41
5
|
export type PreloadQueryFetchPolicy = Extract<WatchQueryFetchPolicy, "cache-first" | "network-only" | "no-cache" | "cache-and-network">;
|
|
42
6
|
export type PreloadQueryOptions<TVariables extends OperationVariables = OperationVariables> = {
|
|
43
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createQueryPreloader.js","sourceRoot":"","sources":["../../../src/react/query-preloader/createQueryPreloader.ts"],"names":[],"mappings":";AAeA,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"createQueryPreloader.js","sourceRoot":"","sources":["../../../src/react/query-preloader/createQueryPreloader.ts"],"names":[],"mappings":";AAeA,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAoHtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAyB;IAEzB,OAAO,QAAQ,CACb,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,CACP,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAED,IAAM,qBAAqB,GAAgC,UAAC,MAAM;IAChE,OAAO,SAAS,YAAY,CAI1B,KAA0D,EAC1D,OACmD;;QADnD,wBAAA,EAAA,UACgC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAEnD,IAAM,QAAQ,GAAG,IAAI,sBAAsB,CACzC,MAAM,CAAC,UAAU,CAAC,sBACb,OAAO,KACV,KAAK,OAAA,GACyB,CAAC,EACjC;YACE,oBAAoB,EAClB,MAAA,MAAA,MAAM,CAAC,cAAc,CAAC,KAAK,0CAAE,QAAQ,0CAAE,oBAAoB;SAC9D,CACF,CAAC;QAEF,OAAO,YAAY,CAAC,QAAQ,CAAyC,CAAC;IACxE,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type {\n ApolloClient,\n DefaultContext,\n DocumentNode,\n ErrorPolicy,\n OperationVariables,\n RefetchWritePolicy,\n TypedDocumentNode,\n WatchQueryFetchPolicy,\n WatchQueryOptions,\n} from \"../../core/index.js\";\nimport type {\n DeepPartial,\n OnlyRequiredProperties,\n} from \"../../utilities/index.js\";\nimport { InternalQueryReference, wrapQueryRef } from \"../internal/index.js\";\nimport type { PreloadedQueryRef } from \"../internal/index.js\";\nimport type { NoInfer, VariablesOption } from \"../index.js\";\nimport { wrapHook } from \"../hooks/internal/index.js\";\n\nexport type PreloadQueryFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport type PreloadQueryOptions<\n TVariables extends OperationVariables = OperationVariables,\n> = {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#canonizeResults:member} */\n canonizeResults?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: PreloadQueryFetchPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n} & VariablesOption<TVariables>;\n\ntype PreloadQueryOptionsArg<\n TVariables extends OperationVariables,\n TOptions = unknown,\n> = [TVariables] extends [never] ?\n [options?: PreloadQueryOptions<never> & TOptions]\n: {} extends OnlyRequiredProperties<TVariables> ?\n [\n options?: PreloadQueryOptions<NoInfer<TVariables>> &\n Omit<TOptions, \"variables\">,\n ]\n: [\n options: PreloadQueryOptions<NoInfer<TVariables>> &\n Omit<TOptions, \"variables\">,\n ];\n\n/**\n * A function that will begin loading a query when called. It's result can be\n * read by `useReadQuery` which will suspend until the query is loaded.\n * This is useful when you want to start loading a query as early as possible\n * outside of a React component.\n *\n * @example\n * ```js\n * const preloadQuery = createQueryPreloader(client);\n * const queryRef = preloadQuery(query, { variables, ...otherOptions });\n *\n * function App() {\n * return (\n * <Suspense fallback={<div>Loading</div>}>\n * <MyQuery />\n * </Suspense>\n * );\n * }\n *\n * function MyQuery() {\n * const { data } = useReadQuery(queryRef);\n *\n * // do something with `data`\n * }\n * ```\n */\nexport interface PreloadQueryFunction {\n /** {@inheritDoc @apollo/client!PreloadQueryFunction:interface} */\n <\n TData,\n TVariables extends OperationVariables,\n TOptions extends Omit<PreloadQueryOptions, \"variables\">,\n >(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>, TOptions>\n ): PreloadedQueryRef<\n TOptions[\"errorPolicy\"] extends \"ignore\" | \"all\" ?\n TOptions[\"returnPartialData\"] extends true ?\n DeepPartial<TData> | undefined\n : TData | undefined\n : TOptions[\"returnPartialData\"] extends true ? DeepPartial<TData>\n : TData,\n TVariables\n >;\n\n /** {@inheritDoc @apollo/client!PreloadQueryFunction:interface} */\n <TData = unknown, TVariables extends OperationVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: PreloadQueryOptions<NoInfer<TVariables>> & {\n returnPartialData: true;\n errorPolicy: \"ignore\" | \"all\";\n }\n ): PreloadedQueryRef<DeepPartial<TData> | undefined, TVariables>;\n\n /** {@inheritDoc @apollo/client!PreloadQueryFunction:interface} */\n <TData = unknown, TVariables extends OperationVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: PreloadQueryOptions<NoInfer<TVariables>> & {\n errorPolicy: \"ignore\" | \"all\";\n }\n ): PreloadedQueryRef<TData | undefined, TVariables>;\n\n /** {@inheritDoc @apollo/client!PreloadQueryFunction:interface} */\n <TData = unknown, TVariables extends OperationVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: PreloadQueryOptions<NoInfer<TVariables>> & {\n returnPartialData: true;\n }\n ): PreloadedQueryRef<DeepPartial<TData>, TVariables>;\n\n /** {@inheritDoc @apollo/client!PreloadQueryFunction:interface} */\n <TData = unknown, TVariables extends OperationVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>>\n ): PreloadedQueryRef<TData, TVariables>;\n}\n\n/**\n * A higher order function that returns a `preloadQuery` function which\n * can be used to begin loading a query with the given `client`. This is useful\n * when you want to start loading a query as early as possible outside of a\n * React component.\n *\n * > Refer to the [Suspense - Initiating queries outside React](https://www.apollographql.com/docs/react/data/suspense#initiating-queries-outside-react) section for a more in-depth overview.\n *\n * @param client - The `ApolloClient` instance that will be used to load queries\n * from the returned `preloadQuery` function.\n * @returns The `preloadQuery` function.\n *\n * @example\n * ```js\n * const preloadQuery = createQueryPreloader(client);\n * ```\n * @since 3.9.0\n */\nexport function createQueryPreloader(\n client: ApolloClient<any>\n): PreloadQueryFunction {\n return wrapHook(\n \"createQueryPreloader\",\n _createQueryPreloader,\n client\n )(client);\n}\n\nconst _createQueryPreloader: typeof createQueryPreloader = (client) => {\n return function preloadQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n >(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: PreloadQueryOptions<NoInfer<TVariables>> &\n VariablesOption<TVariables> = Object.create(null)\n ): PreloadedQueryRef<TData, TVariables> {\n const queryRef = new InternalQueryReference(\n client.watchQuery({\n ...options,\n query,\n } as WatchQueryOptions<any, any>),\n {\n autoDisposeTimeoutMs:\n client.defaultOptions.react?.suspense?.autoDisposeTimeoutMs,\n }\n );\n\n return wrapQueryRef(queryRef) as PreloadedQueryRef<TData, TVariables>;\n };\n};\n"]}
|
package/react/types/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as ReactTypes from "react";
|
|
2
2
|
import type { DocumentNode, GraphQLFormattedError } from "graphql";
|
|
3
3
|
import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
4
|
-
import type { Observable, ObservableSubscription } from "../../utilities/index.js";
|
|
4
|
+
import type { Observable, ObservableSubscription, OnlyRequiredProperties } from "../../utilities/index.js";
|
|
5
5
|
import type { FetchResult } from "../../link/core/index.js";
|
|
6
6
|
import type { ApolloError } from "../../errors/index.js";
|
|
7
|
-
import type { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy,
|
|
8
|
-
import type { MutationSharedOptions, SharedWatchQueryOptions } from "../../core/watchQueryOptions.js";
|
|
7
|
+
import type { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy, ApolloQueryResult, FetchMoreQueryOptions, ErrorPolicy, RefetchWritePolicy } from "../../core/index.js";
|
|
8
|
+
import type { MutationSharedOptions, SharedWatchQueryOptions, SubscribeToMoreFunction, UpdateQueryMapFn } from "../../core/watchQueryOptions.js";
|
|
9
9
|
import type { MaybeMasked, Unmasked } from "../../masking/index.js";
|
|
10
10
|
export type { QueryReference, QueryRef, PreloadedQueryRef, } from "../internal/index.js";
|
|
11
11
|
export type { DefaultContext as Context } from "../../core/index.js";
|
|
@@ -59,6 +59,10 @@ export interface QueryFunctionOptions<TData = any, TVariables extends OperationV
|
|
|
59
59
|
* @docGroup
|
|
60
60
|
*
|
|
61
61
|
* 1. Operation options
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* @deprecated This option will be removed in the next major version of Apollo Client.
|
|
65
|
+
* For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.
|
|
62
66
|
*/
|
|
63
67
|
onCompleted?: (data: MaybeMasked<TData>) => void;
|
|
64
68
|
/**
|
|
@@ -69,6 +73,10 @@ export interface QueryFunctionOptions<TData = any, TVariables extends OperationV
|
|
|
69
73
|
* @docGroup
|
|
70
74
|
*
|
|
71
75
|
* 1. Operation options
|
|
76
|
+
*
|
|
77
|
+
*
|
|
78
|
+
* @deprecated This option will be removed in the next major version of Apollo Client.
|
|
79
|
+
* For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.
|
|
72
80
|
*/
|
|
73
81
|
onError?: (error: ApolloError) => void;
|
|
74
82
|
/** @internal */
|
|
@@ -103,7 +111,7 @@ export interface ObservableQueryFields<TData, TVariables extends OperationVariab
|
|
|
103
111
|
*
|
|
104
112
|
* 3. Helper functions
|
|
105
113
|
*/
|
|
106
|
-
subscribeToMore: <
|
|
114
|
+
subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
|
|
107
115
|
/**
|
|
108
116
|
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
|
|
109
117
|
*
|
|
@@ -114,7 +122,7 @@ export interface ObservableQueryFields<TData, TVariables extends OperationVariab
|
|
|
114
122
|
*
|
|
115
123
|
* 3. Helper functions
|
|
116
124
|
*/
|
|
117
|
-
updateQuery:
|
|
125
|
+
updateQuery: (mapFn: UpdateQueryMapFn<TData, TVariables>) => void;
|
|
118
126
|
/**
|
|
119
127
|
* A function that enables you to re-execute the query, optionally passing in new `variables`.
|
|
120
128
|
*
|
|
@@ -251,6 +259,10 @@ export interface LazyQueryHookOptions<TData = any, TVariables extends OperationV
|
|
|
251
259
|
* @docGroup
|
|
252
260
|
*
|
|
253
261
|
* 1. Operation options
|
|
262
|
+
*
|
|
263
|
+
*
|
|
264
|
+
* @deprecated This option will be removed in the next major version of Apollo Client.
|
|
265
|
+
* For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.
|
|
254
266
|
*/
|
|
255
267
|
onCompleted?: (data: MaybeMasked<TData>) => void;
|
|
256
268
|
/**
|
|
@@ -261,6 +273,10 @@ export interface LazyQueryHookOptions<TData = any, TVariables extends OperationV
|
|
|
261
273
|
* @docGroup
|
|
262
274
|
*
|
|
263
275
|
* 1. Operation options
|
|
276
|
+
*
|
|
277
|
+
*
|
|
278
|
+
* @deprecated This option will be removed in the next major version of Apollo Client.
|
|
279
|
+
* For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.
|
|
264
280
|
*/
|
|
265
281
|
onError?: (error: ApolloError) => void;
|
|
266
282
|
/** @internal */
|
|
@@ -582,6 +598,10 @@ export interface BaseMutationOptions<TData = any, TVariables = OperationVariable
|
|
|
582
598
|
* @docGroup
|
|
583
599
|
*
|
|
584
600
|
* 1. Operation options
|
|
601
|
+
*
|
|
602
|
+
*
|
|
603
|
+
* @deprecated This option will be removed in the next major version of Apollo Client.
|
|
604
|
+
* If you don't want to synchronize your component state with the mutation, please use `useApolloClient` to get your ApolloClient instance and call `client.mutate` directly.
|
|
585
605
|
*/
|
|
586
606
|
ignoreResults?: boolean;
|
|
587
607
|
}
|
|
@@ -756,5 +776,41 @@ export interface SubscriptionCurrentObservable {
|
|
|
756
776
|
query?: Observable<any>;
|
|
757
777
|
subscription?: ObservableSubscription;
|
|
758
778
|
}
|
|
779
|
+
export type VariablesOption<TVariables extends OperationVariables> = [
|
|
780
|
+
TVariables
|
|
781
|
+
] extends [never] ? {
|
|
782
|
+
/**
|
|
783
|
+
* An object containing all of the GraphQL variables your query requires to execute.
|
|
784
|
+
*
|
|
785
|
+
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
786
|
+
*
|
|
787
|
+
* @docGroup
|
|
788
|
+
*
|
|
789
|
+
* 1. Operation options
|
|
790
|
+
*/
|
|
791
|
+
variables?: Record<string, never>;
|
|
792
|
+
} : Record<string, never> extends OnlyRequiredProperties<TVariables> ? {
|
|
793
|
+
/**
|
|
794
|
+
* An object containing all of the GraphQL variables your query requires to execute.
|
|
795
|
+
*
|
|
796
|
+
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
797
|
+
*
|
|
798
|
+
* @docGroup
|
|
799
|
+
*
|
|
800
|
+
* 1. Operation options
|
|
801
|
+
*/
|
|
802
|
+
variables?: TVariables;
|
|
803
|
+
} : {
|
|
804
|
+
/**
|
|
805
|
+
* An object containing all of the GraphQL variables your query requires to execute.
|
|
806
|
+
*
|
|
807
|
+
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
808
|
+
*
|
|
809
|
+
* @docGroup
|
|
810
|
+
*
|
|
811
|
+
* 1. Operation options
|
|
812
|
+
*/
|
|
813
|
+
variables: TVariables;
|
|
814
|
+
};
|
|
759
815
|
export type { NoInfer } from "../../utilities/index.js";
|
|
760
816
|
//# sourceMappingURL=types.d.ts.map
|
package/react/types/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import type * as ReactTypes from \"react\";\nimport type { DocumentNode, GraphQLFormattedError } from \"graphql\";\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\n\nimport type {\n Observable,\n ObservableSubscription,\n} from \"../../utilities/index.js\";\nimport type { FetchResult } from \"../../link/core/index.js\";\nimport type { ApolloError } from \"../../errors/index.js\";\nimport type {\n ApolloCache,\n ApolloClient,\n DefaultContext,\n FetchPolicy,\n NetworkStatus,\n ObservableQuery,\n OperationVariables,\n InternalRefetchQueriesInclude,\n WatchQueryOptions,\n WatchQueryFetchPolicy,\n SubscribeToMoreOptions,\n ApolloQueryResult,\n FetchMoreQueryOptions,\n ErrorPolicy,\n RefetchWritePolicy,\n} from \"../../core/index.js\";\nimport type {\n MutationSharedOptions,\n SharedWatchQueryOptions,\n} from \"../../core/watchQueryOptions.js\";\nimport type { MaybeMasked, Unmasked } from \"../../masking/index.js\";\n\n/* QueryReference type */\n\nexport type {\n QueryReference,\n QueryRef,\n PreloadedQueryRef,\n} from \"../internal/index.js\";\n\n/* Common types */\n\nexport type { DefaultContext as Context } from \"../../core/index.js\";\n\nexport type CommonOptions<TOptions> = TOptions & {\n client?: ApolloClient<object>;\n};\n\n/* Query types */\n\nexport interface BaseQueryOptions<\n TVariables extends OperationVariables = OperationVariables,\n TData = any,\n> extends SharedWatchQueryOptions<TVariables, TData> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#ssr:member} */\n ssr?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n}\n\nexport interface QueryFunctionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseQueryOptions<TVariables, TData> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#skip:member} */\n skip?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#onCompleted:member} */\n onCompleted?: (data: MaybeMasked<TData>) => void;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#onError:member} */\n onError?: (error: ApolloError) => void;\n\n // Default WatchQueryOptions for this useQuery, providing initial values for\n // unspecified options, superseding client.defaultOptions.watchQuery (option\n // by option, not whole), but never overriding options previously passed to\n // useQuery (or options added/modified later by other means).\n // TODO What about about default values that are expensive to evaluate?\n /** @internal */\n defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;\n}\n\nexport interface ObservableQueryFields<\n TData,\n TVariables extends OperationVariables,\n> {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#startPolling:member} */\n startPolling: (pollInterval: number) => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#stopPolling:member} */\n stopPolling: () => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#subscribeToMore:member} */\n subscribeToMore: <\n TSubscriptionData = TData,\n TSubscriptionVariables extends OperationVariables = TVariables,\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >\n ) => () => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#updateQuery:member} */\n updateQuery: <TVars extends OperationVariables = TVariables>(\n mapFn: (\n previousQueryResult: Unmasked<TData>,\n options: Pick<WatchQueryOptions<TVars, TData>, \"variables\">\n ) => Unmasked<TData>\n ) => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: (\n variables?: Partial<TVariables>\n ) => Promise<ApolloQueryResult<MaybeMasked<TData>>>;\n /** @internal */\n reobserve: (\n newOptions?: Partial<WatchQueryOptions<TVariables, TData>>,\n newNetworkStatus?: NetworkStatus\n ) => Promise<ApolloQueryResult<MaybeMasked<TData>>>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#variables:member} */\n variables: TVariables | undefined;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#fetchMore:member} */\n fetchMore: <\n TFetchData = TData,\n TFetchVars extends OperationVariables = TVariables,\n >(\n fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {\n updateQuery?: (\n previousQueryResult: Unmasked<TData>,\n options: {\n fetchMoreResult: Unmasked<TFetchData>;\n variables: TFetchVars;\n }\n ) => Unmasked<TData>;\n }\n ) => Promise<ApolloQueryResult<MaybeMasked<TFetchData>>>;\n}\n\nexport interface QueryResult<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends ObservableQueryFields<TData, TVariables> {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#client:member} */\n client: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#observable:member} */\n observable: ObservableQuery<TData, TVariables>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#data:member} */\n data: MaybeMasked<TData> | undefined;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#previousData:member} */\n previousData?: MaybeMasked<TData>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#error:member} */\n error?: ApolloError;\n /**\n * @deprecated This property will be removed in a future version of Apollo Client.\n * Please use `error.graphQLErrors` instead.\n */\n errors?: ReadonlyArray<GraphQLFormattedError>;\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#called:member} */\n called: boolean;\n}\n\nexport interface QueryDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {\n children?: (result: QueryResult<TData, TVariables>) => ReactTypes.ReactNode;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#query:member} */\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface QueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {}\n\nexport interface LazyQueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseQueryOptions<TVariables, TData> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#onCompleted:member} */\n onCompleted?: (data: MaybeMasked<TData>) => void;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#onError:member} */\n onError?: (error: ApolloError) => void;\n\n /** @internal */\n defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;\n}\nexport interface LazyQueryHookExecOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends LazyQueryHookOptions<TData, TVariables> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type SuspenseQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface SuspenseQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: TVariables;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#canonizeResults:member} */\n canonizeResults?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy_suspense:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: SuspenseQueryHookFetchPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#queryKey:member} */\n queryKey?: string | number | any[];\n\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#skip_deprecated:member}\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useSuspenseQuery } from '@apollo/client';\n *\n * const { data } = useSuspenseQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\nexport type BackgroundQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface BackgroundQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> extends Pick<\n QueryHookOptions<TData, TVariables>,\n | \"client\"\n | \"variables\"\n | \"errorPolicy\"\n | \"context\"\n | \"canonizeResults\"\n | \"returnPartialData\"\n | \"refetchWritePolicy\"\n > {\n fetchPolicy?: BackgroundQueryHookFetchPolicy;\n queryKey?: string | number | any[];\n\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#skip_deprecated:member}\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useBackgroundQuery } from '@apollo/client';\n *\n * const [queryRef] = useBackgroundQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\nexport type LoadableQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface LoadableQueryHookOptions {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#canonizeResults:member} */\n canonizeResults?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: LoadableQueryHookFetchPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#queryKey:member} */\n queryKey?: string | number | any[];\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n}\n\n/**\n * @deprecated This type will be removed in the next major version of Apollo Client\n */\nexport interface QueryLazyOptions<TVariables> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: TVariables;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n}\n\n/**\n * @deprecated This type will be removed in the next major version of Apollo Client\n */\nexport type LazyQueryResult<\n TData,\n TVariables extends OperationVariables,\n> = QueryResult<TData, TVariables>;\n\n/**\n * @deprecated This type will be removed in the next major version of Apollo Client\n */\nexport type QueryTuple<\n TData,\n TVariables extends OperationVariables,\n> = LazyQueryResultTuple<TData, TVariables>;\n\nexport type LazyQueryExecFunction<\n TData,\n TVariables extends OperationVariables,\n> = (\n options?: Partial<LazyQueryHookExecOptions<TData, TVariables>>\n) => Promise<QueryResult<TData, TVariables>>;\n\nexport type LazyQueryResultTuple<\n TData,\n TVariables extends OperationVariables,\n> = [\n execute: LazyQueryExecFunction<TData, TVariables>,\n result: QueryResult<TData, TVariables>,\n];\n\n/* Mutation types */\n\nexport type RefetchQueriesFunction = (\n ...args: any[]\n) => InternalRefetchQueriesInclude;\n\nexport interface BaseMutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#client:member} */\n client?: ApolloClient<object>;\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#notifyOnNetworkStatusChange:member} */\n notifyOnNetworkStatusChange?: boolean;\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#onCompleted:member} */\n onCompleted?: (\n data: MaybeMasked<TData>,\n clientOptions?: BaseMutationOptions\n ) => void;\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#onError:member} */\n onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#ignoreResults:member} */\n ignoreResults?: boolean;\n}\n\nexport interface MutationFunctionOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#mutation:member} */\n mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationResult<TData = any> {\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#data:member} */\n data?: MaybeMasked<TData> | null;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#error:member} */\n error?: ApolloError;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#loading:member} */\n loading: boolean;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#called:member} */\n called: boolean;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#client:member} */\n client: ApolloClient<object>;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#reset:member} */\n reset: () => void;\n}\n\nexport declare type MutationFunction<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n) => Promise<FetchResult<MaybeMasked<TData>>>;\n\nexport interface MutationHookOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {}\n\nexport interface MutationDataOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type MutationTuple<\n TData,\n TVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = [\n mutate: (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n // TODO This FetchResult<TData> seems strange here, as opposed to an\n // ApolloQueryResult<TData>\n ) => Promise<FetchResult<MaybeMasked<TData>>>,\n result: MutationResult<TData>,\n];\n\n/* Subscription types */\n\nexport interface OnDataOptions<TData = any> {\n client: ApolloClient<object>;\n data: SubscriptionResult<TData>;\n}\n\nexport interface OnSubscriptionDataOptions<TData = any> {\n client: ApolloClient<object>;\n subscriptionData: SubscriptionResult<TData>;\n}\n\nexport interface BaseSubscriptionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> {\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#variables:member} */\n variables?: TVariables;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: FetchPolicy;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#shouldResubscribe:member} */\n shouldResubscribe?:\n | boolean\n | ((options: BaseSubscriptionOptions<TData, TVariables>) => boolean);\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#client:member} */\n client?: ApolloClient<object>;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#skip:member} */\n skip?: boolean;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#context:member} */\n context?: DefaultContext;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#extensions:member} */\n extensions?: Record<string, any>;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onComplete:member} */\n onComplete?: () => void;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onData:member} */\n onData?: (options: OnDataOptions<TData>) => any;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onSubscriptionData:member} */\n onSubscriptionData?: (options: OnSubscriptionDataOptions<TData>) => any;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onError:member} */\n onError?: (error: ApolloError) => void;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onSubscriptionComplete:member} */\n onSubscriptionComplete?: () => void;\n /**\n * {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#ignoreResults:member}\n * @defaultValue `false`\n */\n ignoreResults?: boolean;\n}\n\nexport interface SubscriptionResult<TData = any, TVariables = any> {\n /** {@inheritDoc @apollo/client!SubscriptionResultDocumentation#loading:member} */\n loading: boolean;\n /** {@inheritDoc @apollo/client!SubscriptionResultDocumentation#data:member} */\n data?: MaybeMasked<TData>;\n /** {@inheritDoc @apollo/client!SubscriptionResultDocumentation#error:member} */\n error?: ApolloError;\n // This was added by the legacy useSubscription type, and is tested in unit\n // tests, but probably shouldn’t be added to the result.\n /**\n * @internal\n */\n variables?: TVariables;\n}\n\nexport interface SubscriptionHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {}\n\n/**\n * @deprecated This type is not used anymore. It will be removed in the next major version of Apollo Client\n */\nexport interface SubscriptionDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?:\n | null\n | ((result: SubscriptionResult<TData>) => ReactTypes.ReactNode);\n}\n\nexport interface SubscriptionCurrentObservable {\n query?: Observable<any>;\n subscription?: ObservableSubscription;\n}\n\nexport type { NoInfer } from \"../../utilities/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import type * as ReactTypes from \"react\";\nimport type { DocumentNode, GraphQLFormattedError } from \"graphql\";\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\n\nimport type {\n Observable,\n ObservableSubscription,\n OnlyRequiredProperties,\n} from \"../../utilities/index.js\";\nimport type { FetchResult } from \"../../link/core/index.js\";\nimport type { ApolloError } from \"../../errors/index.js\";\nimport type {\n ApolloCache,\n ApolloClient,\n DefaultContext,\n FetchPolicy,\n NetworkStatus,\n ObservableQuery,\n OperationVariables,\n InternalRefetchQueriesInclude,\n WatchQueryOptions,\n WatchQueryFetchPolicy,\n ApolloQueryResult,\n FetchMoreQueryOptions,\n ErrorPolicy,\n RefetchWritePolicy,\n} from \"../../core/index.js\";\nimport type {\n MutationSharedOptions,\n SharedWatchQueryOptions,\n SubscribeToMoreFunction,\n UpdateQueryMapFn,\n} from \"../../core/watchQueryOptions.js\";\nimport type { MaybeMasked, Unmasked } from \"../../masking/index.js\";\n\n/* QueryReference type */\n\nexport type {\n QueryReference,\n QueryRef,\n PreloadedQueryRef,\n} from \"../internal/index.js\";\n\n/* Common types */\n\nexport type { DefaultContext as Context } from \"../../core/index.js\";\n\nexport type CommonOptions<TOptions> = TOptions & {\n client?: ApolloClient<object>;\n};\n\n/* Query types */\n\nexport interface BaseQueryOptions<\n TVariables extends OperationVariables = OperationVariables,\n TData = any,\n> extends SharedWatchQueryOptions<TVariables, TData> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#ssr:member} */\n ssr?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n}\n\nexport interface QueryFunctionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseQueryOptions<TVariables, TData> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#skip:member} */\n skip?: boolean;\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#onCompleted:member}\n *\n * @deprecated This option will be removed in the next major version of Apollo Client.\n * For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.\n */\n onCompleted?: (data: MaybeMasked<TData>) => void;\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#onError:member}\n *\n * @deprecated This option will be removed in the next major version of Apollo Client.\n * For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.\n */\n onError?: (error: ApolloError) => void;\n\n // Default WatchQueryOptions for this useQuery, providing initial values for\n // unspecified options, superseding client.defaultOptions.watchQuery (option\n // by option, not whole), but never overriding options previously passed to\n // useQuery (or options added/modified later by other means).\n // TODO What about about default values that are expensive to evaluate?\n /** @internal */\n defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;\n}\n\nexport interface ObservableQueryFields<\n TData,\n TVariables extends OperationVariables,\n> {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#startPolling:member} */\n startPolling: (pollInterval: number) => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#stopPolling:member} */\n stopPolling: () => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#subscribeToMore:member} */\n subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#updateQuery:member} */\n updateQuery: (mapFn: UpdateQueryMapFn<TData, TVariables>) => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: (\n variables?: Partial<TVariables>\n ) => Promise<ApolloQueryResult<MaybeMasked<TData>>>;\n /** @internal */\n reobserve: (\n newOptions?: Partial<WatchQueryOptions<TVariables, TData>>,\n newNetworkStatus?: NetworkStatus\n ) => Promise<ApolloQueryResult<MaybeMasked<TData>>>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#variables:member} */\n variables: TVariables | undefined;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#fetchMore:member} */\n fetchMore: <\n TFetchData = TData,\n TFetchVars extends OperationVariables = TVariables,\n >(\n fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {\n updateQuery?: (\n previousQueryResult: Unmasked<TData>,\n options: {\n fetchMoreResult: Unmasked<TFetchData>;\n variables: TFetchVars;\n }\n ) => Unmasked<TData>;\n }\n ) => Promise<ApolloQueryResult<MaybeMasked<TFetchData>>>;\n}\n\nexport interface QueryResult<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends ObservableQueryFields<TData, TVariables> {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#client:member} */\n client: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#observable:member} */\n observable: ObservableQuery<TData, TVariables>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#data:member} */\n data: MaybeMasked<TData> | undefined;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#previousData:member} */\n previousData?: MaybeMasked<TData>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#error:member} */\n error?: ApolloError;\n /**\n * @deprecated This property will be removed in a future version of Apollo Client.\n * Please use `error.graphQLErrors` instead.\n */\n errors?: ReadonlyArray<GraphQLFormattedError>;\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#called:member} */\n called: boolean;\n}\n\nexport interface QueryDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {\n children?: (result: QueryResult<TData, TVariables>) => ReactTypes.ReactNode;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#query:member} */\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface QueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {}\n\nexport interface LazyQueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseQueryOptions<TVariables, TData> {\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#onCompleted:member}\n *\n * @deprecated This option will be removed in the next major version of Apollo Client.\n * For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.\n */\n onCompleted?: (data: MaybeMasked<TData>) => void;\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#onError:member}\n *\n * @deprecated This option will be removed in the next major version of Apollo Client.\n * For more context, please see the [related issue](https://github.com/apollographql/apollo-client/issues/12352) on GitHub.\n */\n onError?: (error: ApolloError) => void;\n\n /** @internal */\n defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;\n}\nexport interface LazyQueryHookExecOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends LazyQueryHookOptions<TData, TVariables> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type SuspenseQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface SuspenseQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: TVariables;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#canonizeResults:member} */\n canonizeResults?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy_suspense:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: SuspenseQueryHookFetchPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#queryKey:member} */\n queryKey?: string | number | any[];\n\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#skip_deprecated:member}\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useSuspenseQuery } from '@apollo/client';\n *\n * const { data } = useSuspenseQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\nexport type BackgroundQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface BackgroundQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> extends Pick<\n QueryHookOptions<TData, TVariables>,\n | \"client\"\n | \"variables\"\n | \"errorPolicy\"\n | \"context\"\n | \"canonizeResults\"\n | \"returnPartialData\"\n | \"refetchWritePolicy\"\n > {\n fetchPolicy?: BackgroundQueryHookFetchPolicy;\n queryKey?: string | number | any[];\n\n /**\n * {@inheritDoc @apollo/client!QueryOptionsDocumentation#skip_deprecated:member}\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useBackgroundQuery } from '@apollo/client';\n *\n * const [queryRef] = useBackgroundQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\nexport type LoadableQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface LoadableQueryHookOptions {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#canonizeResults:member} */\n canonizeResults?: boolean;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient<any>;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: LoadableQueryHookFetchPolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#queryKey:member} */\n queryKey?: string | number | any[];\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n}\n\n/**\n * @deprecated This type will be removed in the next major version of Apollo Client\n */\nexport interface QueryLazyOptions<TVariables> {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: TVariables;\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n}\n\n/**\n * @deprecated This type will be removed in the next major version of Apollo Client\n */\nexport type LazyQueryResult<\n TData,\n TVariables extends OperationVariables,\n> = QueryResult<TData, TVariables>;\n\n/**\n * @deprecated This type will be removed in the next major version of Apollo Client\n */\nexport type QueryTuple<\n TData,\n TVariables extends OperationVariables,\n> = LazyQueryResultTuple<TData, TVariables>;\n\nexport type LazyQueryExecFunction<\n TData,\n TVariables extends OperationVariables,\n> = (\n options?: Partial<LazyQueryHookExecOptions<TData, TVariables>>\n) => Promise<QueryResult<TData, TVariables>>;\n\nexport type LazyQueryResultTuple<\n TData,\n TVariables extends OperationVariables,\n> = [\n execute: LazyQueryExecFunction<TData, TVariables>,\n result: QueryResult<TData, TVariables>,\n];\n\n/* Mutation types */\n\nexport type RefetchQueriesFunction = (\n ...args: any[]\n) => InternalRefetchQueriesInclude;\n\nexport interface BaseMutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#client:member} */\n client?: ApolloClient<object>;\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#notifyOnNetworkStatusChange:member} */\n notifyOnNetworkStatusChange?: boolean;\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#onCompleted:member} */\n onCompleted?: (\n data: MaybeMasked<TData>,\n clientOptions?: BaseMutationOptions\n ) => void;\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#onError:member} */\n onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;\n /**\n * {@inheritDoc @apollo/client!MutationOptionsDocumentation#ignoreResults:member}\n *\n * @deprecated This option will be removed in the next major version of Apollo Client.\n * If you don't want to synchronize your component state with the mutation, please use `useApolloClient` to get your ApolloClient instance and call `client.mutate` directly.\n */\n ignoreResults?: boolean;\n}\n\nexport interface MutationFunctionOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#mutation:member} */\n mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationResult<TData = any> {\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#data:member} */\n data?: MaybeMasked<TData> | null;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#error:member} */\n error?: ApolloError;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#loading:member} */\n loading: boolean;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#called:member} */\n called: boolean;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#client:member} */\n client: ApolloClient<object>;\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#reset:member} */\n reset: () => void;\n}\n\nexport declare type MutationFunction<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n) => Promise<FetchResult<MaybeMasked<TData>>>;\n\nexport interface MutationHookOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {}\n\nexport interface MutationDataOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type MutationTuple<\n TData,\n TVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = [\n mutate: (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n // TODO This FetchResult<TData> seems strange here, as opposed to an\n // ApolloQueryResult<TData>\n ) => Promise<FetchResult<MaybeMasked<TData>>>,\n result: MutationResult<TData>,\n];\n\n/* Subscription types */\n\nexport interface OnDataOptions<TData = any> {\n client: ApolloClient<object>;\n data: SubscriptionResult<TData>;\n}\n\nexport interface OnSubscriptionDataOptions<TData = any> {\n client: ApolloClient<object>;\n subscriptionData: SubscriptionResult<TData>;\n}\n\nexport interface BaseSubscriptionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> {\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#variables:member} */\n variables?: TVariables;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: FetchPolicy;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#shouldResubscribe:member} */\n shouldResubscribe?:\n | boolean\n | ((options: BaseSubscriptionOptions<TData, TVariables>) => boolean);\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#client:member} */\n client?: ApolloClient<object>;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#skip:member} */\n skip?: boolean;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#context:member} */\n context?: DefaultContext;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#extensions:member} */\n extensions?: Record<string, any>;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onComplete:member} */\n onComplete?: () => void;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onData:member} */\n onData?: (options: OnDataOptions<TData>) => any;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onSubscriptionData:member} */\n onSubscriptionData?: (options: OnSubscriptionDataOptions<TData>) => any;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onError:member} */\n onError?: (error: ApolloError) => void;\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#onSubscriptionComplete:member} */\n onSubscriptionComplete?: () => void;\n /**\n * {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#ignoreResults:member}\n * @defaultValue `false`\n */\n ignoreResults?: boolean;\n}\n\nexport interface SubscriptionResult<TData = any, TVariables = any> {\n /** {@inheritDoc @apollo/client!SubscriptionResultDocumentation#loading:member} */\n loading: boolean;\n /** {@inheritDoc @apollo/client!SubscriptionResultDocumentation#data:member} */\n data?: MaybeMasked<TData>;\n /** {@inheritDoc @apollo/client!SubscriptionResultDocumentation#error:member} */\n error?: ApolloError;\n // This was added by the legacy useSubscription type, and is tested in unit\n // tests, but probably shouldn’t be added to the result.\n /**\n * @internal\n */\n variables?: TVariables;\n}\n\nexport interface SubscriptionHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {}\n\n/**\n * @deprecated This type is not used anymore. It will be removed in the next major version of Apollo Client\n */\nexport interface SubscriptionDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?:\n | null\n | ((result: SubscriptionResult<TData>) => ReactTypes.ReactNode);\n}\n\nexport interface SubscriptionCurrentObservable {\n query?: Observable<any>;\n subscription?: ObservableSubscription;\n}\n\nexport type VariablesOption<TVariables extends OperationVariables> =\n [TVariables] extends [never] ?\n {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: Record<string, never>;\n }\n : Record<string, never> extends OnlyRequiredProperties<TVariables> ?\n {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: TVariables;\n }\n : {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables: TVariables;\n };\n\nexport type { NoInfer } from \"../../utilities/index.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.cjs","sources":["../../version.js","maybe.js","global.js","../common/makeUniqueId.js","../common/stringifyForDisplay.js","invariantWrappers.js","index.js"],"sourcesContent":["export var version = \"3.12.11\";\n//# sourceMappingURL=version.js.map","export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe.js\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) || // We don't expect the Function constructor ever to be invoked at runtime, as\n// long as at least one of globalThis, window, self, or global is defined, so\n// we are under no obligation to make it easy for static analysis tools to\n// detect syntactic usage of the Function constructor. If you think you can\n// improve your static analysis to detect this obfuscation, think again. This\n// is an arms race you cannot win, at least not in JavaScript.\nmaybe(function () {\n return maybe.constructor(\"return this\")();\n}));\n//# sourceMappingURL=global.js.map","var prefixCounts = new Map();\n// These IDs won't be globally unique, but they will be unique within this\n// process, thanks to the counter, and unguessable thanks to the random suffix.\nexport function makeUniqueId(prefix) {\n var count = prefixCounts.get(prefix) || 1;\n prefixCounts.set(prefix, count + 1);\n return \"\".concat(prefix, \":\").concat(count, \":\").concat(Math.random().toString(36).slice(2));\n}\n//# sourceMappingURL=makeUniqueId.js.map","import { makeUniqueId } from \"./makeUniqueId.js\";\nexport function stringifyForDisplay(value, space) {\n if (space === void 0) { space = 0; }\n var undefId = makeUniqueId(\"stringifyForDisplay\");\n return JSON.stringify(value, function (key, value) {\n return value === void 0 ? undefId : value;\n }, space)\n .split(JSON.stringify(undefId))\n .join(\"<undefined>\");\n}\n//# sourceMappingURL=stringifyForDisplay.js.map","import { invariant as originalInvariant, InvariantError } from \"ts-invariant\";\nimport { version } from \"../../version.js\";\nimport global from \"./global.js\";\nimport { stringifyForDisplay } from \"../common/stringifyForDisplay.js\";\nfunction wrap(fn) {\n return function (message) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof message === \"number\") {\n var arg0 = message;\n message = getHandledErrorMsg(arg0);\n if (!message) {\n message = getFallbackErrorMsg(arg0, args);\n args = [];\n }\n }\n fn.apply(void 0, [message].concat(args));\n };\n}\nvar invariant = Object.assign(function invariant(condition, message) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (!condition) {\n originalInvariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));\n }\n}, {\n debug: wrap(originalInvariant.debug),\n log: wrap(originalInvariant.log),\n warn: wrap(originalInvariant.warn),\n error: wrap(originalInvariant.error),\n});\n/**\n * Returns an InvariantError.\n *\n * `message` can only be a string, a concatenation of strings, or a ternary statement\n * that results in a string. This will be enforced on build, where the message will\n * be replaced with a message number.\n * String substitutions with %s are supported and will also return\n * pretty-stringified objects.\n * Excess `optionalParams` will be swallowed.\n */\nfunction newInvariantError(message) {\n var optionalParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n optionalParams[_i - 1] = arguments[_i];\n }\n return new InvariantError(getHandledErrorMsg(message, optionalParams) ||\n getFallbackErrorMsg(message, optionalParams));\n}\nvar ApolloErrorMessageHandler = Symbol.for(\"ApolloErrorMessageHandler_\" + version);\nfunction stringify(arg) {\n if (typeof arg == \"string\") {\n return arg;\n }\n try {\n return stringifyForDisplay(arg, 2).slice(0, 1000);\n }\n catch (_a) {\n return \"<non-serializable>\";\n }\n}\nfunction getHandledErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return (global[ApolloErrorMessageHandler] &&\n global[ApolloErrorMessageHandler](message, messageArgs.map(stringify)));\n}\nfunction getFallbackErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return \"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#\".concat(encodeURIComponent(JSON.stringify({\n version: version,\n message: message,\n args: messageArgs.map(stringify),\n })));\n}\nexport { invariant, InvariantError, newInvariantError, ApolloErrorMessageHandler, };\n//# sourceMappingURL=invariantWrappers.js.map","import { invariant, newInvariantError, InvariantError, } from \"./invariantWrappers.js\";\nexport { maybe } from \"./maybe.js\";\nexport { default as global } from \"./global.js\";\nexport { invariant, newInvariantError, InvariantError };\n/**\n * @deprecated we do not use this internally anymore,\n * it is just exported for backwards compatibility\n */\n// this file is extempt from automatic `__DEV__` replacement\n// so we have to write it out here\n// @ts-ignore\nexport var DEV = globalThis.__DEV__ !== false;\nexport { DEV as __DEV__ };\n//# sourceMappingURL=index.js.map"],"names":["originalInvariant","InvariantError","global"],"mappings":";;;;;;AAAO,IAAI,OAAO,GAAG,SAAS;;ACAvB,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI;AACR,QAAQ,OAAO,KAAK,EAAE,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,EAAE,EAAE,GAAG;AAClB;;ACJA,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,UAAU,CAAC,EAAE,CAAC;AACzD,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;AACvC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AAMzC,KAAK,CAAC,YAAY;AAClB,IAAI,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;AAC9C,CAAC,CAAC;;ACZF,IAAI,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;AAGtB,SAAS,YAAY,CAAC,MAAM,EAAE;AACrC,IAAI,IAAI,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9C,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACxC,IAAI,OAAO,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACjG;;ACNO,SAAS,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE;AAClD,IAAI,IAAI,KAAK,KA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;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"globals.cjs","sources":["../../version.js","maybe.js","global.js","../common/makeUniqueId.js","../common/stringifyForDisplay.js","invariantWrappers.js","index.js"],"sourcesContent":["export var version = \"3.13.0\";\n//# sourceMappingURL=version.js.map","export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe.js\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) || // We don't expect the Function constructor ever to be invoked at runtime, as\n// long as at least one of globalThis, window, self, or global is defined, so\n// we are under no obligation to make it easy for static analysis tools to\n// detect syntactic usage of the Function constructor. If you think you can\n// improve your static analysis to detect this obfuscation, think again. This\n// is an arms race you cannot win, at least not in JavaScript.\nmaybe(function () {\n return maybe.constructor(\"return this\")();\n}));\n//# sourceMappingURL=global.js.map","var prefixCounts = new Map();\n// These IDs won't be globally unique, but they will be unique within this\n// process, thanks to the counter, and unguessable thanks to the random suffix.\nexport function makeUniqueId(prefix) {\n var count = prefixCounts.get(prefix) || 1;\n prefixCounts.set(prefix, count + 1);\n return \"\".concat(prefix, \":\").concat(count, \":\").concat(Math.random().toString(36).slice(2));\n}\n//# sourceMappingURL=makeUniqueId.js.map","import { makeUniqueId } from \"./makeUniqueId.js\";\nexport function stringifyForDisplay(value, space) {\n if (space === void 0) { space = 0; }\n var undefId = makeUniqueId(\"stringifyForDisplay\");\n return JSON.stringify(value, function (key, value) {\n return value === void 0 ? undefId : value;\n }, space)\n .split(JSON.stringify(undefId))\n .join(\"<undefined>\");\n}\n//# sourceMappingURL=stringifyForDisplay.js.map","import { invariant as originalInvariant, InvariantError } from \"ts-invariant\";\nimport { version } from \"../../version.js\";\nimport global from \"./global.js\";\nimport { stringifyForDisplay } from \"../common/stringifyForDisplay.js\";\nfunction wrap(fn) {\n return function (message) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof message === \"number\") {\n var arg0 = message;\n message = getHandledErrorMsg(arg0);\n if (!message) {\n message = getFallbackErrorMsg(arg0, args);\n args = [];\n }\n }\n fn.apply(void 0, [message].concat(args));\n };\n}\nvar invariant = Object.assign(function invariant(condition, message) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (!condition) {\n originalInvariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));\n }\n}, {\n debug: wrap(originalInvariant.debug),\n log: wrap(originalInvariant.log),\n warn: wrap(originalInvariant.warn),\n error: wrap(originalInvariant.error),\n});\n/**\n * Returns an InvariantError.\n *\n * `message` can only be a string, a concatenation of strings, or a ternary statement\n * that results in a string. This will be enforced on build, where the message will\n * be replaced with a message number.\n * String substitutions with %s are supported and will also return\n * pretty-stringified objects.\n * Excess `optionalParams` will be swallowed.\n */\nfunction newInvariantError(message) {\n var optionalParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n optionalParams[_i - 1] = arguments[_i];\n }\n return new InvariantError(getHandledErrorMsg(message, optionalParams) ||\n getFallbackErrorMsg(message, optionalParams));\n}\nvar ApolloErrorMessageHandler = Symbol.for(\"ApolloErrorMessageHandler_\" + version);\nfunction stringify(arg) {\n if (typeof arg == \"string\") {\n return arg;\n }\n try {\n return stringifyForDisplay(arg, 2).slice(0, 1000);\n }\n catch (_a) {\n return \"<non-serializable>\";\n }\n}\nfunction getHandledErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return (global[ApolloErrorMessageHandler] &&\n global[ApolloErrorMessageHandler](message, messageArgs.map(stringify)));\n}\nfunction getFallbackErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return \"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#\".concat(encodeURIComponent(JSON.stringify({\n version: version,\n message: message,\n args: messageArgs.map(stringify),\n })));\n}\nexport { invariant, InvariantError, newInvariantError, ApolloErrorMessageHandler, };\n//# sourceMappingURL=invariantWrappers.js.map","import { invariant, newInvariantError, InvariantError, } from \"./invariantWrappers.js\";\nexport { maybe } from \"./maybe.js\";\nexport { default as global } from \"./global.js\";\nexport { invariant, newInvariantError, InvariantError };\n/**\n * @deprecated we do not use this internally anymore,\n * it is just exported for backwards compatibility\n */\n// this file is extempt from automatic `__DEV__` replacement\n// so we have to write it out here\n// @ts-ignore\nexport var DEV = globalThis.__DEV__ !== false;\nexport { DEV as __DEV__ };\n//# sourceMappingURL=index.js.map"],"names":["originalInvariant","InvariantError","global"],"mappings":";;;;;;AAAO,IAAI,OAAO,GAAG,QAAQ;;ACAtB,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI;AACR,QAAQ,OAAO,KAAK,EAAE,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,EAAE,EAAE,GAAG;AAClB;;ACJA,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,UAAU,CAAC,EAAE,CAAC;AACzD,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;AACvC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AAMzC,KAAK,CAAC,YAAY;AAClB,IAAI,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;AAC9C,CAAC,CAAC;;ACZF,IAAI,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;AAGtB,SAAS,YAAY,CAAC,MAAM,EAAE;AACrC,IAAI,IAAI,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9C,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACxC,IA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