@apollo/client 0.0.0-pr-10521-20230206180228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +45 -0
- package/apollo-client.cjs +7614 -0
- package/apollo-client.cjs.map +1 -0
- package/apollo-client.min.cjs +1 -0
- package/cache/cache.cjs +2425 -0
- package/cache/cache.cjs.map +1 -0
- package/cache/cache.cjs.native.js +2425 -0
- package/cache/core/cache.d.ts +32 -0
- package/cache/core/cache.d.ts.map +1 -0
- package/cache/core/cache.js +84 -0
- package/cache/core/cache.js.map +1 -0
- package/cache/core/types/Cache.d.ts +55 -0
- package/cache/core/types/Cache.d.ts.map +1 -0
- package/cache/core/types/Cache.js +4 -0
- package/cache/core/types/Cache.js.map +1 -0
- package/cache/core/types/DataProxy.d.ts +52 -0
- package/cache/core/types/DataProxy.d.ts.map +1 -0
- package/cache/core/types/DataProxy.js +2 -0
- package/cache/core/types/DataProxy.js.map +1 -0
- package/cache/core/types/common.d.ts +47 -0
- package/cache/core/types/common.d.ts.map +1 -0
- package/cache/core/types/common.js +26 -0
- package/cache/core/types/common.js.map +1 -0
- package/cache/index.d.ts +15 -0
- package/cache/index.d.ts.map +1 -0
- package/cache/index.js +14 -0
- package/cache/index.js.map +1 -0
- package/cache/inmemory/__mocks__/optimism.d.ts +2 -0
- package/cache/inmemory/__mocks__/optimism.d.ts.map +1 -0
- package/cache/inmemory/__mocks__/optimism.js +14 -0
- package/cache/inmemory/__mocks__/optimism.js.map +1 -0
- package/cache/inmemory/entityStore.d.ts +83 -0
- package/cache/inmemory/entityStore.d.ts.map +1 -0
- package/cache/inmemory/entityStore.js +467 -0
- package/cache/inmemory/entityStore.js.map +1 -0
- package/cache/inmemory/fixPolyfills.d.ts +1 -0
- package/cache/inmemory/fixPolyfills.d.ts.map +1 -0
- package/cache/inmemory/fixPolyfills.js +1 -0
- package/cache/inmemory/fixPolyfills.js.map +1 -0
- package/cache/inmemory/fixPolyfills.native.d.ts +2 -0
- package/cache/inmemory/fixPolyfills.native.d.ts.map +1 -0
- package/cache/inmemory/fixPolyfills.native.js +48 -0
- package/cache/inmemory/fixPolyfills.native.js.map +1 -0
- package/cache/inmemory/fragmentRegistry.d.ts +8 -0
- package/cache/inmemory/fragmentRegistry.d.ts.map +1 -0
- package/cache/inmemory/fragmentRegistry.js +113 -0
- package/cache/inmemory/fragmentRegistry.js.map +1 -0
- package/cache/inmemory/helpers.d.ts +27 -0
- package/cache/inmemory/helpers.d.ts.map +1 -0
- package/cache/inmemory/helpers.js +85 -0
- package/cache/inmemory/helpers.js.map +1 -0
- package/cache/inmemory/inMemoryCache.d.ts +52 -0
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -0
- package/cache/inmemory/inMemoryCache.js +316 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -0
- package/cache/inmemory/key-extractor.d.ts +9 -0
- package/cache/inmemory/key-extractor.d.ts.map +1 -0
- package/cache/inmemory/key-extractor.js +118 -0
- package/cache/inmemory/key-extractor.js.map +1 -0
- package/cache/inmemory/object-canon.d.ts +17 -0
- package/cache/inmemory/object-canon.d.ts.map +1 -0
- package/cache/inmemory/object-canon.js +120 -0
- package/cache/inmemory/object-canon.js.map +1 -0
- package/cache/inmemory/policies.d.ts +96 -0
- package/cache/inmemory/policies.d.ts.map +1 -0
- package/cache/inmemory/policies.js +416 -0
- package/cache/inmemory/policies.js.map +1 -0
- package/cache/inmemory/reactiveVars.d.ts +18 -0
- package/cache/inmemory/reactiveVars.d.ts.map +1 -0
- package/cache/inmemory/reactiveVars.js +65 -0
- package/cache/inmemory/reactiveVars.js.map +1 -0
- package/cache/inmemory/readFromStore.d.ts +36 -0
- package/cache/inmemory/readFromStore.d.ts.map +1 -0
- package/cache/inmemory/readFromStore.js +267 -0
- package/cache/inmemory/readFromStore.js.map +1 -0
- package/cache/inmemory/types.d.ts +81 -0
- package/cache/inmemory/types.d.ts.map +1 -0
- package/cache/inmemory/types.js +4 -0
- package/cache/inmemory/types.js.map +1 -0
- package/cache/inmemory/writeToStore.d.ts +37 -0
- package/cache/inmemory/writeToStore.d.ts.map +1 -0
- package/cache/inmemory/writeToStore.js +394 -0
- package/cache/inmemory/writeToStore.js.map +1 -0
- package/cache/package.json +8 -0
- package/config/jest/setup.d.ts +2 -0
- package/config/jest/setup.d.ts.map +1 -0
- package/config/jest/setup.js +5 -0
- package/config/jest/setup.js.map +1 -0
- package/core/ApolloClient.d.ts +76 -0
- package/core/ApolloClient.d.ts.map +1 -0
- package/core/ApolloClient.js +240 -0
- package/core/ApolloClient.js.map +1 -0
- package/core/LocalState.d.ts +69 -0
- package/core/LocalState.d.ts.map +1 -0
- package/core/LocalState.js +321 -0
- package/core/LocalState.js.map +1 -0
- package/core/ObservableQuery.d.ts +74 -0
- package/core/ObservableQuery.d.ts.map +1 -0
- package/core/ObservableQuery.js +507 -0
- package/core/ObservableQuery.js.map +1 -0
- package/core/QueryInfo.d.ts +62 -0
- package/core/QueryInfo.d.ts.map +1 -0
- package/core/QueryInfo.js +287 -0
- package/core/QueryInfo.js.map +1 -0
- package/core/QueryManager.d.ts +120 -0
- package/core/QueryManager.d.ts.map +1 -0
- package/core/QueryManager.js +890 -0
- package/core/QueryManager.js.map +1 -0
- package/core/core.cjs +2349 -0
- package/core/core.cjs.map +1 -0
- package/core/core.cjs.native.js +2349 -0
- package/core/index.d.ts +17 -0
- package/core/index.d.ts.map +1 -0
- package/core/index.js +17 -0
- package/core/index.js.map +1 -0
- package/core/networkStatus.d.ts +11 -0
- package/core/networkStatus.d.ts.map +1 -0
- package/core/networkStatus.js +14 -0
- package/core/networkStatus.js.map +1 -0
- package/core/package.json +8 -0
- package/core/types.d.ts +74 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +3 -0
- package/core/types.js.map +1 -0
- package/core/watchQueryOptions.d.ts +78 -0
- package/core/watchQueryOptions.d.ts.map +1 -0
- package/core/watchQueryOptions.js +2 -0
- package/core/watchQueryOptions.js.map +1 -0
- package/errors/errors.cjs +49 -0
- package/errors/errors.cjs.map +1 -0
- package/errors/errors.cjs.native.js +49 -0
- package/errors/index.d.ts +23 -0
- package/errors/index.d.ts.map +1 -0
- package/errors/index.js +42 -0
- package/errors/index.js.map +1 -0
- package/errors/package.json +8 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +3 -0
- package/index.js.map +1 -0
- package/invariantErrorCodes.js +339 -0
- package/link/batch/batch.cjs +159 -0
- package/link/batch/batch.cjs.map +1 -0
- package/link/batch/batch.cjs.native.js +159 -0
- package/link/batch/batchLink.d.ts +19 -0
- package/link/batch/batchLink.d.ts.map +1 -0
- package/link/batch/batchLink.js +31 -0
- package/link/batch/batchLink.js.map +1 -0
- package/link/batch/batching.d.ts +27 -0
- package/link/batch/batching.d.ts.map +1 -0
- package/link/batch/batching.js +125 -0
- package/link/batch/batching.js.map +1 -0
- package/link/batch/index.d.ts +2 -0
- package/link/batch/index.d.ts.map +1 -0
- package/link/batch/index.js +2 -0
- package/link/batch/index.js.map +1 -0
- package/link/batch/package.json +8 -0
- package/link/batch-http/batch-http.cjs +137 -0
- package/link/batch-http/batch-http.cjs.map +1 -0
- package/link/batch-http/batch-http.cjs.native.js +137 -0
- package/link/batch-http/batchHttpLink.d.ts +16 -0
- package/link/batch-http/batchHttpLink.d.ts.map +1 -0
- package/link/batch-http/batchHttpLink.js +131 -0
- package/link/batch-http/batchHttpLink.js.map +1 -0
- package/link/batch-http/index.d.ts +2 -0
- package/link/batch-http/index.d.ts.map +1 -0
- package/link/batch-http/index.js +2 -0
- package/link/batch-http/index.js.map +1 -0
- package/link/batch-http/package.json +8 -0
- package/link/context/context.cjs +38 -0
- package/link/context/context.cjs.map +1 -0
- package/link/context/context.cjs.native.js +38 -0
- package/link/context/index.d.ts +5 -0
- package/link/context/index.d.ts.map +1 -0
- package/link/context/index.js +31 -0
- package/link/context/index.js.map +1 -0
- package/link/context/package.json +8 -0
- package/link/core/ApolloLink.d.ts +16 -0
- package/link/core/ApolloLink.d.ts.map +1 -0
- package/link/core/ApolloLink.js +100 -0
- package/link/core/ApolloLink.js.map +1 -0
- package/link/core/concat.d.ts +3 -0
- package/link/core/concat.d.ts.map +1 -0
- package/link/core/concat.js +3 -0
- package/link/core/concat.js.map +1 -0
- package/link/core/core.cjs +121 -0
- package/link/core/core.cjs.map +1 -0
- package/link/core/core.cjs.native.js +121 -0
- package/link/core/empty.d.ts +3 -0
- package/link/core/empty.d.ts.map +1 -0
- package/link/core/empty.js +3 -0
- package/link/core/empty.js.map +1 -0
- package/link/core/execute.d.ts +3 -0
- package/link/core/execute.d.ts.map +1 -0
- package/link/core/execute.js +3 -0
- package/link/core/execute.js.map +1 -0
- package/link/core/from.d.ts +3 -0
- package/link/core/from.d.ts.map +1 -0
- package/link/core/from.js +3 -0
- package/link/core/from.js.map +1 -0
- package/link/core/index.d.ts +9 -0
- package/link/core/index.d.ts.map +1 -0
- package/link/core/index.js +9 -0
- package/link/core/index.js.map +1 -0
- package/link/core/package.json +8 -0
- package/link/core/split.d.ts +3 -0
- package/link/core/split.d.ts.map +1 -0
- package/link/core/split.js +3 -0
- package/link/core/split.js.map +1 -0
- package/link/core/types.d.ts +52 -0
- package/link/core/types.d.ts.map +1 -0
- package/link/core/types.js +2 -0
- package/link/core/types.js.map +1 -0
- package/link/error/error.cjs +90 -0
- package/link/error/error.cjs.map +1 -0
- package/link/error/error.cjs.native.js +90 -0
- package/link/error/index.d.ts +24 -0
- package/link/error/index.d.ts.map +1 -0
- package/link/error/index.js +83 -0
- package/link/error/index.js.map +1 -0
- package/link/error/package.json +8 -0
- package/link/http/HttpLink.d.ts +8 -0
- package/link/http/HttpLink.d.ts.map +1 -0
- package/link/http/HttpLink.js +15 -0
- package/link/http/HttpLink.js.map +1 -0
- package/link/http/checkFetcher.d.ts +2 -0
- package/link/http/checkFetcher.d.ts.map +1 -0
- package/link/http/checkFetcher.js +7 -0
- package/link/http/checkFetcher.js.map +1 -0
- package/link/http/createHttpLink.d.ts +4 -0
- package/link/http/createHttpLink.d.ts.map +1 -0
- package/link/http/createHttpLink.js +127 -0
- package/link/http/createHttpLink.js.map +1 -0
- package/link/http/createSignalIfSupported.d.ts +8 -0
- package/link/http/createSignalIfSupported.d.ts.map +1 -0
- package/link/http/createSignalIfSupported.js +8 -0
- package/link/http/createSignalIfSupported.js.map +1 -0
- package/link/http/http.cjs +593 -0
- package/link/http/http.cjs.map +1 -0
- package/link/http/http.cjs.native.js +593 -0
- package/link/http/index.d.ts +11 -0
- package/link/http/index.d.ts.map +1 -0
- package/link/http/index.js +11 -0
- package/link/http/index.js.map +1 -0
- package/link/http/iterators/async.d.ts +2 -0
- package/link/http/iterators/async.d.ts.map +1 -0
- package/link/http/iterators/async.js +14 -0
- package/link/http/iterators/async.js.map +1 -0
- package/link/http/iterators/nodeStream.d.ts +4 -0
- package/link/http/iterators/nodeStream.d.ts.map +1 -0
- package/link/http/iterators/nodeStream.js +71 -0
- package/link/http/iterators/nodeStream.js.map +1 -0
- package/link/http/iterators/promise.d.ts +2 -0
- package/link/http/iterators/promise.d.ts.map +1 -0
- package/link/http/iterators/promise.js +28 -0
- package/link/http/iterators/promise.js.map +1 -0
- package/link/http/iterators/reader.d.ts +2 -0
- package/link/http/iterators/reader.d.ts.map +1 -0
- package/link/http/iterators/reader.js +15 -0
- package/link/http/iterators/reader.js.map +1 -0
- package/link/http/package.json +8 -0
- package/link/http/parseAndCheckHttpResponse.d.ts +14 -0
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -0
- package/link/http/parseAndCheckHttpResponse.js +148 -0
- package/link/http/parseAndCheckHttpResponse.js.map +1 -0
- package/link/http/responseIterator.d.ts +3 -0
- package/link/http/responseIterator.d.ts.map +1 -0
- package/link/http/responseIterator.js +23 -0
- package/link/http/responseIterator.js.map +1 -0
- package/link/http/rewriteURIForGET.d.ts +9 -0
- package/link/http/rewriteURIForGET.d.ts.map +1 -0
- package/link/http/rewriteURIForGET.js +43 -0
- package/link/http/rewriteURIForGET.js.map +1 -0
- package/link/http/selectHttpOptionsAndBody.d.ts +57 -0
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -0
- package/link/http/selectHttpOptionsAndBody.js +78 -0
- package/link/http/selectHttpOptionsAndBody.js.map +1 -0
- package/link/http/selectURI.d.ts +3 -0
- package/link/http/selectURI.d.ts.map +1 -0
- package/link/http/selectURI.js +14 -0
- package/link/http/selectURI.js.map +1 -0
- package/link/http/serializeFetchParameter.d.ts +6 -0
- package/link/http/serializeFetchParameter.d.ts.map +1 -0
- package/link/http/serializeFetchParameter.js +14 -0
- package/link/http/serializeFetchParameter.js.map +1 -0
- package/link/persisted-queries/index.d.ts +31 -0
- package/link/persisted-queries/index.d.ts.map +1 -0
- package/link/persisted-queries/index.js +170 -0
- package/link/persisted-queries/index.js.map +1 -0
- package/link/persisted-queries/package.json +8 -0
- package/link/persisted-queries/persisted-queries.cjs +174 -0
- package/link/persisted-queries/persisted-queries.cjs.map +1 -0
- package/link/persisted-queries/persisted-queries.cjs.native.js +174 -0
- package/link/retry/delayFunction.d.ts +11 -0
- package/link/retry/delayFunction.d.ts.map +1 -0
- package/link/retry/delayFunction.js +12 -0
- package/link/retry/delayFunction.js.map +1 -0
- package/link/retry/index.d.ts +2 -0
- package/link/retry/index.d.ts.map +1 -0
- package/link/retry/index.js +2 -0
- package/link/retry/index.js.map +1 -0
- package/link/retry/package.json +8 -0
- package/link/retry/retry.cjs +170 -0
- package/link/retry/retry.cjs.map +1 -0
- package/link/retry/retry.cjs.native.js +170 -0
- package/link/retry/retryFunction.d.ts +10 -0
- package/link/retry/retryFunction.d.ts.map +1 -0
- package/link/retry/retryFunction.js +9 -0
- package/link/retry/retryFunction.js.map +1 -0
- package/link/retry/retryLink.d.ts +17 -0
- package/link/retry/retryLink.d.ts.map +1 -0
- package/link/retry/retryLink.js +145 -0
- package/link/retry/retryLink.js.map +1 -0
- package/link/schema/index.d.ts +22 -0
- package/link/schema/index.d.ts.map +1 -0
- package/link/schema/index.js +50 -0
- package/link/schema/index.js.map +1 -0
- package/link/schema/package.json +8 -0
- package/link/schema/schema.cjs +56 -0
- package/link/schema/schema.cjs.map +1 -0
- package/link/schema/schema.cjs.native.js +56 -0
- package/link/subscriptions/index.d.ts +9 -0
- package/link/subscriptions/index.d.ts.map +1 -0
- package/link/subscriptions/index.js +39 -0
- package/link/subscriptions/index.js.map +1 -0
- package/link/subscriptions/package.json +8 -0
- package/link/subscriptions/subscriptions.cjs +45 -0
- package/link/subscriptions/subscriptions.cjs.map +1 -0
- package/link/subscriptions/subscriptions.cjs.native.js +45 -0
- package/link/utils/createOperation.d.ts +3 -0
- package/link/utils/createOperation.d.ts.map +1 -0
- package/link/utils/createOperation.js +23 -0
- package/link/utils/createOperation.js.map +1 -0
- package/link/utils/fromError.d.ts +3 -0
- package/link/utils/fromError.d.ts.map +1 -0
- package/link/utils/fromError.js +7 -0
- package/link/utils/fromError.js.map +1 -0
- package/link/utils/fromPromise.d.ts +3 -0
- package/link/utils/fromPromise.d.ts.map +1 -0
- package/link/utils/fromPromise.js +12 -0
- package/link/utils/fromPromise.js.map +1 -0
- package/link/utils/index.d.ts +9 -0
- package/link/utils/index.d.ts.map +1 -0
- package/link/utils/index.js +9 -0
- package/link/utils/index.js.map +1 -0
- package/link/utils/package.json +8 -0
- package/link/utils/throwServerError.d.ts +7 -0
- package/link/utils/throwServerError.d.ts.map +1 -0
- package/link/utils/throwServerError.js +9 -0
- package/link/utils/throwServerError.js.map +1 -0
- package/link/utils/toPromise.d.ts +3 -0
- package/link/utils/toPromise.d.ts.map +1 -0
- package/link/utils/toPromise.js +19 -0
- package/link/utils/toPromise.js.map +1 -0
- package/link/utils/transformOperation.d.ts +3 -0
- package/link/utils/transformOperation.d.ts.map +1 -0
- package/link/utils/transformOperation.js +17 -0
- package/link/utils/transformOperation.js.map +1 -0
- package/link/utils/utils.cjs +115 -0
- package/link/utils/utils.cjs.map +1 -0
- package/link/utils/utils.cjs.native.js +115 -0
- package/link/utils/validateOperation.d.ts +3 -0
- package/link/utils/validateOperation.d.ts.map +1 -0
- package/link/utils/validateOperation.js +18 -0
- package/link/utils/validateOperation.js.map +1 -0
- package/link/ws/index.d.ts +17 -0
- package/link/ws/index.d.ts.map +1 -0
- package/link/ws/index.js +22 -0
- package/link/ws/index.js.map +1 -0
- package/link/ws/package.json +8 -0
- package/link/ws/ws.cjs +28 -0
- package/link/ws/ws.cjs.map +1 -0
- package/link/ws/ws.cjs.native.js +28 -0
- package/main.cjs +16 -0
- package/main.cjs.map +1 -0
- package/main.cjs.native.js +16 -0
- package/package.json +141 -0
- package/react/cache/SuspenseCache.d.ts +18 -0
- package/react/cache/SuspenseCache.d.ts.map +1 -0
- package/react/cache/SuspenseCache.js +49 -0
- package/react/cache/SuspenseCache.js.map +1 -0
- package/react/cache/index.d.ts +2 -0
- package/react/cache/index.d.ts.map +1 -0
- package/react/cache/index.js +2 -0
- package/react/cache/index.js.map +1 -0
- package/react/components/Mutation.d.ts +12 -0
- package/react/components/Mutation.d.ts.map +1 -0
- package/react/components/Mutation.js +22 -0
- package/react/components/Mutation.js.map +1 -0
- package/react/components/Query.d.ts +12 -0
- package/react/components/Query.d.ts.map +1 -0
- package/react/components/Query.js +23 -0
- package/react/components/Query.js.map +1 -0
- package/react/components/Subscription.d.ts +12 -0
- package/react/components/Subscription.d.ts.map +1 -0
- package/react/components/Subscription.js +17 -0
- package/react/components/Subscription.js.map +1 -0
- package/react/components/components.cjs +81 -0
- package/react/components/components.cjs.map +1 -0
- package/react/components/components.cjs.native.js +81 -0
- package/react/components/index.d.ts +5 -0
- package/react/components/index.d.ts.map +1 -0
- package/react/components/index.js +5 -0
- package/react/components/index.js.map +1 -0
- package/react/components/package.json +8 -0
- package/react/components/types.d.ts +18 -0
- package/react/components/types.d.ts.map +1 -0
- package/react/components/types.js +2 -0
- package/react/components/types.js.map +1 -0
- package/react/context/ApolloConsumer.d.ts +7 -0
- package/react/context/ApolloConsumer.d.ts.map +1 -0
- package/react/context/ApolloConsumer.js +12 -0
- package/react/context/ApolloConsumer.js.map +1 -0
- package/react/context/ApolloContext.d.ts +12 -0
- package/react/context/ApolloContext.d.ts.map +1 -0
- package/react/context/ApolloContext.js +20 -0
- package/react/context/ApolloContext.js.map +1 -0
- package/react/context/ApolloProvider.d.ts +10 -0
- package/react/context/ApolloProvider.d.ts.map +1 -0
- package/react/context/ApolloProvider.js +20 -0
- package/react/context/ApolloProvider.js.map +1 -0
- package/react/context/context.cjs +70 -0
- package/react/context/context.cjs.map +1 -0
- package/react/context/context.cjs.native.js +70 -0
- package/react/context/index.d.ts +5 -0
- package/react/context/index.d.ts.map +1 -0
- package/react/context/index.js +5 -0
- package/react/context/index.js.map +1 -0
- package/react/context/package.json +8 -0
- package/react/hoc/graphql.d.ts +6 -0
- package/react/hoc/graphql.d.ts.map +1 -0
- package/react/hoc/graphql.js +17 -0
- package/react/hoc/graphql.js.map +1 -0
- package/react/hoc/hoc-utils.d.ts +17 -0
- package/react/hoc/hoc-utils.d.ts.map +1 -0
- package/react/hoc/hoc-utils.js +47 -0
- package/react/hoc/hoc-utils.js.map +1 -0
- package/react/hoc/hoc.cjs +325 -0
- package/react/hoc/hoc.cjs.map +1 -0
- package/react/hoc/hoc.cjs.native.js +325 -0
- package/react/hoc/index.d.ts +8 -0
- package/react/hoc/index.d.ts.map +1 -0
- package/react/hoc/index.js +8 -0
- package/react/hoc/index.js.map +1 -0
- package/react/hoc/mutation-hoc.d.ts +7 -0
- package/react/hoc/mutation-hoc.d.ts.map +1 -0
- package/react/hoc/mutation-hoc.js +63 -0
- package/react/hoc/mutation-hoc.js.map +1 -0
- package/react/hoc/package.json +8 -0
- package/react/hoc/query-hoc.d.ts +5 -0
- package/react/hoc/query-hoc.d.ts.map +1 -0
- package/react/hoc/query-hoc.js +70 -0
- package/react/hoc/query-hoc.js.map +1 -0
- package/react/hoc/subscription-hoc.d.ts +5 -0
- package/react/hoc/subscription-hoc.d.ts.map +1 -0
- package/react/hoc/subscription-hoc.js +80 -0
- package/react/hoc/subscription-hoc.js.map +1 -0
- package/react/hoc/types.d.ts +43 -0
- package/react/hoc/types.d.ts.map +1 -0
- package/react/hoc/types.js +2 -0
- package/react/hoc/types.js.map +1 -0
- package/react/hoc/withApollo.d.ts +4 -0
- package/react/hoc/withApollo.d.ts.map +1 -0
- package/react/hoc/withApollo.js +45 -0
- package/react/hoc/withApollo.js.map +1 -0
- package/react/hooks/compareResults.d.ts +3 -0
- package/react/hooks/compareResults.d.ts.map +1 -0
- package/react/hooks/compareResults.js +63 -0
- package/react/hooks/compareResults.js.map +1 -0
- package/react/hooks/hooks.cjs +913 -0
- package/react/hooks/hooks.cjs.map +1 -0
- package/react/hooks/hooks.cjs.native.js +913 -0
- package/react/hooks/index.d.ts +10 -0
- package/react/hooks/index.d.ts.map +1 -0
- package/react/hooks/index.js +10 -0
- package/react/hooks/index.js.map +1 -0
- package/react/hooks/internal/index.d.ts +3 -0
- package/react/hooks/internal/index.d.ts.map +1 -0
- package/react/hooks/internal/index.js +3 -0
- package/react/hooks/internal/index.js.map +1 -0
- package/react/hooks/internal/useDeepMemo.d.ts +3 -0
- package/react/hooks/internal/useDeepMemo.d.ts.map +1 -0
- package/react/hooks/internal/useDeepMemo.js +10 -0
- package/react/hooks/internal/useDeepMemo.js.map +1 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +3 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -0
- package/react/hooks/package.json +8 -0
- package/react/hooks/useApolloClient.d.ts +3 -0
- package/react/hooks/useApolloClient.d.ts.map +1 -0
- package/react/hooks/useApolloClient.js +12 -0
- package/react/hooks/useApolloClient.js.map +1 -0
- package/react/hooks/useFragment.d.ts +13 -0
- package/react/hooks/useFragment.d.ts.map +1 -0
- package/react/hooks/useFragment.js +39 -0
- package/react/hooks/useFragment.js.map +1 -0
- package/react/hooks/useLazyQuery.d.ts +6 -0
- package/react/hooks/useLazyQuery.d.ts.map +1 -0
- package/react/hooks/useLazyQuery.js +71 -0
- package/react/hooks/useLazyQuery.js.map +1 -0
- package/react/hooks/useMutation.d.ts +6 -0
- package/react/hooks/useMutation.d.ts.map +1 -0
- package/react/hooks/useMutation.js +100 -0
- package/react/hooks/useMutation.js.map +1 -0
- package/react/hooks/useQuery.d.ts +41 -0
- package/react/hooks/useQuery.d.ts.map +1 -0
- package/react/hooks/useQuery.js +302 -0
- package/react/hooks/useQuery.js.map +1 -0
- package/react/hooks/useReactiveVar.d.ts +3 -0
- package/react/hooks/useReactiveVar.d.ts.map +1 -0
- package/react/hooks/useReactiveVar.js +16 -0
- package/react/hooks/useReactiveVar.js.map +1 -0
- package/react/hooks/useSubscription.d.ts +6 -0
- package/react/hooks/useSubscription.d.ts.map +1 -0
- package/react/hooks/useSubscription.js +141 -0
- package/react/hooks/useSubscription.js.map +1 -0
- package/react/hooks/useSuspenseCache.d.ts +2 -0
- package/react/hooks/useSuspenseCache.d.ts.map +1 -0
- package/react/hooks/useSuspenseCache.js +10 -0
- package/react/hooks/useSuspenseCache.js.map +1 -0
- package/react/hooks/useSuspenseQuery.d.ts +12 -0
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -0
- package/react/hooks/useSuspenseQuery.js +181 -0
- package/react/hooks/useSuspenseQuery.js.map +1 -0
- package/react/hooks/useSyncExternalStore.d.ts +4 -0
- package/react/hooks/useSyncExternalStore.d.ts.map +1 -0
- package/react/hooks/useSyncExternalStore.js +48 -0
- package/react/hooks/useSyncExternalStore.js.map +1 -0
- package/react/index.d.ts +7 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +7 -0
- package/react/index.js.map +1 -0
- package/react/package.json +8 -0
- package/react/parser/index.d.ts +15 -0
- package/react/parser/index.d.ts.map +1 -0
- package/react/parser/index.js +94 -0
- package/react/parser/index.js.map +1 -0
- package/react/parser/package.json +8 -0
- package/react/parser/parser.cjs +103 -0
- package/react/parser/parser.cjs.map +1 -0
- package/react/parser/parser.cjs.native.js +103 -0
- package/react/react.cjs +69 -0
- package/react/react.cjs.map +1 -0
- package/react/react.cjs.native.js +69 -0
- package/react/ssr/RenderPromises.d.ts +22 -0
- package/react/ssr/RenderPromises.d.ts.map +1 -0
- package/react/ssr/RenderPromises.js +90 -0
- package/react/ssr/RenderPromises.js.map +1 -0
- package/react/ssr/getDataFromTree.d.ts +13 -0
- package/react/ssr/getDataFromTree.d.ts.map +1 -0
- package/react/ssr/getDataFromTree.js +32 -0
- package/react/ssr/getDataFromTree.js.map +1 -0
- package/react/ssr/index.d.ts +4 -0
- package/react/ssr/index.d.ts.map +1 -0
- package/react/ssr/index.js +4 -0
- package/react/ssr/index.js.map +1 -0
- package/react/ssr/package.json +8 -0
- package/react/ssr/renderToStringWithData.d.ts +3 -0
- package/react/ssr/renderToStringWithData.d.ts.map +1 -0
- package/react/ssr/renderToStringWithData.js +9 -0
- package/react/ssr/renderToStringWithData.js.map +1 -0
- package/react/ssr/ssr.cjs +151 -0
- package/react/ssr/ssr.cjs.map +1 -0
- package/react/ssr/ssr.cjs.native.js +151 -0
- package/react/types/types.d.ts +130 -0
- package/react/types/types.d.ts.map +1 -0
- package/react/types/types.js +2 -0
- package/react/types/types.js.map +1 -0
- package/testing/core/core.cjs +315 -0
- package/testing/core/core.cjs.map +1 -0
- package/testing/core/core.cjs.native.js +315 -0
- package/testing/core/index.d.ts +8 -0
- package/testing/core/index.d.ts.map +1 -0
- package/testing/core/index.js +8 -0
- package/testing/core/index.js.map +1 -0
- package/testing/core/itAsync.d.ts +6 -0
- package/testing/core/itAsync.d.ts.map +1 -0
- package/testing/core/itAsync.js +19 -0
- package/testing/core/itAsync.js.map +1 -0
- package/testing/core/mocking/mockClient.d.ts +5 -0
- package/testing/core/mocking/mockClient.d.ts.map +1 -0
- package/testing/core/mocking/mockClient.js +14 -0
- package/testing/core/mocking/mockClient.js.map +1 -0
- package/testing/core/mocking/mockFetch.d.ts +24 -0
- package/testing/core/mocking/mockFetch.d.ts.map +1 -0
- package/testing/core/mocking/mockFetch.js +83 -0
- package/testing/core/mocking/mockFetch.js.map +1 -0
- package/testing/core/mocking/mockLink.d.ts +28 -0
- package/testing/core/mocking/mockLink.d.ts.map +1 -0
- package/testing/core/mocking/mockLink.js +139 -0
- package/testing/core/mocking/mockLink.js.map +1 -0
- package/testing/core/mocking/mockQueryManager.d.ts +5 -0
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -0
- package/testing/core/mocking/mockQueryManager.js +14 -0
- package/testing/core/mocking/mockQueryManager.js.map +1 -0
- package/testing/core/mocking/mockSubscriptionLink.d.ts +24 -0
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -0
- package/testing/core/mocking/mockSubscriptionLink.js +62 -0
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -0
- package/testing/core/mocking/mockWatchQuery.d.ts +5 -0
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -0
- package/testing/core/mocking/mockWatchQuery.js +15 -0
- package/testing/core/mocking/mockWatchQuery.js.map +1 -0
- package/testing/core/observableToPromise.d.ts +15 -0
- package/testing/core/observableToPromise.d.ts.map +1 -0
- package/testing/core/observableToPromise.js +65 -0
- package/testing/core/observableToPromise.js.map +1 -0
- package/testing/core/package.json +8 -0
- package/testing/core/subscribeAndCount.d.ts +3 -0
- package/testing/core/subscribeAndCount.d.ts.map +1 -0
- package/testing/core/subscribeAndCount.js +16 -0
- package/testing/core/subscribeAndCount.js.map +1 -0
- package/testing/core/wait.d.ts +3 -0
- package/testing/core/wait.d.ts.map +1 -0
- package/testing/core/wait.js +16 -0
- package/testing/core/wait.js.map +1 -0
- package/testing/core/withConsoleSpy.d.ts +4 -0
- package/testing/core/withConsoleSpy.d.ts.map +1 -0
- package/testing/core/withConsoleSpy.js +39 -0
- package/testing/core/withConsoleSpy.js.map +1 -0
- package/testing/core/wrap.d.ts +4 -0
- package/testing/core/wrap.d.ts.map +1 -0
- package/testing/core/wrap.js +26 -0
- package/testing/core/wrap.js.map +1 -0
- package/testing/index.d.ts +4 -0
- package/testing/index.d.ts.map +1 -0
- package/testing/index.js +4 -0
- package/testing/index.js.map +1 -0
- package/testing/package.json +8 -0
- package/testing/react/MockedProvider.d.ts +30 -0
- package/testing/react/MockedProvider.d.ts.map +1 -0
- package/testing/react/MockedProvider.js +39 -0
- package/testing/react/MockedProvider.js.map +1 -0
- package/testing/testing.cjs +109 -0
- package/testing/testing.cjs.map +1 -0
- package/testing/testing.cjs.native.js +109 -0
- package/utilities/common/arrays.d.ts +2 -0
- package/utilities/common/arrays.d.ts.map +1 -0
- package/utilities/common/arrays.js +4 -0
- package/utilities/common/arrays.js.map +1 -0
- package/utilities/common/canUse.d.ts +7 -0
- package/utilities/common/canUse.d.ts.map +1 -0
- package/utilities/common/canUse.js +11 -0
- package/utilities/common/canUse.js.map +1 -0
- package/utilities/common/cloneDeep.d.ts +2 -0
- package/utilities/common/cloneDeep.d.ts.map +1 -0
- package/utilities/common/cloneDeep.js +33 -0
- package/utilities/common/cloneDeep.js.map +1 -0
- package/utilities/common/compact.d.ts +3 -0
- package/utilities/common/compact.d.ts.map +1 -0
- package/utilities/common/compact.js +19 -0
- package/utilities/common/compact.js.map +1 -0
- package/utilities/common/errorHandling.d.ts +4 -0
- package/utilities/common/errorHandling.d.ts.map +1 -0
- package/utilities/common/errorHandling.js +21 -0
- package/utilities/common/errorHandling.js.map +1 -0
- package/utilities/common/filterInPlace.d.ts +2 -0
- package/utilities/common/filterInPlace.d.ts.map +1 -0
- package/utilities/common/filterInPlace.js +11 -0
- package/utilities/common/filterInPlace.js.map +1 -0
- package/utilities/common/incrementalResult.d.ts +6 -0
- package/utilities/common/incrementalResult.d.ts.map +1 -0
- package/utilities/common/incrementalResult.js +32 -0
- package/utilities/common/incrementalResult.js.map +1 -0
- package/utilities/common/makeUniqueId.d.ts +2 -0
- package/utilities/common/makeUniqueId.d.ts.map +1 -0
- package/utilities/common/makeUniqueId.js +7 -0
- package/utilities/common/makeUniqueId.js.map +1 -0
- package/utilities/common/maybeDeepFreeze.d.ts +2 -0
- package/utilities/common/maybeDeepFreeze.d.ts.map +1 -0
- package/utilities/common/maybeDeepFreeze.js +34 -0
- package/utilities/common/maybeDeepFreeze.js.map +1 -0
- package/utilities/common/mergeDeep.d.ts +14 -0
- package/utilities/common/mergeDeep.d.ts.map +1 -0
- package/utilities/common/mergeDeep.js +76 -0
- package/utilities/common/mergeDeep.js.map +1 -0
- package/utilities/common/mergeOptions.d.ts +5 -0
- package/utilities/common/mergeOptions.d.ts.map +1 -0
- package/utilities/common/mergeOptions.js +8 -0
- package/utilities/common/mergeOptions.js.map +1 -0
- package/utilities/common/objects.d.ts +2 -0
- package/utilities/common/objects.d.ts.map +1 -0
- package/utilities/common/objects.js +4 -0
- package/utilities/common/objects.js.map +1 -0
- package/utilities/common/responseIterator.d.ts +10 -0
- package/utilities/common/responseIterator.d.ts.map +1 -0
- package/utilities/common/responseIterator.js +21 -0
- package/utilities/common/responseIterator.js.map +1 -0
- package/utilities/common/stringifyForDisplay.d.ts +2 -0
- package/utilities/common/stringifyForDisplay.d.ts.map +1 -0
- package/utilities/common/stringifyForDisplay.js +8 -0
- package/utilities/common/stringifyForDisplay.js.map +1 -0
- package/utilities/globals/DEV.d.ts +3 -0
- package/utilities/globals/DEV.d.ts.map +1 -0
- package/utilities/globals/DEV.js +9 -0
- package/utilities/globals/DEV.js.map +1 -0
- package/utilities/globals/fix-graphql.d.ts +2 -0
- package/utilities/globals/fix-graphql.d.ts.map +1 -0
- package/utilities/globals/fix-graphql.js +6 -0
- package/utilities/globals/fix-graphql.js.map +1 -0
- package/utilities/globals/global.d.ts +5 -0
- package/utilities/globals/global.d.ts.map +1 -0
- package/utilities/globals/global.js +6 -0
- package/utilities/globals/global.js.map +1 -0
- package/utilities/globals/globals.cjs +42 -0
- package/utilities/globals/globals.cjs.map +1 -0
- package/utilities/globals/globals.cjs.native.js +42 -0
- package/utilities/globals/index.d.ts +8 -0
- package/utilities/globals/index.d.ts.map +1 -0
- package/utilities/globals/index.js +10 -0
- package/utilities/globals/index.js.map +1 -0
- package/utilities/globals/maybe.d.ts +2 -0
- package/utilities/globals/maybe.d.ts.map +1 -0
- package/utilities/globals/maybe.js +7 -0
- package/utilities/globals/maybe.js.map +1 -0
- package/utilities/globals/package.json +8 -0
- package/utilities/graphql/directives.d.ts +18 -0
- package/utilities/graphql/directives.d.ts.map +1 -0
- package/utilities/graphql/directives.js +72 -0
- package/utilities/graphql/directives.js.map +1 -0
- package/utilities/graphql/fragments.d.ts +9 -0
- package/utilities/graphql/fragments.d.ts.map +1 -0
- package/utilities/graphql/fragments.js +64 -0
- package/utilities/graphql/fragments.js.map +1 -0
- package/utilities/graphql/getFromAST.d.ts +10 -0
- package/utilities/graphql/getFromAST.d.ts.map +1 -0
- package/utilities/graphql/getFromAST.js +76 -0
- package/utilities/graphql/getFromAST.js.map +1 -0
- package/utilities/graphql/storeUtils.d.ts +32 -0
- package/utilities/graphql/storeUtils.d.ts.map +1 -0
- package/utilities/graphql/storeUtils.js +208 -0
- package/utilities/graphql/storeUtils.js.map +1 -0
- package/utilities/graphql/transform.d.ts +27 -0
- package/utilities/graphql/transform.d.ts.map +1 -0
- package/utilities/graphql/transform.js +281 -0
- package/utilities/graphql/transform.js.map +1 -0
- package/utilities/index.d.ts +27 -0
- package/utilities/index.d.ts.map +1 -0
- package/utilities/index.js +27 -0
- package/utilities/index.js.map +1 -0
- package/utilities/observables/Concast.d.ts +27 -0
- package/utilities/observables/Concast.d.ts.map +1 -0
- package/utilities/observables/Concast.js +137 -0
- package/utilities/observables/Concast.js.map +1 -0
- package/utilities/observables/Observable.d.ts +5 -0
- package/utilities/observables/Observable.d.ts.map +1 -0
- package/utilities/observables/Observable.js +9 -0
- package/utilities/observables/Observable.js.map +1 -0
- package/utilities/observables/asyncMap.d.ts +3 -0
- package/utilities/observables/asyncMap.d.ts.map +1 -0
- package/utilities/observables/asyncMap.js +49 -0
- package/utilities/observables/asyncMap.js.map +1 -0
- package/utilities/observables/iteration.d.ts +3 -0
- package/utilities/observables/iteration.d.ts.map +1 -0
- package/utilities/observables/iteration.js +6 -0
- package/utilities/observables/iteration.js.map +1 -0
- package/utilities/observables/subclassing.d.ts +3 -0
- package/utilities/observables/subclassing.d.ts.map +1 -0
- package/utilities/observables/subclassing.js +13 -0
- package/utilities/observables/subclassing.js.map +1 -0
- package/utilities/package.json +8 -0
- package/utilities/policies/pagination.d.ts +28 -0
- package/utilities/policies/pagination.d.ts.map +1 -0
- package/utilities/policies/pagination.js +151 -0
- package/utilities/policies/pagination.js.map +1 -0
- package/utilities/types/IsStrictlyAny.d.ts +5 -0
- package/utilities/types/IsStrictlyAny.d.ts.map +1 -0
- package/utilities/types/IsStrictlyAny.js +2 -0
- package/utilities/types/IsStrictlyAny.js.map +1 -0
- package/utilities/utilities.cjs +1371 -0
- package/utilities/utilities.cjs.map +1 -0
- package/utilities/utilities.cjs.native.js +1371 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +2 -0
- package/version.js.map +1 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
// This file is meant to help with looking up the source of errors like
|
|
2
|
+
// "Invariant Violation: 35" and is automatically generated by the file
|
|
3
|
+
// @apollo/client/config/processInvariants.ts for each @apollo/client
|
|
4
|
+
// release. The numbers may change from release to release, so please
|
|
5
|
+
// consult the @apollo/client/invariantErrorCodes.js file specific to
|
|
6
|
+
// your @apollo/client version. This file is not meant to be imported.
|
|
7
|
+
{
|
|
8
|
+
"@apollo/client version": "0.0.0-pr-10521-20230206180228",
|
|
9
|
+
|
|
10
|
+
1: {
|
|
11
|
+
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
12
|
+
node: invariant(typeof dataId === "string", "store.merge expects a string ID")
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
2: {
|
|
16
|
+
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
17
|
+
node: invariant(extracted !== void 0, "Missing field '".concat(schemaKeyPath.join('.'), "' while extracting keyFields from ").concat(JSON.stringify(object)))
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
3: {
|
|
21
|
+
file: "@apollo/client/cache/inmemory/policies.js",
|
|
22
|
+
node: invariant(!old || old === which, "Cannot change root ".concat(which, " __typename more than once"))
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
4: {
|
|
26
|
+
file: "@apollo/client/cache/inmemory/policies.js",
|
|
27
|
+
node: new InvariantError("Cannot automatically merge arrays")
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
5: {
|
|
31
|
+
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
32
|
+
node: new InvariantError("No fragment named ".concat(selection.name.value))
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
6: {
|
|
36
|
+
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
37
|
+
node: invariant(!isReference(value), "Missing selection set for object of type ".concat(getTypenameFromStoreObject(store, value), " returned for query field ").concat(field.name.value))
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
7: {
|
|
41
|
+
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
42
|
+
node: new InvariantError("Could not identify object ".concat(JSON.stringify(result)))
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
8: {
|
|
46
|
+
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
47
|
+
node: new InvariantError("No fragment named ".concat(selection.name.value))
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
9: {
|
|
51
|
+
file: "@apollo/client/core/ApolloClient.js",
|
|
52
|
+
|
|
53
|
+
node: new InvariantError("To initialize Apollo Client, you must specify a 'cache' property " +
|
|
54
|
+
"in the options object. \n" +
|
|
55
|
+
"For more information, please visit: https://go.apollo.dev/c/docs")
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
10: {
|
|
59
|
+
file: "@apollo/client/core/ApolloClient.js",
|
|
60
|
+
|
|
61
|
+
node: invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +
|
|
62
|
+
'client.query can only return a single result. Please use client.watchQuery ' +
|
|
63
|
+
'to receive multiple results from the cache and the network, or consider ' +
|
|
64
|
+
'using a different fetchPolicy, such as cache-first or network-only.')
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
11: {
|
|
68
|
+
file: "@apollo/client/core/LocalState.js",
|
|
69
|
+
node: invariant(fragment, "No fragment named ".concat(selection.name.value))
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
12: {
|
|
73
|
+
file: "@apollo/client/core/LocalState.js",
|
|
74
|
+
node: invariant(fragment, "No fragment named ".concat(spread.name.value))
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
13: {
|
|
78
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
79
|
+
node: invariant(pollInterval, 'Attempted to start a polling query without a polling interval.')
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
14: {
|
|
83
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
84
|
+
node: new InvariantError('QueryManager stopped while query was in flight')
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
15: {
|
|
88
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
89
|
+
node: invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.')
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
16: {
|
|
93
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
94
|
+
|
|
95
|
+
node: invariant(fetchPolicy === 'network-only' ||
|
|
96
|
+
fetchPolicy === 'no-cache', "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write.")
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
17: {
|
|
100
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
101
|
+
|
|
102
|
+
node: invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
|
|
103
|
+
'in the query option.')
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
18: {
|
|
107
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
108
|
+
node: invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.')
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
19: {
|
|
112
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
113
|
+
node: invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.')
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
20: {
|
|
117
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
118
|
+
node: invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.')
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
21: {
|
|
122
|
+
file: "@apollo/client/core/QueryManager.js",
|
|
123
|
+
node: new InvariantError('Store reset while query was in flight (not completed in link chain)')
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
22: {
|
|
127
|
+
file: "@apollo/client/link/core/ApolloLink.js",
|
|
128
|
+
node: new InvariantError('request is not implemented')
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
23: {
|
|
132
|
+
file: "@apollo/client/link/http/checkFetcher.js",
|
|
133
|
+
node: new InvariantError("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n ")
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
24: {
|
|
137
|
+
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
138
|
+
node: new InvariantError("Network request failed. ".concat(label, " is not serializable: ").concat(e.message))
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
25: {
|
|
142
|
+
file: "@apollo/client/link/persisted-queries/index.js",
|
|
143
|
+
|
|
144
|
+
node: invariant(options && (typeof options.sha256 === 'function' ||
|
|
145
|
+
typeof options.generateHash === 'function'), 'Missing/invalid "sha256" or "generateHash" function. Please ' +
|
|
146
|
+
'configure one using the "createPersistedQueryLink(options)" options ' +
|
|
147
|
+
'parameter.')
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
26: {
|
|
151
|
+
file: "@apollo/client/link/persisted-queries/index.js",
|
|
152
|
+
node: invariant(forward, 'PersistedQueryLink cannot be the last link in the chain.')
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
27: {
|
|
156
|
+
file: "@apollo/client/link/utils/validateOperation.js",
|
|
157
|
+
node: new InvariantError("illegal argument: ".concat(key))
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
28: {
|
|
161
|
+
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
162
|
+
|
|
163
|
+
node: invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
|
|
164
|
+
'Wrap the root component in an <ApolloProvider>.')
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
29: {
|
|
168
|
+
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
169
|
+
|
|
170
|
+
node: invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
|
|
171
|
+
'sure you pass in your client via the "client" prop.')
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
30: {
|
|
175
|
+
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
176
|
+
|
|
177
|
+
node: invariant(this.withRef, "To access the wrapped instance, you need to specify " +
|
|
178
|
+
"{ withRef: true } in the options")
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
31: {
|
|
182
|
+
file: "@apollo/client/react/hoc/withApollo.js",
|
|
183
|
+
|
|
184
|
+
node: invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
|
|
185
|
+
"{ withRef: true } in the options")
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
32: {
|
|
189
|
+
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
190
|
+
|
|
191
|
+
node: invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
|
|
192
|
+
'Wrap the root component in an <ApolloProvider>, or pass an ApolloClient ' +
|
|
193
|
+
'instance in via options.')
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
33: {
|
|
197
|
+
file: "@apollo/client/react/hooks/useSuspenseCache.js",
|
|
198
|
+
|
|
199
|
+
node: invariant(suspenseCache, 'Could not find a "suspenseCache" in the context. Wrap the root component ' +
|
|
200
|
+
'in an <ApolloProvider> and provide a suspenseCache.')
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
34: {
|
|
204
|
+
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
205
|
+
node: invariant(SUPPORTED_FETCH_POLICIES.includes(fetchPolicy), "The fetch policy `".concat(fetchPolicy, "` is not supported with suspense."))
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
35: {
|
|
209
|
+
file: "@apollo/client/react/parser/index.js",
|
|
210
|
+
|
|
211
|
+
node: invariant(!!document && !!document.kind, "Argument of ".concat(document, " passed to parser was not a valid GraphQL ") +
|
|
212
|
+
"DocumentNode. You may need to use 'graphql-tag' or another method " +
|
|
213
|
+
"to convert your operation into a document")
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
36: {
|
|
217
|
+
file: "@apollo/client/react/parser/index.js",
|
|
218
|
+
|
|
219
|
+
node: invariant(!fragments.length ||
|
|
220
|
+
(queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " +
|
|
221
|
+
"You must include a query, subscription or mutation as well")
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
37: {
|
|
225
|
+
file: "@apollo/client/react/parser/index.js",
|
|
226
|
+
|
|
227
|
+
node: invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
|
|
228
|
+
"".concat(document, " had ").concat(queries.length, " queries, ").concat(subscriptions.length, " ") +
|
|
229
|
+
"subscriptions and ".concat(mutations.length, " mutations. ") +
|
|
230
|
+
"You can use 'compose' to join multiple operation types to a component")
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
38: {
|
|
234
|
+
file: "@apollo/client/react/parser/index.js",
|
|
235
|
+
|
|
236
|
+
node: invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. ".concat(document, " had ") +
|
|
237
|
+
"".concat(definitions.length, " definitions. ") +
|
|
238
|
+
"You can use 'compose' to join multiple operation types to a component")
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
39: {
|
|
242
|
+
file: "@apollo/client/react/parser/index.js",
|
|
243
|
+
|
|
244
|
+
node: invariant(operation.type === type, "Running a ".concat(requiredOperationName, " requires a graphql ") +
|
|
245
|
+
"".concat(requiredOperationName, ", but a ").concat(usedOperationName, " was used instead."))
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
40: {
|
|
249
|
+
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
250
|
+
node: invariant(queryWithoutConnection, "query is required")
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
41: {
|
|
254
|
+
file: "@apollo/client/utilities/graphql/directives.js",
|
|
255
|
+
node: invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive."))
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
42: {
|
|
259
|
+
file: "@apollo/client/utilities/graphql/directives.js",
|
|
260
|
+
node: invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive."))
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
43: {
|
|
264
|
+
file: "@apollo/client/utilities/graphql/directives.js",
|
|
265
|
+
node: invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive."))
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
44: {
|
|
269
|
+
file: "@apollo/client/utilities/graphql/directives.js",
|
|
270
|
+
|
|
271
|
+
node: invariant(ifValue &&
|
|
272
|
+
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @".concat(directiveName, " directive must be a variable or a boolean value."))
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
45: {
|
|
276
|
+
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
277
|
+
|
|
278
|
+
node: new InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
|
|
279
|
+
'No operations are allowed when using a fragment as a query. Only fragments are allowed.')
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
46: {
|
|
283
|
+
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
284
|
+
node: invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."))
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
47: {
|
|
288
|
+
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
289
|
+
node: invariant(fragment, "No fragment named ".concat(fragmentName))
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
48: {
|
|
293
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
294
|
+
node: invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql")
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
49: {
|
|
298
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
299
|
+
node: new InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\""))
|
|
300
|
+
},
|
|
301
|
+
|
|
302
|
+
50: {
|
|
303
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
304
|
+
node: invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations"))
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
51: {
|
|
308
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
309
|
+
node: invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.')
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
52: {
|
|
313
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
314
|
+
node: invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql")
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
53: {
|
|
318
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
319
|
+
node: invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.')
|
|
320
|
+
},
|
|
321
|
+
|
|
322
|
+
54: {
|
|
323
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
324
|
+
node: invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.')
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
55: {
|
|
328
|
+
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
329
|
+
node: new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.')
|
|
330
|
+
},
|
|
331
|
+
|
|
332
|
+
56: {
|
|
333
|
+
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
334
|
+
|
|
335
|
+
node: new InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
|
|
336
|
+
'is not supported. Use variables instead of inline arguments to ' +
|
|
337
|
+
'overcome this limitation.')
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var core = require('../core');
|
|
7
|
+
var utilities = require('../../utilities');
|
|
8
|
+
|
|
9
|
+
var OperationBatcher = (function () {
|
|
10
|
+
function OperationBatcher(_a) {
|
|
11
|
+
var batchDebounce = _a.batchDebounce, batchInterval = _a.batchInterval, batchMax = _a.batchMax, batchHandler = _a.batchHandler, batchKey = _a.batchKey;
|
|
12
|
+
this.batchesByKey = new Map();
|
|
13
|
+
this.scheduledBatchTimerByKey = new Map();
|
|
14
|
+
this.batchDebounce = batchDebounce;
|
|
15
|
+
this.batchInterval = batchInterval;
|
|
16
|
+
this.batchMax = batchMax || 0;
|
|
17
|
+
this.batchHandler = batchHandler;
|
|
18
|
+
this.batchKey = batchKey || (function () { return ''; });
|
|
19
|
+
}
|
|
20
|
+
OperationBatcher.prototype.enqueueRequest = function (request) {
|
|
21
|
+
var _this = this;
|
|
22
|
+
var requestCopy = tslib.__assign(tslib.__assign({}, request), { next: [], error: [], complete: [], subscribers: new Set() });
|
|
23
|
+
var key = this.batchKey(request.operation);
|
|
24
|
+
if (!requestCopy.observable) {
|
|
25
|
+
requestCopy.observable = new utilities.Observable(function (observer) {
|
|
26
|
+
var batch = _this.batchesByKey.get(key);
|
|
27
|
+
if (!batch)
|
|
28
|
+
_this.batchesByKey.set(key, batch = new Set());
|
|
29
|
+
var isFirstEnqueuedRequest = batch.size === 0;
|
|
30
|
+
var isFirstSubscriber = requestCopy.subscribers.size === 0;
|
|
31
|
+
requestCopy.subscribers.add(observer);
|
|
32
|
+
if (isFirstSubscriber) {
|
|
33
|
+
batch.add(requestCopy);
|
|
34
|
+
}
|
|
35
|
+
if (observer.next) {
|
|
36
|
+
requestCopy.next.push(observer.next.bind(observer));
|
|
37
|
+
}
|
|
38
|
+
if (observer.error) {
|
|
39
|
+
requestCopy.error.push(observer.error.bind(observer));
|
|
40
|
+
}
|
|
41
|
+
if (observer.complete) {
|
|
42
|
+
requestCopy.complete.push(observer.complete.bind(observer));
|
|
43
|
+
}
|
|
44
|
+
if (isFirstEnqueuedRequest || _this.batchDebounce) {
|
|
45
|
+
_this.scheduleQueueConsumption(key);
|
|
46
|
+
}
|
|
47
|
+
if (batch.size === _this.batchMax) {
|
|
48
|
+
_this.consumeQueue(key);
|
|
49
|
+
}
|
|
50
|
+
return function () {
|
|
51
|
+
var _a;
|
|
52
|
+
if (requestCopy.subscribers.delete(observer) &&
|
|
53
|
+
requestCopy.subscribers.size < 1) {
|
|
54
|
+
if (batch.delete(requestCopy) && batch.size < 1) {
|
|
55
|
+
_this.consumeQueue(key);
|
|
56
|
+
(_a = batch.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return requestCopy.observable;
|
|
63
|
+
};
|
|
64
|
+
OperationBatcher.prototype.consumeQueue = function (key) {
|
|
65
|
+
if (key === void 0) { key = ''; }
|
|
66
|
+
var batch = this.batchesByKey.get(key);
|
|
67
|
+
this.batchesByKey.delete(key);
|
|
68
|
+
if (!batch || !batch.size) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
var operations = [];
|
|
72
|
+
var forwards = [];
|
|
73
|
+
var observables = [];
|
|
74
|
+
var nexts = [];
|
|
75
|
+
var errors = [];
|
|
76
|
+
var completes = [];
|
|
77
|
+
batch.forEach(function (request) {
|
|
78
|
+
operations.push(request.operation);
|
|
79
|
+
forwards.push(request.forward);
|
|
80
|
+
observables.push(request.observable);
|
|
81
|
+
nexts.push(request.next);
|
|
82
|
+
errors.push(request.error);
|
|
83
|
+
completes.push(request.complete);
|
|
84
|
+
});
|
|
85
|
+
var batchedObservable = this.batchHandler(operations, forwards) || utilities.Observable.of();
|
|
86
|
+
var onError = function (error) {
|
|
87
|
+
errors.forEach(function (rejecters) {
|
|
88
|
+
if (rejecters) {
|
|
89
|
+
rejecters.forEach(function (e) { return e(error); });
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
batch.subscription = batchedObservable.subscribe({
|
|
94
|
+
next: function (results) {
|
|
95
|
+
if (!Array.isArray(results)) {
|
|
96
|
+
results = [results];
|
|
97
|
+
}
|
|
98
|
+
if (nexts.length !== results.length) {
|
|
99
|
+
var error = new Error("server returned results with length ".concat(results.length, ", expected length of ").concat(nexts.length));
|
|
100
|
+
error.result = results;
|
|
101
|
+
return onError(error);
|
|
102
|
+
}
|
|
103
|
+
results.forEach(function (result, index) {
|
|
104
|
+
if (nexts[index]) {
|
|
105
|
+
nexts[index].forEach(function (next) { return next(result); });
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
error: onError,
|
|
110
|
+
complete: function () {
|
|
111
|
+
completes.forEach(function (complete) {
|
|
112
|
+
if (complete) {
|
|
113
|
+
complete.forEach(function (c) { return c(); });
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
return observables;
|
|
119
|
+
};
|
|
120
|
+
OperationBatcher.prototype.scheduleQueueConsumption = function (key) {
|
|
121
|
+
var _this = this;
|
|
122
|
+
clearTimeout(this.scheduledBatchTimerByKey.get(key));
|
|
123
|
+
this.scheduledBatchTimerByKey.set(key, setTimeout(function () {
|
|
124
|
+
_this.consumeQueue(key);
|
|
125
|
+
_this.scheduledBatchTimerByKey.delete(key);
|
|
126
|
+
}, this.batchInterval));
|
|
127
|
+
};
|
|
128
|
+
return OperationBatcher;
|
|
129
|
+
}());
|
|
130
|
+
|
|
131
|
+
var BatchLink = (function (_super) {
|
|
132
|
+
tslib.__extends(BatchLink, _super);
|
|
133
|
+
function BatchLink(fetchParams) {
|
|
134
|
+
var _this = _super.call(this) || this;
|
|
135
|
+
var _a = fetchParams || {}, batchDebounce = _a.batchDebounce, _b = _a.batchInterval, batchInterval = _b === void 0 ? 10 : _b, _c = _a.batchMax, batchMax = _c === void 0 ? 0 : _c, _d = _a.batchHandler, batchHandler = _d === void 0 ? function () { return null; } : _d, _e = _a.batchKey, batchKey = _e === void 0 ? function () { return ''; } : _e;
|
|
136
|
+
_this.batcher = new OperationBatcher({
|
|
137
|
+
batchDebounce: batchDebounce,
|
|
138
|
+
batchInterval: batchInterval,
|
|
139
|
+
batchMax: batchMax,
|
|
140
|
+
batchHandler: batchHandler,
|
|
141
|
+
batchKey: batchKey,
|
|
142
|
+
});
|
|
143
|
+
if (fetchParams.batchHandler.length <= 1) {
|
|
144
|
+
_this.request = function (operation) { return _this.batcher.enqueueRequest({ operation: operation }); };
|
|
145
|
+
}
|
|
146
|
+
return _this;
|
|
147
|
+
}
|
|
148
|
+
BatchLink.prototype.request = function (operation, forward) {
|
|
149
|
+
return this.batcher.enqueueRequest({
|
|
150
|
+
operation: operation,
|
|
151
|
+
forward: forward,
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
return BatchLink;
|
|
155
|
+
}(core.ApolloLink));
|
|
156
|
+
|
|
157
|
+
exports.BatchLink = BatchLink;
|
|
158
|
+
exports.OperationBatcher = OperationBatcher;
|
|
159
|
+
//# sourceMappingURL=batch.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.cjs","sources":["batching.js","batchLink.js"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { Observable } from '../../utilities';\nvar OperationBatcher = (function () {\n function OperationBatcher(_a) {\n var batchDebounce = _a.batchDebounce, batchInterval = _a.batchInterval, batchMax = _a.batchMax, batchHandler = _a.batchHandler, batchKey = _a.batchKey;\n this.batchesByKey = new Map();\n this.scheduledBatchTimerByKey = new Map();\n this.batchDebounce = batchDebounce;\n this.batchInterval = batchInterval;\n this.batchMax = batchMax || 0;\n this.batchHandler = batchHandler;\n this.batchKey = batchKey || (function () { return ''; });\n }\n OperationBatcher.prototype.enqueueRequest = function (request) {\n var _this = this;\n var requestCopy = __assign(__assign({}, request), { next: [], error: [], complete: [], subscribers: new Set() });\n var key = this.batchKey(request.operation);\n if (!requestCopy.observable) {\n requestCopy.observable = new Observable(function (observer) {\n var batch = _this.batchesByKey.get(key);\n if (!batch)\n _this.batchesByKey.set(key, batch = new Set());\n var isFirstEnqueuedRequest = batch.size === 0;\n var isFirstSubscriber = requestCopy.subscribers.size === 0;\n requestCopy.subscribers.add(observer);\n if (isFirstSubscriber) {\n batch.add(requestCopy);\n }\n if (observer.next) {\n requestCopy.next.push(observer.next.bind(observer));\n }\n if (observer.error) {\n requestCopy.error.push(observer.error.bind(observer));\n }\n if (observer.complete) {\n requestCopy.complete.push(observer.complete.bind(observer));\n }\n if (isFirstEnqueuedRequest || _this.batchDebounce) {\n _this.scheduleQueueConsumption(key);\n }\n if (batch.size === _this.batchMax) {\n _this.consumeQueue(key);\n }\n return function () {\n var _a;\n if (requestCopy.subscribers.delete(observer) &&\n requestCopy.subscribers.size < 1) {\n if (batch.delete(requestCopy) && batch.size < 1) {\n _this.consumeQueue(key);\n (_a = batch.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n }\n }\n };\n });\n }\n return requestCopy.observable;\n };\n OperationBatcher.prototype.consumeQueue = function (key) {\n if (key === void 0) { key = ''; }\n var batch = this.batchesByKey.get(key);\n this.batchesByKey.delete(key);\n if (!batch || !batch.size) {\n return;\n }\n var operations = [];\n var forwards = [];\n var observables = [];\n var nexts = [];\n var errors = [];\n var completes = [];\n batch.forEach(function (request) {\n operations.push(request.operation);\n forwards.push(request.forward);\n observables.push(request.observable);\n nexts.push(request.next);\n errors.push(request.error);\n completes.push(request.complete);\n });\n var batchedObservable = this.batchHandler(operations, forwards) || Observable.of();\n var onError = function (error) {\n errors.forEach(function (rejecters) {\n if (rejecters) {\n rejecters.forEach(function (e) { return e(error); });\n }\n });\n };\n batch.subscription = batchedObservable.subscribe({\n next: function (results) {\n if (!Array.isArray(results)) {\n results = [results];\n }\n if (nexts.length !== results.length) {\n var error = new Error(\"server returned results with length \".concat(results.length, \", expected length of \").concat(nexts.length));\n error.result = results;\n return onError(error);\n }\n results.forEach(function (result, index) {\n if (nexts[index]) {\n nexts[index].forEach(function (next) { return next(result); });\n }\n });\n },\n error: onError,\n complete: function () {\n completes.forEach(function (complete) {\n if (complete) {\n complete.forEach(function (c) { return c(); });\n }\n });\n },\n });\n return observables;\n };\n OperationBatcher.prototype.scheduleQueueConsumption = function (key) {\n var _this = this;\n clearTimeout(this.scheduledBatchTimerByKey.get(key));\n this.scheduledBatchTimerByKey.set(key, setTimeout(function () {\n _this.consumeQueue(key);\n _this.scheduledBatchTimerByKey.delete(key);\n }, this.batchInterval));\n };\n return OperationBatcher;\n}());\nexport { OperationBatcher };\n//# sourceMappingURL=batching.js.map","import { __extends } from \"tslib\";\nimport { ApolloLink } from '../core';\nimport { OperationBatcher } from './batching';\nexport { OperationBatcher } from './batching';\nvar BatchLink = (function (_super) {\n __extends(BatchLink, _super);\n function BatchLink(fetchParams) {\n var _this = _super.call(this) || this;\n var _a = fetchParams || {}, batchDebounce = _a.batchDebounce, _b = _a.batchInterval, batchInterval = _b === void 0 ? 10 : _b, _c = _a.batchMax, batchMax = _c === void 0 ? 0 : _c, _d = _a.batchHandler, batchHandler = _d === void 0 ? function () { return null; } : _d, _e = _a.batchKey, batchKey = _e === void 0 ? function () { return ''; } : _e;\n _this.batcher = new OperationBatcher({\n batchDebounce: batchDebounce,\n batchInterval: batchInterval,\n batchMax: batchMax,\n batchHandler: batchHandler,\n batchKey: batchKey,\n });\n if (fetchParams.batchHandler.length <= 1) {\n _this.request = function (operation) { return _this.batcher.enqueueRequest({ operation: operation }); };\n }\n return _this;\n }\n BatchLink.prototype.request = function (operation, forward) {\n return this.batcher.enqueueRequest({\n operation: operation,\n forward: forward,\n });\n };\n return BatchLink;\n}(ApolloLink));\nexport { BatchLink };\n//# sourceMappingURL=batchLink.js.map"],"names":["__assign","Observable","__extends","ApolloLink"],"mappings":";;;;;;;;AAEG,IAAC,gBAAgB,IAAI,YAAY;AACpC,IAAI,SAAS,gBAAgB,CAAC,EAAE,EAAE;AAClC,QAAQ,IAAI,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,QAAQ,GAAG,EAAE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