@apollo/client 3.10.2 → 3.10.4

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 (78) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/apollo-client.cjs +107 -100
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +82 -9
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +82 -9
  8. package/cache/core/cache.js +8 -4
  9. package/cache/core/cache.js.map +1 -1
  10. package/cache/inmemory/writeToStore.js +1 -1
  11. package/cache/inmemory/writeToStore.js.map +1 -1
  12. package/core/ApolloClient.js +2 -1
  13. package/core/ApolloClient.js.map +1 -1
  14. package/core/ObservableQuery.js +1 -1
  15. package/core/ObservableQuery.js.map +1 -1
  16. package/core/QueryInfo.js +7 -11
  17. package/core/QueryInfo.js.map +1 -1
  18. package/core/core.cjs +5 -7
  19. package/core/core.cjs.map +1 -1
  20. package/core/core.cjs.native.js +5 -7
  21. package/dev/dev.cjs +32 -27
  22. package/dev/dev.cjs.map +1 -1
  23. package/dev/dev.cjs.native.js +32 -27
  24. package/invariantErrorCodes.js +32 -26
  25. package/package.json +19 -19
  26. package/react/context/ApolloConsumer.d.ts +1 -1
  27. package/react/context/ApolloConsumer.js.map +1 -1
  28. package/react/hooks/hooks.cjs +3 -0
  29. package/react/hooks/hooks.cjs.map +1 -1
  30. package/react/hooks/hooks.cjs.native.js +3 -0
  31. package/react/hooks/useBackgroundQuery.d.ts +10 -13
  32. package/react/hooks/useBackgroundQuery.js.map +1 -1
  33. package/react/hooks/useLoadableQuery.d.ts +2 -2
  34. package/react/hooks/useLoadableQuery.js +2 -1
  35. package/react/hooks/useLoadableQuery.js.map +1 -1
  36. package/react/hooks/useQueryRefHandlers.d.ts +3 -3
  37. package/react/hooks/useQueryRefHandlers.js +3 -2
  38. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  39. package/react/hooks/useReadQuery.d.ts +2 -2
  40. package/react/hooks/useReadQuery.js +2 -1
  41. package/react/hooks/useReadQuery.js.map +1 -1
  42. package/react/internal/cache/QueryReference.d.ts +68 -6
  43. package/react/internal/cache/QueryReference.js +4 -0
  44. package/react/internal/cache/QueryReference.js.map +1 -1
  45. package/react/internal/index.d.ts +2 -2
  46. package/react/internal/index.js +1 -1
  47. package/react/internal/index.js.map +1 -1
  48. package/react/internal/internal.cjs +92 -0
  49. package/react/internal/internal.cjs.map +1 -1
  50. package/react/internal/internal.cjs.native.js +92 -0
  51. package/react/parser/index.js +5 -5
  52. package/react/parser/parser.cjs +5 -5
  53. package/react/parser/parser.cjs.map +1 -1
  54. package/react/parser/parser.cjs.native.js +5 -5
  55. package/react/query-preloader/createQueryPreloader.d.ts +6 -6
  56. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  57. package/react/types/types.d.ts +2 -2
  58. package/react/types/types.js.map +1 -1
  59. package/testing/core/core.cjs +4 -4
  60. package/testing/core/core.cjs.map +1 -1
  61. package/testing/core/core.cjs.native.js +4 -4
  62. package/testing/core/mocking/mockLink.js +5 -5
  63. package/testing/core/mocking/mockLink.js.map +1 -1
  64. package/testing/matchers/toBeDisposed.js +4 -13
  65. package/testing/matchers/toBeDisposed.js.map +1 -1
  66. package/utilities/globals/globals.cjs +1 -1
  67. package/utilities/globals/globals.cjs.map +1 -1
  68. package/utilities/globals/globals.cjs.native.js +1 -1
  69. package/utilities/graphql/DocumentTransform.js +1 -1
  70. package/utilities/graphql/directives.js +4 -4
  71. package/utilities/graphql/fragments.js +3 -3
  72. package/utilities/graphql/getFromAST.js +8 -8
  73. package/utilities/graphql/storeUtils.js +1 -1
  74. package/utilities/graphql/transform.js +2 -2
  75. package/utilities/utilities.cjs +19 -19
  76. package/utilities/utilities.cjs.map +1 -1
  77. package/utilities/utilities.cjs.native.js +19 -19
  78. package/version.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"parser.cjs","sources":["../../utilities/caching/getMemoryInternals.js","index.js"],"sourcesContent":["import { __assign, __spreadArray } from \"tslib\";\nimport { cacheSizes } from \"./sizes.js\";\nvar globalCaches = {};\nexport function registerGlobalCache(name, getSize) {\n globalCaches[name] = getSize;\n}\n/**\n * For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n * @internal\n */\nexport var getApolloClientMemoryInternals = globalThis.__DEV__ !== false ?\n _getApolloClientMemoryInternals\n : undefined;\n/**\n * For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n * @internal\n */\nexport var getInMemoryCacheMemoryInternals = globalThis.__DEV__ !== false ?\n _getInMemoryCacheMemoryInternals\n : undefined;\n/**\n * For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n * @internal\n */\nexport var getApolloCacheMemoryInternals = globalThis.__DEV__ !== false ?\n _getApolloCacheMemoryInternals\n : undefined;\nfunction getCurrentCacheSizes() {\n // `defaultCacheSizes` is a `const enum` that will be inlined during build, so we have to reconstruct it's shape here\n var defaults = {\n parser: 1000 /* defaultCacheSizes[\"parser\"] */,\n canonicalStringify: 1000 /* defaultCacheSizes[\"canonicalStringify\"] */,\n print: 2000 /* defaultCacheSizes[\"print\"] */,\n \"documentTransform.cache\": 2000 /* defaultCacheSizes[\"documentTransform.cache\"] */,\n \"queryManager.getDocumentInfo\": 2000 /* defaultCacheSizes[\"queryManager.getDocumentInfo\"] */,\n \"PersistedQueryLink.persistedQueryHashes\": 2000 /* defaultCacheSizes[\"PersistedQueryLink.persistedQueryHashes\"] */,\n \"fragmentRegistry.transform\": 2000 /* defaultCacheSizes[\"fragmentRegistry.transform\"] */,\n \"fragmentRegistry.lookup\": 1000 /* defaultCacheSizes[\"fragmentRegistry.lookup\"] */,\n \"fragmentRegistry.findFragmentSpreads\": 4000 /* defaultCacheSizes[\"fragmentRegistry.findFragmentSpreads\"] */,\n \"cache.fragmentQueryDocuments\": 1000 /* defaultCacheSizes[\"cache.fragmentQueryDocuments\"] */,\n \"removeTypenameFromVariables.getVariableDefinitions\": 2000 /* defaultCacheSizes[\"removeTypenameFromVariables.getVariableDefinitions\"] */,\n \"inMemoryCache.maybeBroadcastWatch\": 5000 /* defaultCacheSizes[\"inMemoryCache.maybeBroadcastWatch\"] */,\n \"inMemoryCache.executeSelectionSet\": 50000 /* defaultCacheSizes[\"inMemoryCache.executeSelectionSet\"] */,\n \"inMemoryCache.executeSubSelectedArray\": 10000 /* defaultCacheSizes[\"inMemoryCache.executeSubSelectedArray\"] */,\n };\n return Object.fromEntries(Object.entries(defaults).map(function (_a) {\n var k = _a[0], v = _a[1];\n return [\n k,\n cacheSizes[k] || v,\n ];\n }));\n}\nfunction _getApolloClientMemoryInternals() {\n var _a, _b, _c, _d, _e;\n if (!(globalThis.__DEV__ !== false))\n throw new Error(\"only supported in development mode\");\n return {\n limits: getCurrentCacheSizes(),\n sizes: __assign({ print: (_a = globalCaches.print) === null || _a === void 0 ? void 0 : _a.call(globalCaches), parser: (_b = globalCaches.parser) === null || _b === void 0 ? void 0 : _b.call(globalCaches), canonicalStringify: (_c = globalCaches.canonicalStringify) === null || _c === void 0 ? void 0 : _c.call(globalCaches), links: linkInfo(this.link), queryManager: {\n getDocumentInfo: this[\"queryManager\"][\"transformCache\"].size,\n documentTransforms: transformInfo(this[\"queryManager\"].documentTransform),\n } }, (_e = (_d = this.cache).getMemoryInternals) === null || _e === void 0 ? void 0 : _e.call(_d)),\n };\n}\nfunction _getApolloCacheMemoryInternals() {\n return {\n cache: {\n fragmentQueryDocuments: getWrapperInformation(this[\"getFragmentDoc\"]),\n },\n };\n}\nfunction _getInMemoryCacheMemoryInternals() {\n var fragments = this.config.fragments;\n return __assign(__assign({}, _getApolloCacheMemoryInternals.apply(this)), { addTypenameDocumentTransform: transformInfo(this[\"addTypenameTransform\"]), inMemoryCache: {\n executeSelectionSet: getWrapperInformation(this[\"storeReader\"][\"executeSelectionSet\"]),\n executeSubSelectedArray: getWrapperInformation(this[\"storeReader\"][\"executeSubSelectedArray\"]),\n maybeBroadcastWatch: getWrapperInformation(this[\"maybeBroadcastWatch\"]),\n }, fragmentRegistry: {\n findFragmentSpreads: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.findFragmentSpreads),\n lookup: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.lookup),\n transform: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.transform),\n } });\n}\nfunction isWrapper(f) {\n return !!f && \"dirtyKey\" in f;\n}\nfunction getWrapperInformation(f) {\n return isWrapper(f) ? f.size : undefined;\n}\nfunction isDefined(value) {\n return value != null;\n}\nfunction transformInfo(transform) {\n return recurseTransformInfo(transform).map(function (cache) { return ({ cache: cache }); });\n}\nfunction recurseTransformInfo(transform) {\n return transform ?\n __spreadArray(__spreadArray([\n getWrapperInformation(transform === null || transform === void 0 ? void 0 : transform[\"performWork\"])\n ], recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform[\"left\"]), true), recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform[\"right\"]), true).filter(isDefined)\n : [];\n}\nfunction linkInfo(link) {\n var _a;\n return link ?\n __spreadArray(__spreadArray([\n (_a = link === null || link === void 0 ? void 0 : link.getMemoryInternals) === null || _a === void 0 ? void 0 : _a.call(link)\n ], linkInfo(link === null || link === void 0 ? void 0 : link.left), true), linkInfo(link === null || link === void 0 ? void 0 : link.right), true).filter(isDefined)\n : [];\n}\n//# sourceMappingURL=getMemoryInternals.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport { AutoCleanedWeakCache, cacheSizes, } from \"../../utilities/index.js\";\nimport { registerGlobalCache } from \"../../utilities/caching/getMemoryInternals.js\";\nexport var DocumentType;\n(function (DocumentType) {\n DocumentType[DocumentType[\"Query\"] = 0] = \"Query\";\n DocumentType[DocumentType[\"Mutation\"] = 1] = \"Mutation\";\n DocumentType[DocumentType[\"Subscription\"] = 2] = \"Subscription\";\n})(DocumentType || (DocumentType = {}));\nvar cache;\nexport function operationName(type) {\n var name;\n switch (type) {\n case DocumentType.Query:\n name = \"Query\";\n break;\n case DocumentType.Mutation:\n name = \"Mutation\";\n break;\n case DocumentType.Subscription:\n name = \"Subscription\";\n break;\n }\n return name;\n}\n// This parser is mostly used to safety check incoming documents.\nexport function parser(document) {\n if (!cache) {\n cache = new AutoCleanedWeakCache(cacheSizes.parser || 1000 /* defaultCacheSizes.parser */);\n }\n var cached = cache.get(document);\n if (cached)\n return cached;\n var variables, type, name;\n invariant(!!document && !!document.kind, 59, document);\n var fragments = [];\n var queries = [];\n var mutations = [];\n var subscriptions = [];\n for (var _i = 0, _a = document.definitions; _i < _a.length; _i++) {\n var x = _a[_i];\n if (x.kind === \"FragmentDefinition\") {\n fragments.push(x);\n continue;\n }\n if (x.kind === \"OperationDefinition\") {\n switch (x.operation) {\n case \"query\":\n queries.push(x);\n break;\n case \"mutation\":\n mutations.push(x);\n break;\n case \"subscription\":\n subscriptions.push(x);\n break;\n }\n }\n }\n invariant(!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length, 60);\n invariant(\n queries.length + mutations.length + subscriptions.length <= 1,\n 61,\n document,\n queries.length,\n subscriptions.length,\n mutations.length\n );\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length)\n type = DocumentType.Subscription;\n var definitions = queries.length ? queries\n : mutations.length ? mutations\n : subscriptions;\n invariant(definitions.length === 1, 62, document, definitions.length);\n var definition = definitions[0];\n variables = definition.variableDefinitions || [];\n if (definition.name && definition.name.kind === \"Name\") {\n name = definition.name.value;\n }\n else {\n name = \"data\"; // fallback to using data if no name\n }\n var payload = { name: name, type: type, variables: variables };\n cache.set(document, payload);\n return payload;\n}\nparser.resetCache = function () {\n cache = undefined;\n};\nif (globalThis.__DEV__ !== false) {\n registerGlobalCache(\"parser\", function () { return (cache ? cache.size : 0); });\n}\nexport function verifyDocumentType(document, type) {\n var operation = parser(document);\n var requiredOperationName = operationName(type);\n var usedOperationName = operationName(operation.type);\n invariant(\n operation.type === type,\n 63,\n requiredOperationName,\n required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AACrC,KAAK;AACL,SAAS;AACT,QAAQ,IAAI,GAAG,MAAM,CAAC;AACtB,KAAK;AACL,IAAI,IAAI,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AACnE,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACjC,IAAI,OAAO,OAAO,CAAC;AACnB,CAAC;AACD,MAAM,CAAC,UAAU,GAAG,YAAY;AAChC,IAAI,KAAK,GAAG,SAAS,CAAC;AACtB,CAAC,CAAC;AACF,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE;AAClC,IAAI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,KAAK,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACpF,CAAC;AACM,SAAS,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE;AACnD,IAAI,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACrC,IAAI,IAAI,qBAAqB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AACpD,IAAI,IAAI,iBAAiB,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC1D,IAAIA,iBAAS;AACb,QAAQ,SAAS,CAAC,IAAI,KAAK,IAAI;AAC/B,QAAQ,EAAE;AACV,QAAQ,qBAAqB;AAC7B,QAAQ,qBAAqB;AAC7B,QAAQ,iBAAiB;AACzB,KAAK,CAAC;AACN;;;;;;"}
1
+ {"version":3,"file":"parser.cjs","sources":["../../utilities/caching/getMemoryInternals.js","index.js"],"sourcesContent":["import { __assign, __spreadArray } from \"tslib\";\nimport { cacheSizes } from \"./sizes.js\";\nvar globalCaches = {};\nexport function registerGlobalCache(name, getSize) {\n globalCaches[name] = getSize;\n}\n/**\n * For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n * @internal\n */\nexport var getApolloClientMemoryInternals = globalThis.__DEV__ !== false ?\n _getApolloClientMemoryInternals\n : undefined;\n/**\n * For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n * @internal\n */\nexport var getInMemoryCacheMemoryInternals = globalThis.__DEV__ !== false ?\n _getInMemoryCacheMemoryInternals\n : undefined;\n/**\n * For internal purposes only - please call `ApolloClient.getMemoryInternals` instead\n * @internal\n */\nexport var getApolloCacheMemoryInternals = globalThis.__DEV__ !== false ?\n _getApolloCacheMemoryInternals\n : undefined;\nfunction getCurrentCacheSizes() {\n // `defaultCacheSizes` is a `const enum` that will be inlined during build, so we have to reconstruct it's shape here\n var defaults = {\n parser: 1000 /* defaultCacheSizes[\"parser\"] */,\n canonicalStringify: 1000 /* defaultCacheSizes[\"canonicalStringify\"] */,\n print: 2000 /* defaultCacheSizes[\"print\"] */,\n \"documentTransform.cache\": 2000 /* defaultCacheSizes[\"documentTransform.cache\"] */,\n \"queryManager.getDocumentInfo\": 2000 /* defaultCacheSizes[\"queryManager.getDocumentInfo\"] */,\n \"PersistedQueryLink.persistedQueryHashes\": 2000 /* defaultCacheSizes[\"PersistedQueryLink.persistedQueryHashes\"] */,\n \"fragmentRegistry.transform\": 2000 /* defaultCacheSizes[\"fragmentRegistry.transform\"] */,\n \"fragmentRegistry.lookup\": 1000 /* defaultCacheSizes[\"fragmentRegistry.lookup\"] */,\n \"fragmentRegistry.findFragmentSpreads\": 4000 /* defaultCacheSizes[\"fragmentRegistry.findFragmentSpreads\"] */,\n \"cache.fragmentQueryDocuments\": 1000 /* defaultCacheSizes[\"cache.fragmentQueryDocuments\"] */,\n \"removeTypenameFromVariables.getVariableDefinitions\": 2000 /* defaultCacheSizes[\"removeTypenameFromVariables.getVariableDefinitions\"] */,\n \"inMemoryCache.maybeBroadcastWatch\": 5000 /* defaultCacheSizes[\"inMemoryCache.maybeBroadcastWatch\"] */,\n \"inMemoryCache.executeSelectionSet\": 50000 /* defaultCacheSizes[\"inMemoryCache.executeSelectionSet\"] */,\n \"inMemoryCache.executeSubSelectedArray\": 10000 /* defaultCacheSizes[\"inMemoryCache.executeSubSelectedArray\"] */,\n };\n return Object.fromEntries(Object.entries(defaults).map(function (_a) {\n var k = _a[0], v = _a[1];\n return [\n k,\n cacheSizes[k] || v,\n ];\n }));\n}\nfunction _getApolloClientMemoryInternals() {\n var _a, _b, _c, _d, _e;\n if (!(globalThis.__DEV__ !== false))\n throw new Error(\"only supported in development mode\");\n return {\n limits: getCurrentCacheSizes(),\n sizes: __assign({ print: (_a = globalCaches.print) === null || _a === void 0 ? void 0 : _a.call(globalCaches), parser: (_b = globalCaches.parser) === null || _b === void 0 ? void 0 : _b.call(globalCaches), canonicalStringify: (_c = globalCaches.canonicalStringify) === null || _c === void 0 ? void 0 : _c.call(globalCaches), links: linkInfo(this.link), queryManager: {\n getDocumentInfo: this[\"queryManager\"][\"transformCache\"].size,\n documentTransforms: transformInfo(this[\"queryManager\"].documentTransform),\n } }, (_e = (_d = this.cache).getMemoryInternals) === null || _e === void 0 ? void 0 : _e.call(_d)),\n };\n}\nfunction _getApolloCacheMemoryInternals() {\n return {\n cache: {\n fragmentQueryDocuments: getWrapperInformation(this[\"getFragmentDoc\"]),\n },\n };\n}\nfunction _getInMemoryCacheMemoryInternals() {\n var fragments = this.config.fragments;\n return __assign(__assign({}, _getApolloCacheMemoryInternals.apply(this)), { addTypenameDocumentTransform: transformInfo(this[\"addTypenameTransform\"]), inMemoryCache: {\n executeSelectionSet: getWrapperInformation(this[\"storeReader\"][\"executeSelectionSet\"]),\n executeSubSelectedArray: getWrapperInformation(this[\"storeReader\"][\"executeSubSelectedArray\"]),\n maybeBroadcastWatch: getWrapperInformation(this[\"maybeBroadcastWatch\"]),\n }, fragmentRegistry: {\n findFragmentSpreads: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.findFragmentSpreads),\n lookup: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.lookup),\n transform: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.transform),\n } });\n}\nfunction isWrapper(f) {\n return !!f && \"dirtyKey\" in f;\n}\nfunction getWrapperInformation(f) {\n return isWrapper(f) ? f.size : undefined;\n}\nfunction isDefined(value) {\n return value != null;\n}\nfunction transformInfo(transform) {\n return recurseTransformInfo(transform).map(function (cache) { return ({ cache: cache }); });\n}\nfunction recurseTransformInfo(transform) {\n return transform ?\n __spreadArray(__spreadArray([\n getWrapperInformation(transform === null || transform === void 0 ? void 0 : transform[\"performWork\"])\n ], recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform[\"left\"]), true), recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform[\"right\"]), true).filter(isDefined)\n : [];\n}\nfunction linkInfo(link) {\n var _a;\n return link ?\n __spreadArray(__spreadArray([\n (_a = link === null || link === void 0 ? void 0 : link.getMemoryInternals) === null || _a === void 0 ? void 0 : _a.call(link)\n ], linkInfo(link === null || link === void 0 ? void 0 : link.left), true), linkInfo(link === null || link === void 0 ? void 0 : link.right), true).filter(isDefined)\n : [];\n}\n//# sourceMappingURL=getMemoryInternals.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport { AutoCleanedWeakCache, cacheSizes, } from \"../../utilities/index.js\";\nimport { registerGlobalCache } from \"../../utilities/caching/getMemoryInternals.js\";\nexport var DocumentType;\n(function (DocumentType) {\n DocumentType[DocumentType[\"Query\"] = 0] = \"Query\";\n DocumentType[DocumentType[\"Mutation\"] = 1] = \"Mutation\";\n DocumentType[DocumentType[\"Subscription\"] = 2] = \"Subscription\";\n})(DocumentType || (DocumentType = {}));\nvar cache;\nexport function operationName(type) {\n var name;\n switch (type) {\n case DocumentType.Query:\n name = \"Query\";\n break;\n case DocumentType.Mutation:\n name = \"Mutation\";\n break;\n case DocumentType.Subscription:\n name = \"Subscription\";\n break;\n }\n return name;\n}\n// This parser is mostly used to safety check incoming documents.\nexport function parser(document) {\n if (!cache) {\n cache = new AutoCleanedWeakCache(cacheSizes.parser || 1000 /* defaultCacheSizes.parser */);\n }\n var cached = cache.get(document);\n if (cached)\n return cached;\n var variables, type, name;\n invariant(!!document && !!document.kind, 60, document);\n var fragments = [];\n var queries = [];\n var mutations = [];\n var subscriptions = [];\n for (var _i = 0, _a = document.definitions; _i < _a.length; _i++) {\n var x = _a[_i];\n if (x.kind === \"FragmentDefinition\") {\n fragments.push(x);\n continue;\n }\n if (x.kind === \"OperationDefinition\") {\n switch (x.operation) {\n case \"query\":\n queries.push(x);\n break;\n case \"mutation\":\n mutations.push(x);\n break;\n case \"subscription\":\n subscriptions.push(x);\n break;\n }\n }\n }\n invariant(!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length, 61);\n invariant(\n queries.length + mutations.length + subscriptions.length <= 1,\n 62,\n document,\n queries.length,\n subscriptions.length,\n mutations.length\n );\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length)\n type = DocumentType.Subscription;\n var definitions = queries.length ? queries\n : mutations.length ? mutations\n : subscriptions;\n invariant(definitions.length === 1, 63, document, definitions.length);\n var definition = definitions[0];\n variables = definition.variableDefinitions || [];\n if (definition.name && definition.name.kind === \"Name\") {\n name = definition.name.value;\n }\n else {\n name = \"data\"; // fallback to using data if no name\n }\n var payload = { name: name, type: type, variables: variables };\n cache.set(document, payload);\n return payload;\n}\nparser.resetCache = function () {\n cache = undefined;\n};\nif (globalThis.__DEV__ !== false) {\n registerGlobalCache(\"parser\", function () { return (cache ? cache.size : 0); });\n}\nexport function verifyDocumentType(document, type) {\n var operation = parser(document);\n var requiredOperationName = operationName(type);\n var usedOperationName = operationName(operation.type);\n invariant(\n operation.type === type,\n 64,\n requiredOperationName,\n requiredOperationName,\n usedOperationName\n );\n}\n//# sourceMappingURL=index.js.map"],"names":["DocumentType","AutoCleanedWeakCache","cacheSizes","invariant"],"mappings":";;;;;;;;AAEA,IAAI,YAAY,GAAG,EAAE,CAAC;AACf,SAAS,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE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,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACjC,IAAI,OAAO,OAAO,CAAC;AACnB,CAAC;AACD,MAAM,CAAC,UAAU,GAAG,YAAY;AAChC,IAAI,KAAK,GAAG,SAAS,CAAC;AACtB,CAAC,CAAC;AACF,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE;AAClC,IAAI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,KAAK,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACpF,CAAC;AACM,SAAS,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE;AACnD,IAAI,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACrC,IAAI,IAAI,qBAAqB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AACpD,IAAI,IAAI,iBAAiB,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC1D,IAAIA,iBAAS;AACb,QAAQ,SAAS,CAAC,IAAI,KAAK,IAAI;AAC/B,QAAQ,EAAE;AACV,QAAQ,qBAAqB;AAC7B,QAAQ,qBAAqB;AAC7B,QAAQ,iBAAiB;AACzB,KAAK,CAAC;AACN;;;;;;"}
@@ -41,7 +41,7 @@ function parser(document) {
41
41
  if (cached)
42
42
  return cached;
43
43
  var variables, type, name;
44
- globals.invariant(!!document && !!document.kind, 59, document);
44
+ globals.invariant(!!document && !!document.kind, 60, document);
45
45
  var fragments = [];
46
46
  var queries = [];
47
47
  var mutations = [];
@@ -69,10 +69,10 @@ function parser(document) {
69
69
  globals.invariant(!fragments.length ||
70
70
  queries.length ||
71
71
  mutations.length ||
72
- subscriptions.length, 60);
72
+ subscriptions.length, 61);
73
73
  globals.invariant(
74
74
  queries.length + mutations.length + subscriptions.length <= 1,
75
- 61,
75
+ 62,
76
76
  document,
77
77
  queries.length,
78
78
  subscriptions.length,
@@ -84,7 +84,7 @@ function parser(document) {
84
84
  var definitions = queries.length ? queries
85
85
  : mutations.length ? mutations
86
86
  : subscriptions;
87
- globals.invariant(definitions.length === 1, 62, document, definitions.length);
87
+ globals.invariant(definitions.length === 1, 63, document, definitions.length);
88
88
  var definition = definitions[0];
89
89
  variables = definition.variableDefinitions || [];
90
90
  if (definition.name && definition.name.kind === "Name") {
@@ -109,7 +109,7 @@ function verifyDocumentType(document, type) {
109
109
  var usedOperationName = operationName(operation.type);
110
110
  globals.invariant(
111
111
  operation.type === type,
112
- 63,
112
+ 64,
113
113
  requiredOperationName,
114
114
  requiredOperationName,
115
115
  usedOperationName
@@ -1,6 +1,6 @@
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
- import type { QueryReference } from "../internal/index.js";
3
+ import type { PreloadedQueryRef } from "../internal/index.js";
4
4
  import type { NoInfer } from "../index.js";
5
5
  type VariablesOption<TVariables extends OperationVariables> = [
6
6
  TVariables
@@ -156,7 +156,7 @@ export interface PreloadQueryFunction {
156
156
  * }
157
157
  * ```
158
158
  */
159
- <TData, TVariables extends OperationVariables, TOptions extends Omit<PreloadQueryOptions, "variables">>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>, TOptions>): QueryReference<TOptions["errorPolicy"] extends "ignore" | "all" ? TOptions["returnPartialData"] extends true ? DeepPartial<TData> | undefined : TData | undefined : TOptions["returnPartialData"] extends true ? DeepPartial<TData> : TData, TVariables>;
159
+ <TData, TVariables extends OperationVariables, TOptions extends Omit<PreloadQueryOptions, "variables">>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>, TOptions>): PreloadedQueryRef<TOptions["errorPolicy"] extends "ignore" | "all" ? TOptions["returnPartialData"] extends true ? DeepPartial<TData> | undefined : TData | undefined : TOptions["returnPartialData"] extends true ? DeepPartial<TData> : TData, TVariables>;
160
160
  /**
161
161
  * A function that will begin loading a query when called. It's result can be read by `useReadQuery` which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
162
162
  *
@@ -183,7 +183,7 @@ export interface PreloadQueryFunction {
183
183
  <TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer<TVariables>> & {
184
184
  returnPartialData: true;
185
185
  errorPolicy: "ignore" | "all";
186
- }): QueryReference<DeepPartial<TData> | undefined, TVariables>;
186
+ }): PreloadedQueryRef<DeepPartial<TData> | undefined, TVariables>;
187
187
  /**
188
188
  * A function that will begin loading a query when called. It's result can be read by `useReadQuery` which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
189
189
  *
@@ -209,7 +209,7 @@ export interface PreloadQueryFunction {
209
209
  */
210
210
  <TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer<TVariables>> & {
211
211
  errorPolicy: "ignore" | "all";
212
- }): QueryReference<TData | undefined, TVariables>;
212
+ }): PreloadedQueryRef<TData | undefined, TVariables>;
213
213
  /**
214
214
  * A function that will begin loading a query when called. It's result can be read by `useReadQuery` which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
215
215
  *
@@ -235,7 +235,7 @@ export interface PreloadQueryFunction {
235
235
  */
236
236
  <TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer<TVariables>> & {
237
237
  returnPartialData: true;
238
- }): QueryReference<DeepPartial<TData>, TVariables>;
238
+ }): PreloadedQueryRef<DeepPartial<TData>, TVariables>;
239
239
  /**
240
240
  * A function that will begin loading a query when called. It's result can be read by `useReadQuery` which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
241
241
  *
@@ -259,7 +259,7 @@ export interface PreloadQueryFunction {
259
259
  * }
260
260
  * ```
261
261
  */
262
- <TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>>): QueryReference<TData, TVariables>;
262
+ <TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>>): PreloadedQueryRef<TData, TVariables>;
263
263
  }
264
264
  /**
265
265
  * A higher order function that returns a `preloadQuery` function which
@@ -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;AAsI5E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAyB;IAEzB,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,CAAC,CAAC;IAChC,CAAC,CAAC;AACJ,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 { QueryReference } from \"../internal/index.js\";\nimport type { NoInfer } from \"../index.js\";\n\ntype VariablesOption<TVariables extends OperationVariables> =\n [TVariables] extends [never] ?\n {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: Record<string, never>;\n }\n : {} 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 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 ): QueryReference<\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 ): QueryReference<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 ): QueryReference<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 ): QueryReference<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 ): QueryReference<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 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 ): QueryReference<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);\n };\n}\n"]}
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;AAsI5E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAyB;IAEzB,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","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 } from \"../index.js\";\n\ntype VariablesOption<TVariables extends OperationVariables> =\n [TVariables] extends [never] ?\n {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#variables:member} */\n variables?: Record<string, never>;\n }\n : {} 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 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 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"]}
@@ -6,7 +6,7 @@ import type { FetchResult } from "../../link/core/index.js";
6
6
  import type { ApolloError } from "../../errors/index.js";
7
7
  import type { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy, SubscribeToMoreOptions, ApolloQueryResult, FetchMoreQueryOptions, ErrorPolicy, RefetchWritePolicy } from "../../core/index.js";
8
8
  import type { MutationSharedOptions, SharedWatchQueryOptions } from "../../core/watchQueryOptions.js";
9
- export type { QueryReference } from "../internal/index.js";
9
+ export type { QueryReference, QueryRef, PreloadedQueryRef, } from "../internal/index.js";
10
10
  export type { DefaultContext as Context } from "../../core/index.js";
11
11
  export type CommonOptions<TOptions> = TOptions & {
12
12
  client?: ApolloClient<object>;
@@ -721,7 +721,7 @@ export interface SubscriptionHookOptions<TData = any, TVariables extends Operati
721
721
  }
722
722
  export interface SubscriptionDataOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseSubscriptionOptions<TData, TVariables> {
723
723
  subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;
724
- children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);
724
+ children?: null | ((result: SubscriptionResult<TData>) => ReactTypes.ReactNode);
725
725
  }
726
726
  export interface SubscriptionCurrentObservable {
727
727
  query?: Observable<any>;
@@ -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 } 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\";\n\n/* QueryReference type */\n\nexport type { QueryReference } 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: 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: TData,\n options: Pick<WatchQueryOptions<TVars, TData>, \"variables\">\n ) => TData\n ) => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: (\n variables?: Partial<TVariables>\n ) => Promise<ApolloQueryResult<TData>>;\n /** @internal */\n reobserve: (\n newOptions?: Partial<WatchQueryOptions<TVariables, TData>>,\n newNetworkStatus?: NetworkStatus\n ) => Promise<ApolloQueryResult<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: TData,\n options: {\n fetchMoreResult: TFetchData;\n variables: TFetchVars;\n }\n ) => TData;\n }\n ) => Promise<ApolloQueryResult<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: TData | undefined;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#previousData:member} */\n previousData?: TData;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#error:member} */\n error?: ApolloError;\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: 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?: (data: TData, clientOptions?: BaseMutationOptions) => 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?: 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<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<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#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#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\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?: 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\nexport interface SubscriptionDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);\n}\n\nexport interface SubscriptionCurrentObservable {\n query?: Observable<any>;\n subscription?: ObservableSubscription;\n}\n\n/**\nHelper type that allows using a type in a way that cannot be \"widened\" by inference on the value it is used on.\n\nThis type was first suggested [in this Github discussion](https://github.com/microsoft/TypeScript/issues/14829#issuecomment-504042546).\n\nExample usage:\n```ts\nexport function useQuery<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: QueryHookOptions<NoInfer<TData>, NoInfer<TVariables>> = Object.create(null),\n)\n```\nIn this case, `TData` and `TVariables` should be inferred from `query`, but never widened from something in `options`.\n\nSo, in this code example:\n```ts\ndeclare const typedNode: TypedDocumentNode<{ foo: string}, { bar: number }>\nconst { variables } = useQuery(typedNode, { variables: { bar: 4, nonExistingVariable: \"string\" } });\n```\nWithout the use of `NoInfer`, `variables` would now be of the type `{ bar: number, nonExistingVariable: \"string\" }`.\nWith `NoInfer`, it will instead give an error on `nonExistingVariable`.\n */\nexport type NoInfer<T> = [T][T extends any ? 0 : never];\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 } 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\";\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: 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: TData,\n options: Pick<WatchQueryOptions<TVars, TData>, \"variables\">\n ) => TData\n ) => void;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: (\n variables?: Partial<TVariables>\n ) => Promise<ApolloQueryResult<TData>>;\n /** @internal */\n reobserve: (\n newOptions?: Partial<WatchQueryOptions<TVariables, TData>>,\n newNetworkStatus?: NetworkStatus\n ) => Promise<ApolloQueryResult<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: TData,\n options: {\n fetchMoreResult: TFetchData;\n variables: TFetchVars;\n }\n ) => TData;\n }\n ) => Promise<ApolloQueryResult<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: TData | undefined;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#previousData:member} */\n previousData?: TData;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#error:member} */\n error?: ApolloError;\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: 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?: (data: TData, clientOptions?: BaseMutationOptions) => 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?: 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<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<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#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#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\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?: 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\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\n/**\nHelper type that allows using a type in a way that cannot be \"widened\" by inference on the value it is used on.\n\nThis type was first suggested [in this Github discussion](https://github.com/microsoft/TypeScript/issues/14829#issuecomment-504042546).\n\nExample usage:\n```ts\nexport function useQuery<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: QueryHookOptions<NoInfer<TData>, NoInfer<TVariables>> = Object.create(null),\n)\n```\nIn this case, `TData` and `TVariables` should be inferred from `query`, but never widened from something in `options`.\n\nSo, in this code example:\n```ts\ndeclare const typedNode: TypedDocumentNode<{ foo: string}, { bar: number }>\nconst { variables } = useQuery(typedNode, { variables: { bar: 4, nonExistingVariable: \"string\" } });\n```\nWithout the use of `NoInfer`, `variables` would now be of the type `{ bar: number, nonExistingVariable: \"string\" }`.\nWith `NoInfer`, it will instead give an error on `nonExistingVariable`.\n */\nexport type NoInfer<T> = [T][T extends any ? 0 : never];\n"]}
@@ -129,15 +129,15 @@ var MockLink = (function (_super) {
129
129
  MockLink.prototype.normalizeMockedResponse = function (mockedResponse) {
130
130
  var _a;
131
131
  var newMockedResponse = utilities.cloneDeep(mockedResponse);
132
- var queryWithoutConnection = utilities.removeConnectionDirectiveFromDocument(newMockedResponse.request.query);
133
- globals.invariant(queryWithoutConnection, 64);
134
- newMockedResponse.request.query = queryWithoutConnection;
132
+ var queryWithoutClientOnlyDirectives = utilities.removeDirectivesFromDocument([{ name: "connection" }, { name: "nonreactive" }], utilities.checkDocument(newMockedResponse.request.query));
133
+ globals.invariant(queryWithoutClientOnlyDirectives, 65);
134
+ newMockedResponse.request.query = queryWithoutClientOnlyDirectives;
135
135
  var query = utilities.removeClientSetsFromDocument(newMockedResponse.request.query);
136
136
  if (query) {
137
137
  newMockedResponse.request.query = query;
138
138
  }
139
139
  mockedResponse.maxUsageCount = (_a = mockedResponse.maxUsageCount) !== null && _a !== void 0 ? _a : 1;
140
- globals.invariant(mockedResponse.maxUsageCount > 0, 65, mockedResponse.maxUsageCount);
140
+ globals.invariant(mockedResponse.maxUsageCount > 0, 66, mockedResponse.maxUsageCount);
141
141
  this.normalizeVariableMatching(newMockedResponse);
142
142
  return newMockedResponse;
143
143
  };
@@ -1 +1 @@
1
- {"version":3,"file":"core.cjs","sources":["mocking/mockLink.js","mocking/mockSubscriptionLink.js","mocking/mockClient.js","subscribeAndCount.js","itAsync.js","wait.js","withConsoleSpy.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { invariant } from \"../../../utilities/globals/index.js\";\nimport { equal } from \"@wry/equality\";\nimport { ApolloLink } from \"../../../link/core/index.js\";\nimport { Observable, addTypenameToDocument, removeClientSetsFromDocument, removeConnectionDirectiveFromDocument, cloneDeep, stringifyForDisplay, print, } from \"../../../utilities/index.js\";\nfunction requestToKey(request, addTypename) {\n var queryString = request.query &&\n print(addTypename ? addTypenameToDocument(request.query) : request.query);\n var requestKey = { query: queryString };\n return JSON.stringify(requestKey);\n}\nvar MockLink = /** @class */ (function (_super) {\n __extends(MockLink, _super);\n function MockLink(mockedResponses, addTypename, options) {\n if (addTypename === void 0) { addTypename = true; }\n if (options === void 0) { options = Object.create(null); }\n var _a;\n var _this = _super.call(this) || this;\n _this.addTypename = true;\n _this.showWarnings = true;\n _this.mockedResponsesByKey = {};\n _this.addTypename = addTypename;\n _this.showWarnings = (_a = options.showWarnings) !== null && _a !== void 0 ? _a : true;\n if (mockedResponses) {\n mockedResponses.forEach(function (mockedResponse) {\n _this.addMockedResponse(mockedResponse);\n });\n }\n return _this;\n }\n MockLink.prototype.addMockedResponse = function (mockedResponse) {\n var normalizedMockedResponse = this.normalizeMockedResponse(mockedResponse);\n var key = requestToKey(normalizedMockedResponse.request, this.addTypename);\n var mockedResponses = this.mockedResponsesByKey[key];\n if (!mockedResponses) {\n mockedResponses = [];\n this.mockedResponsesByKey[key] = mockedResponses;\n }\n mockedResponses.push(normalizedMockedResponse);\n };\n MockLink.prototype.request = function (operation) {\n var _this = this;\n var _a;\n this.operation = operation;\n var key = requestToKey(operation, this.addTypename);\n var unmatchedVars = [];\n var requestVariables = operation.variables || {};\n var mockedResponses = this.mockedResponsesByKey[key];\n var responseIndex = mockedResponses ?\n mockedResponses.findIndex(function (res, index) {\n var mockedResponseVars = res.request.variables || {};\n if (equal(requestVariables, mockedResponseVars)) {\n return true;\n }\n if (res.variableMatcher && res.variableMatcher(operation.variables)) {\n return true;\n }\n unmatchedVars.push(mockedResponseVars);\n return false;\n })\n : -1;\n var response = responseIndex >= 0 ? mockedResponses[responseIndex] : void 0;\n // There have been platform- and engine-dependent differences with\n // setInterval(fn, Infinity), so we pass 0 instead (but detect\n // Infinity where we call observer.error or observer.next to pend\n // indefinitely in those cases.)\n var delay = (response === null || response === void 0 ? void 0 : response.delay) === Infinity ? 0 : (_a = response === null || response === void 0 ? void 0 : response.delay) !== null && _a !== void 0 ? _a : 0;\n var configError;\n if (!response) {\n configError = new Error(\"No more mocked responses for the query: \".concat(print(operation.query), \"\\nExpected variables: \").concat(stringifyForDisplay(operation.variables), \"\\n\").concat(unmatchedVars.length > 0 ?\n \"\\nFailed to match \".concat(unmatchedVars.length, \" mock\").concat(unmatchedVars.length === 1 ? \"\" : \"s\", \" for this query. The mocked response had the following variables:\\n\").concat(unmatchedVars.map(function (d) { return \" \".concat(stringifyForDisplay(d)); }).join(\"\\n\"), \"\\n\")\n : \"\"));\n if (this.showWarnings) {\n console.warn(configError.message +\n \"\\nThis typically indicates a configuration error in your mocks \" +\n \"setup, usually due to a typo or mismatched variable.\");\n }\n }\n else {\n if (response.maxUsageCount && response.maxUsageCount > 1) {\n response.maxUsageCount--;\n }\n else {\n mockedResponses.splice(responseIndex, 1);\n }\n var newData = response.newData;\n if (newData) {\n response.result = newData(operation.variables);\n mockedResponses.push(response);\n }\n if (!response.result && !response.error && response.delay !== Infinity) {\n configError = new Error(\"Mocked response should contain either `result`, `error` or a `delay` of `Infinity`: \".concat(key));\n }\n }\n return new Observable(function (observer) {\n var timer = setTimeout(function () {\n if (configError) {\n try {\n // The onError function can return false to indicate that\n // configError need not be passed to observer.error. For\n // example, the default implementation of onError calls\n // observer.error(configError) and then returns false to\n // prevent this extra (harmless) observer.error call.\n if (_this.onError(configError, observer) !== false) {\n throw configError;\n }\n }\n catch (error) {\n observer.error(error);\n }\n }\n else if (response && response.delay !== Infinity) {\n if (response.error) {\n observer.error(response.error);\n }\n else {\n if (response.result) {\n observer.next(typeof response.result === \"function\" ?\n response.result(operation.variables)\n : response.result);\n }\n observer.complete();\n }\n }\n }, delay);\n return function () {\n clearTimeout(timer);\n };\n });\n };\n MockLink.prototype.normalizeMockedResponse = function (mockedResponse) {\n var _a;\n var newMockedResponse = cloneDeep(mockedResponse);\n var queryWithoutConnection = removeConnectionDirectiveFromDocument(newMockedResponse.request.query);\n invariant(queryWithoutConnection, 64);\n newMockedResponse.request.query = queryWithoutConnection;\n var query = removeClientSetsFromDocument(newMockedResponse.request.query);\n if (query) {\n newMockedResponse.request.query = query;\n }\n mockedResponse.maxUsageCount = (_a = mockedResponse.maxUsageCount) !== null && _a !== void 0 ? _a : 1;\n invariant(mockedResponse.maxUsageCount > 0, 65, mockedResponse.maxUsageCount);\n this.normalizeVariableMatching(newMockedResponse);\n return newMockedResponse;\n };\n MockLink.prototype.normalizeVariableMatching = function (mockedResponse) {\n var variables = mockedResponse.request.variables;\n if (mockedResponse.variableMatcher && variables) {\n throw new Error(\"Mocked response should contain either variableMatcher or request.variables\");\n }\n if (!mockedResponse.variableMatcher) {\n mockedResponse.variableMatcher = function (vars) {\n var requestVariables = vars || {};\n var mockedResponseVariables = variables || {};\n return equal(requestVariables, mockedResponseVariables);\n };\n }\n };\n return MockLink;\n}(ApolloLink));\nexport { MockLink };\n// Pass in multiple mocked responses, so that you can test flows that end up\n// making multiple queries to the server.\n// NOTE: The last arg can optionally be an `addTypename` arg.\nexport function mockSingleLink() {\n var mockedResponses = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n mockedResponses[_i] = arguments[_i];\n }\n // To pull off the potential typename. If this isn't a boolean, we'll just\n // set it true later.\n var maybeTypename = mockedResponses[mockedResponses.length - 1];\n var mocks = mockedResponses.slice(0, mockedResponses.length - 1);\n if (typeof maybeTypename !== \"boolean\") {\n mocks = mockedResponses;\n maybeTypename = true;\n }\n return new MockLink(mocks, maybeTypename);\n}\n//# sourceMappingURL=mockLink.js.map","import { __extends } from \"tslib\";\nimport { Observable } from \"../../../utilities/index.js\";\nimport { ApolloLink } from \"../../../link/core/index.js\";\nvar MockSubscriptionLink = /** @class */ (function (_super) {\n __extends(MockSubscriptionLink, _super);\n function MockSubscriptionLink() {\n var _this = _super.call(this) || this;\n _this.unsubscribers = [];\n _this.setups = [];\n _this.observers = [];\n return _this;\n }\n MockSubscriptionLink.prototype.request = function (operation) {\n var _this = this;\n this.operation = operation;\n return new Observable(function (observer) {\n _this.setups.forEach(function (x) { return x(); });\n _this.observers.push(observer);\n return function () {\n _this.unsubscribers.forEach(function (x) { return x(); });\n };\n });\n };\n MockSubscriptionLink.prototype.simulateResult = function (result, complete) {\n var _this = this;\n if (complete === void 0) { complete = false; }\n setTimeout(function () {\n var observers = _this.observers;\n if (!observers.length)\n throw new Error(\"subscription torn down\");\n observers.forEach(function (observer) {\n if (result.result && observer.next)\n observer.next(result.result);\n if (result.error && observer.error)\n observer.error(result.error);\n if (complete && observer.complete)\n observer.complete();\n });\n }, result.delay || 0);\n };\n MockSubscriptionLink.prototype.simulateComplete = function () {\n var observers = this.observers;\n if (!observers.length)\n throw new Error(\"subscription torn down\");\n observers.forEach(function (observer) {\n if (observer.complete)\n observer.complete();\n });\n };\n MockSubscriptionLink.prototype.onSetup = function (listener) {\n this.setups = this.setups.concat([listener]);\n };\n MockSubscriptionLink.prototype.onUnsubscribe = function (listener) {\n this.unsubscribers = this.unsubscribers.concat([listener]);\n };\n return MockSubscriptionLink;\n}(ApolloLink));\nexport { MockSubscriptionLink };\nexport function mockObservableLink() {\n return new MockSubscriptionLink();\n}\n//# sourceMappingURL=mockSubscriptionLink.js.map","import { ApolloClient } from \"../../../core/index.js\";\nimport { InMemoryCache } from \"../../../cache/index.js\";\nimport { mockSingleLink } from \"./mockLink.js\";\nexport function createMockClient(data, query, variables) {\n if (variables === void 0) { variables = {}; }\n return new ApolloClient({\n link: mockSingleLink({\n request: { query: query, variables: variables },\n result: { data: data },\n }).setOnError(function (error) {\n throw error;\n }),\n cache: new InMemoryCache({ addTypename: false }),\n });\n}\n//# sourceMappingURL=mockClient.js.map","import { asyncMap } from \"../../utilities/index.js\";\nexport default function subscribeAndCount(reject, observable, cb) {\n // Use a Promise queue to prevent callbacks from being run out of order.\n var queue = Promise.resolve();\n var handleCount = 0;\n var subscription = asyncMap(observable, function (result) {\n // All previous asynchronous callbacks must complete before cb can\n // be invoked with this result.\n return (queue = queue\n .then(function () {\n return cb(++handleCount, result);\n })\n .catch(error));\n }).subscribe({ error: error });\n function error(e) {\n subscription.unsubscribe();\n reject(e);\n }\n return subscription;\n}\n//# sourceMappingURL=subscribeAndCount.js.map","function wrap(key) {\n return function (message, callback, timeout) {\n return (key ? it[key] : it)(message, function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n return callback.call(_this, resolve, reject);\n });\n }, timeout);\n };\n}\nvar wrappedIt = wrap();\nexport var itAsync = Object.assign(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return wrappedIt.apply(this, args);\n}, {\n only: wrap(\"only\"),\n skip: wrap(\"skip\"),\n todo: wrap(\"todo\"),\n});\n//# sourceMappingURL=itAsync.js.map","import { __awaiter, __generator } from \"tslib\";\nexport function wait(ms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) { return setTimeout(resolve, ms); })];\n });\n });\n}\nexport function tick() {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, wait(0)];\n });\n });\n}\n//# sourceMappingURL=wait.js.map","function wrapTestFunction(fn, consoleMethodName) {\n return function () {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var spy = jest.spyOn(console, consoleMethodName);\n spy.mockImplementation(function () { });\n return new Promise(function (resolve) {\n resolve(fn === null || fn === void 0 ? void 0 : fn.apply(_this, args));\n }).finally(function () {\n expect(spy).toMatchSnapshot();\n spy.mockReset();\n });\n };\n}\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withErrorSpy(it) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n args[1] = wrapTestFunction(args[1], \"error\");\n return it.apply(void 0, args);\n}\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withWarningSpy(it) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n args[1] = wrapTestFunction(args[1], \"warn\");\n return it.apply(void 0, args);\n}\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withLogSpy(it) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n args[1] = wrapTestFunction(args[1], \"log\");\n return it.apply(void 0, args);\n}\n//# sourceMappingURL=withConsoleSpy.js.map"],"names":["print","addTypenameToDocument","__extends","equal","stringifyForDisplay","Observable","cloneDeep","removeConnectionDirectiveFromDocument","invariant","removeClientSetsFromDocument","ApolloLink","ApolloClient","InMemoryCache","asyncMap","__awaiter","__generator"],"mappings":";;;;;;;;;;;;AAKA,SAAS,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE;AAC5C,IAAI,IAAI,WAAW,GAAG,OAAO,CAAC,KAAK;AACnC,QAAQA,eAAK,CAAC,WAAW,GAAGC,+BAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAClF,IAAI,IAAI,UAAU,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAC5C,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AACE,IAAC,QAAQ,KAAkB,UAAU,MAAM,EAAE;AAChD,IAAIC,eAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChC,IAAI,SAAS,QAAQ,CAAC,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE;AAC7D,QAAQ,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC,EAAE;AAC3D,QAAQ,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE;AAClE,QAAQ,IAAI,EAAE,CAAC;AACf,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;AACjC,QAAQ,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAClC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AC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAEM,SAAS,cAAc,CAAC,EAAE,EAAE;AACnC,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;AAClB,IAAI,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE;AAClD,QAAQ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;AACrC,KAAK;AACL,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAChD,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAEM,SAAS,UAAU,CAAC,EAAE,EAAE;AAC/B,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;AAClB,IAAI,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE;AAClD,QAAQ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;AACrC,KAAK;AACL,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/C,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AAClC;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"core.cjs","sources":["mocking/mockLink.js","mocking/mockSubscriptionLink.js","mocking/mockClient.js","subscribeAndCount.js","itAsync.js","wait.js","withConsoleSpy.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { invariant } from \"../../../utilities/globals/index.js\";\nimport { equal } from \"@wry/equality\";\nimport { ApolloLink } from \"../../../link/core/index.js\";\nimport { Observable, addTypenameToDocument, removeClientSetsFromDocument, cloneDeep, stringifyForDisplay, print, removeDirectivesFromDocument, checkDocument, } from \"../../../utilities/index.js\";\nfunction requestToKey(request, addTypename) {\n var queryString = request.query &&\n print(addTypename ? addTypenameToDocument(request.query) : request.query);\n var requestKey = { query: queryString };\n return JSON.stringify(requestKey);\n}\nvar MockLink = /** @class */ (function (_super) {\n __extends(MockLink, _super);\n function MockLink(mockedResponses, addTypename, options) {\n if (addTypename === void 0) { addTypename = true; }\n if (options === void 0) { options = Object.create(null); }\n var _a;\n var _this = _super.call(this) || this;\n _this.addTypename = true;\n _this.showWarnings = true;\n _this.mockedResponsesByKey = {};\n _this.addTypename = addTypename;\n _this.showWarnings = (_a = options.showWarnings) !== null && _a !== void 0 ? _a : true;\n if (mockedResponses) {\n mockedResponses.forEach(function (mockedResponse) {\n _this.addMockedResponse(mockedResponse);\n });\n }\n return _this;\n }\n MockLink.prototype.addMockedResponse = function (mockedResponse) {\n var normalizedMockedResponse = this.normalizeMockedResponse(mockedResponse);\n var key = requestToKey(normalizedMockedResponse.request, this.addTypename);\n var mockedResponses = this.mockedResponsesByKey[key];\n if (!mockedResponses) {\n mockedResponses = [];\n this.mockedResponsesByKey[key] = mockedResponses;\n }\n mockedResponses.push(normalizedMockedResponse);\n };\n MockLink.prototype.request = function (operation) {\n var _this = this;\n var _a;\n this.operation = operation;\n var key = requestToKey(operation, this.addTypename);\n var unmatchedVars = [];\n var requestVariables = operation.variables || {};\n var mockedResponses = this.mockedResponsesByKey[key];\n var responseIndex = mockedResponses ?\n mockedResponses.findIndex(function (res, index) {\n var mockedResponseVars = res.request.variables || {};\n if (equal(requestVariables, mockedResponseVars)) {\n return true;\n }\n if (res.variableMatcher && res.variableMatcher(operation.variables)) {\n return true;\n }\n unmatchedVars.push(mockedResponseVars);\n return false;\n })\n : -1;\n var response = responseIndex >= 0 ? mockedResponses[responseIndex] : void 0;\n // There have been platform- and engine-dependent differences with\n // setInterval(fn, Infinity), so we pass 0 instead (but detect\n // Infinity where we call observer.error or observer.next to pend\n // indefinitely in those cases.)\n var delay = (response === null || response === void 0 ? void 0 : response.delay) === Infinity ? 0 : (_a = response === null || response === void 0 ? void 0 : response.delay) !== null && _a !== void 0 ? _a : 0;\n var configError;\n if (!response) {\n configError = new Error(\"No more mocked responses for the query: \".concat(print(operation.query), \"\\nExpected variables: \").concat(stringifyForDisplay(operation.variables), \"\\n\").concat(unmatchedVars.length > 0 ?\n \"\\nFailed to match \".concat(unmatchedVars.length, \" mock\").concat(unmatchedVars.length === 1 ? \"\" : \"s\", \" for this query. The mocked response had the following variables:\\n\").concat(unmatchedVars.map(function (d) { return \" \".concat(stringifyForDisplay(d)); }).join(\"\\n\"), \"\\n\")\n : \"\"));\n if (this.showWarnings) {\n console.warn(configError.message +\n \"\\nThis typically indicates a configuration error in your mocks \" +\n \"setup, usually due to a typo or mismatched variable.\");\n }\n }\n else {\n if (response.maxUsageCount && response.maxUsageCount > 1) {\n response.maxUsageCount--;\n }\n else {\n mockedResponses.splice(responseIndex, 1);\n }\n var newData = response.newData;\n if (newData) {\n response.result = newData(operation.variables);\n mockedResponses.push(response);\n }\n if (!response.result && !response.error && response.delay !== Infinity) {\n configError = new Error(\"Mocked response should contain either `result`, `error` or a `delay` of `Infinity`: \".concat(key));\n }\n }\n return new Observable(function (observer) {\n var timer = setTimeout(function () {\n if (configError) {\n try {\n // The onError function can return false to indicate that\n // configError need not be passed to observer.error. For\n // example, the default implementation of onError calls\n // observer.error(configError) and then returns false to\n // prevent this extra (harmless) observer.error call.\n if (_this.onError(configError, observer) !== false) {\n throw configError;\n }\n }\n catch (error) {\n observer.error(error);\n }\n }\n else if (response && response.delay !== Infinity) {\n if (response.error) {\n observer.error(response.error);\n }\n else {\n if (response.result) {\n observer.next(typeof response.result === \"function\" ?\n response.result(operation.variables)\n : response.result);\n }\n observer.complete();\n }\n }\n }, delay);\n return function () {\n clearTimeout(timer);\n };\n });\n };\n MockLink.prototype.normalizeMockedResponse = function (mockedResponse) {\n var _a;\n var newMockedResponse = cloneDeep(mockedResponse);\n var queryWithoutClientOnlyDirectives = removeDirectivesFromDocument([{ name: \"connection\" }, { name: \"nonreactive\" }], checkDocument(newMockedResponse.request.query));\n invariant(queryWithoutClientOnlyDirectives, 65);\n newMockedResponse.request.query = queryWithoutClientOnlyDirectives;\n var query = removeClientSetsFromDocument(newMockedResponse.request.query);\n if (query) {\n newMockedResponse.request.query = query;\n }\n mockedResponse.maxUsageCount = (_a = mockedResponse.maxUsageCount) !== null && _a !== void 0 ? _a : 1;\n invariant(mockedResponse.maxUsageCount > 0, 66, mockedResponse.maxUsageCount);\n this.normalizeVariableMatching(newMockedResponse);\n return newMockedResponse;\n };\n MockLink.prototype.normalizeVariableMatching = function (mockedResponse) {\n var variables = mockedResponse.request.variables;\n if (mockedResponse.variableMatcher && variables) {\n throw new Error(\"Mocked response should contain either variableMatcher or request.variables\");\n }\n if (!mockedResponse.variableMatcher) {\n mockedResponse.variableMatcher = function (vars) {\n var requestVariables = vars || {};\n var mockedResponseVariables = variables || {};\n return equal(requestVariables, mockedResponseVariables);\n };\n }\n };\n return MockLink;\n}(ApolloLink));\nexport { MockLink };\n// Pass in multiple mocked responses, so that you can test flows that end up\n// making multiple queries to the server.\n// NOTE: The last arg can optionally be an `addTypename` arg.\nexport function mockSingleLink() {\n var mockedResponses = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n mockedResponses[_i] = arguments[_i];\n }\n // To pull off the potential typename. If this isn't a boolean, we'll just\n // set it true later.\n var maybeTypename = mockedResponses[mockedResponses.length - 1];\n var mocks = mockedResponses.slice(0, mockedResponses.length - 1);\n if (typeof maybeTypename !== \"boolean\") {\n mocks = mockedResponses;\n maybeTypename = true;\n }\n return new MockLink(mocks, maybeTypename);\n}\n//# sourceMappingURL=mockLink.js.map","import { __extends } from \"tslib\";\nimport { Observable } from \"../../../utilities/index.js\";\nimport { ApolloLink } from \"../../../link/core/index.js\";\nvar MockSubscriptionLink = /** @class */ (function (_super) {\n __extends(MockSubscriptionLink, _super);\n function MockSubscriptionLink() {\n var _this = _super.call(this) || this;\n _this.unsubscribers = [];\n _this.setups = [];\n _this.observers = [];\n return _this;\n }\n MockSubscriptionLink.prototype.request = function (operation) {\n var _this = this;\n this.operation = operation;\n return new Observable(function (observer) {\n _this.setups.forEach(function (x) { return x(); });\n _this.observers.push(observer);\n return function () {\n _this.unsubscribers.forEach(function (x) { return x(); });\n };\n });\n };\n MockSubscriptionLink.prototype.simulateResult = function (result, complete) {\n var _this = this;\n if (complete === void 0) { complete = false; }\n setTimeout(function () {\n var observers = _this.observers;\n if (!observers.length)\n throw new Error(\"subscription torn down\");\n observers.forEach(function (observer) {\n if (result.result && observer.next)\n observer.next(result.result);\n if (result.error && observer.error)\n observer.error(result.error);\n if (complete && observer.complete)\n observer.complete();\n });\n }, result.delay || 0);\n };\n MockSubscriptionLink.prototype.simulateComplete = function () {\n var observers = this.observers;\n if (!observers.length)\n throw new Error(\"subscription torn down\");\n observers.forEach(function (observer) {\n if (observer.complete)\n observer.complete();\n });\n };\n MockSubscriptionLink.prototype.onSetup = function (listener) {\n this.setups = this.setups.concat([listener]);\n };\n MockSubscriptionLink.prototype.onUnsubscribe = function (listener) {\n this.unsubscribers = this.unsubscribers.concat([listener]);\n };\n return MockSubscriptionLink;\n}(ApolloLink));\nexport { MockSubscriptionLink };\nexport function mockObservableLink() {\n return new MockSubscriptionLink();\n}\n//# sourceMappingURL=mockSubscriptionLink.js.map","import { ApolloClient } from \"../../../core/index.js\";\nimport { InMemoryCache } from \"../../../cache/index.js\";\nimport { mockSingleLink } from \"./mockLink.js\";\nexport function createMockClient(data, query, variables) {\n if (variables === void 0) { variables = {}; }\n return new ApolloClient({\n link: mockSingleLink({\n request: { query: query, variables: variables },\n result: { data: data },\n }).setOnError(function (error) {\n throw error;\n }),\n cache: new InMemoryCache({ addTypename: false }),\n });\n}\n//# sourceMappingURL=mockClient.js.map","import { asyncMap } from \"../../utilities/index.js\";\nexport default function subscribeAndCount(reject, observable, cb) {\n // Use a Promise queue to prevent callbacks from being run out of order.\n var queue = Promise.resolve();\n var handleCount = 0;\n var subscription = asyncMap(observable, function (result) {\n // All previous asynchronous callbacks must complete before cb can\n // be invoked with this result.\n return (queue = queue\n .then(function () {\n return cb(++handleCount, result);\n })\n .catch(error));\n }).subscribe({ error: error });\n function error(e) {\n subscription.unsubscribe();\n reject(e);\n }\n return subscription;\n}\n//# sourceMappingURL=subscribeAndCount.js.map","function wrap(key) {\n return function (message, callback, timeout) {\n return (key ? it[key] : it)(message, function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n return callback.call(_this, resolve, reject);\n });\n }, timeout);\n };\n}\nvar wrappedIt = wrap();\nexport var itAsync = Object.assign(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return wrappedIt.apply(this, args);\n}, {\n only: wrap(\"only\"),\n skip: wrap(\"skip\"),\n todo: wrap(\"todo\"),\n});\n//# sourceMappingURL=itAsync.js.map","import { __awaiter, __generator } from \"tslib\";\nexport function wait(ms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) { return setTimeout(resolve, ms); })];\n });\n });\n}\nexport function tick() {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, wait(0)];\n });\n });\n}\n//# sourceMappingURL=wait.js.map","function wrapTestFunction(fn, consoleMethodName) {\n return function () {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var spy = jest.spyOn(console, consoleMethodName);\n spy.mockImplementation(function () { });\n return new Promise(function (resolve) {\n resolve(fn === null || fn === void 0 ? void 0 : fn.apply(_this, args));\n }).finally(function () {\n expect(spy).toMatchSnapshot();\n spy.mockReset();\n });\n };\n}\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withErrorSpy(it) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n args[1] = wrapTestFunction(args[1], \"error\");\n return it.apply(void 0, args);\n}\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withWarningSpy(it) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n args[1] = wrapTestFunction(args[1], \"warn\");\n return it.apply(void 0, args);\n}\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withLogSpy(it) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n args[1] = wrapTestFunction(args[1], \"log\");\n return it.apply(void 0, args);\n}\n//# sourceMappingURL=withConsoleSpy.js.map"],"names":["print","addTypenameToDocument","__extends","equal","stringifyForDisplay","Observable","cloneDeep","removeDirectivesFromDocument","checkDocument","invariant","removeClientSetsFromDocument","ApolloLink","ApolloClient","InMemoryCache","asyncMap","__awaiter","__generator"],"mappings":";;;;;;;;;;;;AAKA,SAAS,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE;AAC5C,IAAI,IAAI,WAAW,GAAG,OAAO,CAAC,KAAK;AACnC,QAAQA,eAAK,CAAC,WAAW,GAAGC,+BAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAClF,IAAI,IAAI,UAAU,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAC5C,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC;AACE,IAAC,QAAQ,KAAkB,UAAU,MAAM,EAAE;AAChD,IAAIC,eAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChC,IAAI,SAAS,QAAQ,CAAC,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE;AAC7D,QAAQ,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,G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AAG,SAAS,CAAC,EAAE,CAAC,CAAC;AACrC,KAAK;AACL,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/C,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AAClC;;;;;;;;;;;;;;;"}
@@ -129,15 +129,15 @@ var MockLink = (function (_super) {
129
129
  MockLink.prototype.normalizeMockedResponse = function (mockedResponse) {
130
130
  var _a;
131
131
  var newMockedResponse = utilities.cloneDeep(mockedResponse);
132
- var queryWithoutConnection = utilities.removeConnectionDirectiveFromDocument(newMockedResponse.request.query);
133
- globals.invariant(queryWithoutConnection, 64);
134
- newMockedResponse.request.query = queryWithoutConnection;
132
+ var queryWithoutClientOnlyDirectives = utilities.removeDirectivesFromDocument([{ name: "connection" }, { name: "nonreactive" }], utilities.checkDocument(newMockedResponse.request.query));
133
+ globals.invariant(queryWithoutClientOnlyDirectives, 65);
134
+ newMockedResponse.request.query = queryWithoutClientOnlyDirectives;
135
135
  var query = utilities.removeClientSetsFromDocument(newMockedResponse.request.query);
136
136
  if (query) {
137
137
  newMockedResponse.request.query = query;
138
138
  }
139
139
  mockedResponse.maxUsageCount = (_a = mockedResponse.maxUsageCount) !== null && _a !== void 0 ? _a : 1;
140
- globals.invariant(mockedResponse.maxUsageCount > 0, 65, mockedResponse.maxUsageCount);
140
+ globals.invariant(mockedResponse.maxUsageCount > 0, 66, mockedResponse.maxUsageCount);
141
141
  this.normalizeVariableMatching(newMockedResponse);
142
142
  return newMockedResponse;
143
143
  };
@@ -2,7 +2,7 @@ import { __extends } from "tslib";
2
2
  import { invariant } from "../../../utilities/globals/index.js";
3
3
  import { equal } from "@wry/equality";
4
4
  import { ApolloLink } from "../../../link/core/index.js";
5
- import { Observable, addTypenameToDocument, removeClientSetsFromDocument, removeConnectionDirectiveFromDocument, cloneDeep, stringifyForDisplay, print, } from "../../../utilities/index.js";
5
+ import { Observable, addTypenameToDocument, removeClientSetsFromDocument, cloneDeep, stringifyForDisplay, print, removeDirectivesFromDocument, checkDocument, } from "../../../utilities/index.js";
6
6
  function requestToKey(request, addTypename) {
7
7
  var queryString = request.query &&
8
8
  print(addTypename ? addTypenameToDocument(request.query) : request.query);
@@ -131,15 +131,15 @@ var MockLink = /** @class */ (function (_super) {
131
131
  MockLink.prototype.normalizeMockedResponse = function (mockedResponse) {
132
132
  var _a;
133
133
  var newMockedResponse = cloneDeep(mockedResponse);
134
- var queryWithoutConnection = removeConnectionDirectiveFromDocument(newMockedResponse.request.query);
135
- invariant(queryWithoutConnection, 64);
136
- newMockedResponse.request.query = queryWithoutConnection;
134
+ var queryWithoutClientOnlyDirectives = removeDirectivesFromDocument([{ name: "connection" }, { name: "nonreactive" }], checkDocument(newMockedResponse.request.query));
135
+ invariant(queryWithoutClientOnlyDirectives, 65);
136
+ newMockedResponse.request.query = queryWithoutClientOnlyDirectives;
137
137
  var query = removeClientSetsFromDocument(newMockedResponse.request.query);
138
138
  if (query) {
139
139
  newMockedResponse.request.query = query;
140
140
  }
141
141
  mockedResponse.maxUsageCount = (_a = mockedResponse.maxUsageCount) !== null && _a !== void 0 ? _a : 1;
142
- invariant(mockedResponse.maxUsageCount > 0, 65, mockedResponse.maxUsageCount);
142
+ invariant(mockedResponse.maxUsageCount > 0, 66, mockedResponse.maxUsageCount);
143
143
  this.normalizeVariableMatching(newMockedResponse);
144
144
  return newMockedResponse;
145
145
  };