@apollo/client 3.4.17 → 3.5.6
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/README.md +1 -1
- package/{apollo-client.cjs.js → apollo-client.cjs} +1219 -1280
- package/apollo-client.cjs.map +1 -0
- package/apollo-client.min.cjs +1 -0
- package/cache/{cache.cjs.js → cache.cjs} +757 -601
- package/cache/cache.cjs.map +1 -0
- package/cache/core/cache.d.ts +6 -4
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js +28 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +12 -10
- package/cache/core/types/Cache.d.ts.map +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +4 -0
- package/cache/core/types/DataProxy.d.ts.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.d.ts +8 -5
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js +6 -11
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/helpers.js +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +4 -4
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +12 -3
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- 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/policies.d.ts +7 -3
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +47 -118
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +2 -2
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +54 -42
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +8 -3
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +166 -95
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/cache/package.json +2 -1
- package/core/ApolloClient.d.ts +0 -1
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +3 -3
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +1 -1
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +2 -2
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +19 -14
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +2 -2
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +0 -1
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +10 -10
- package/core/QueryManager.js.map +1 -1
- package/core/{core.cjs.js → core.cjs} +38 -34
- package/core/core.cjs.map +1 -0
- package/core/package.json +2 -1
- package/errors/{errors.cjs.js → errors.cjs} +3 -3
- package/errors/errors.cjs.map +1 -0
- package/errors/index.d.ts +3 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +2 -2
- package/errors/index.js.map +1 -1
- package/errors/package.json +2 -1
- package/invariantErrorCodes.js +84 -104
- package/link/batch/{batch.cjs.js → batch.cjs} +2 -2
- package/link/batch/batch.cjs.map +1 -0
- package/link/batch/batchLink.d.ts +0 -1
- package/link/batch/batchLink.d.ts.map +1 -1
- package/link/batch/batching.d.ts +0 -1
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch/package.json +2 -1
- package/link/batch-http/{batch-http.cjs.js → batch-http.cjs} +3 -3
- package/link/batch-http/batch-http.cjs.map +1 -0
- package/link/batch-http/batchHttpLink.d.ts +0 -1
- package/link/batch-http/batchHttpLink.d.ts.map +1 -1
- package/link/batch-http/batchHttpLink.js +3 -3
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/batch-http/package.json +2 -1
- package/link/context/{context.cjs.js → context.cjs} +1 -1
- package/link/context/context.cjs.map +1 -0
- package/link/context/index.js.map +1 -1
- package/link/context/package.json +2 -1
- package/link/core/ApolloLink.d.ts +2 -3
- package/link/core/ApolloLink.d.ts.map +1 -1
- package/link/core/ApolloLink.js +1 -1
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/{core.cjs.js → core.cjs} +2 -2
- package/link/core/core.cjs.map +1 -0
- package/link/core/package.json +2 -1
- package/link/core/types.d.ts +4 -7
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/error/{error.cjs.js → error.cjs} +2 -2
- package/link/error/error.cjs.map +1 -0
- package/link/error/index.d.ts +5 -7
- package/link/error/index.d.ts.map +1 -1
- package/link/error/index.js +1 -1
- package/link/error/index.js.map +1 -1
- package/link/error/package.json +2 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +3 -3
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/{http.cjs.js → http.cjs} +28 -15
- package/link/http/http.cjs.map +1 -0
- package/link/http/index.d.ts +1 -1
- package/link/http/index.d.ts.map +1 -1
- package/link/http/index.js +1 -1
- package/link/http/index.js.map +1 -1
- package/link/http/package.json +2 -1
- package/link/http/parseAndCheckHttpResponse.js +3 -3
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/rewriteURIForGET.js +1 -1
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +11 -1
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +20 -7
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +3 -3
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/package.json +2 -1
- package/link/persisted-queries/{persisted-queries.cjs.js → persisted-queries.cjs} +3 -3
- package/link/persisted-queries/persisted-queries.cjs.map +1 -0
- package/link/retry/package.json +2 -1
- package/link/retry/{retry.cjs.js → retry.cjs} +1 -1
- package/link/retry/retry.cjs.map +1 -0
- package/link/retry/retryLink.d.ts +0 -1
- package/link/retry/retryLink.d.ts.map +1 -1
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +0 -1
- package/link/schema/index.d.ts.map +1 -1
- package/link/schema/index.js +8 -1
- package/link/schema/index.js.map +1 -1
- package/link/schema/package.json +2 -1
- package/link/schema/{schema.cjs.js → schema.cjs} +9 -2
- package/link/schema/schema.cjs.map +1 -0
- package/link/utils/fromError.d.ts +0 -1
- package/link/utils/fromError.d.ts.map +1 -1
- package/link/utils/fromPromise.d.ts +0 -1
- package/link/utils/fromPromise.d.ts.map +1 -1
- package/link/utils/package.json +2 -1
- package/link/utils/toPromise.d.ts +0 -1
- package/link/utils/toPromise.d.ts.map +1 -1
- package/link/utils/{utils.cjs.js → utils.cjs} +2 -2
- package/link/utils/utils.cjs.map +1 -0
- package/link/utils/validateOperation.js +1 -1
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.d.ts +0 -1
- package/link/ws/index.d.ts.map +1 -1
- package/link/ws/package.json +2 -1
- package/link/ws/{ws.cjs.js → ws.cjs} +1 -1
- package/link/ws/ws.cjs.map +1 -0
- package/{main.cjs.js → main.cjs} +5 -5
- package/main.cjs.map +1 -0
- package/package.json +20 -19
- package/react/components/Query.js.map +1 -1
- package/react/components/{components.cjs.js → components.cjs} +4 -4
- package/react/components/components.cjs.map +1 -0
- package/react/components/package.json +2 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/{context.cjs.js → context.cjs} +6 -6
- package/react/context/context.cjs.map +1 -0
- package/react/context/index.d.ts +3 -3
- package/react/context/index.d.ts.map +1 -1
- package/react/context/index.js +3 -3
- package/react/context/index.js.map +1 -1
- package/react/context/package.json +2 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/{hoc.cjs.js → hoc.cjs} +12 -12
- package/react/hoc/hoc.cjs.map +1 -0
- package/react/hoc/mutation-hoc.js +2 -2
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/package.json +2 -1
- package/react/hoc/query-hoc.js +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.js +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/withApollo.js +2 -2
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs +502 -0
- package/react/hooks/hooks.cjs.map +1 -0
- package/react/hooks/package.json +2 -1
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.d.ts.map +1 -1
- package/react/hooks/useApolloClient.js +7 -5
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js +56 -2
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +89 -21
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +2 -3
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +224 -2
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +2 -7
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +89 -32
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/package.json +2 -1
- package/react/parser/index.d.ts +1 -0
- package/react/parser/index.d.ts.map +1 -1
- package/react/parser/index.js +16 -9
- package/react/parser/index.js.map +1 -1
- package/react/parser/package.json +2 -1
- package/react/parser/{parser.cjs.js → parser.cjs} +18 -10
- package/react/parser/parser.cjs.map +1 -0
- package/react/{react.cjs.js → react.cjs} +3 -3
- package/react/react.cjs.map +1 -0
- package/react/ssr/RenderPromises.d.ts +7 -3
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/package.json +2 -1
- package/react/ssr/{ssr.cjs.js → ssr.cjs} +4 -4
- package/react/ssr/ssr.cjs.map +1 -0
- package/react/types/types.d.ts +7 -18
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/{testing.cjs.js → core/core.cjs} +10 -104
- package/testing/core/core.cjs.map +1 -0
- package/{utilities/testing → testing/core}/index.d.ts +0 -1
- package/testing/core/index.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/index.js +0 -1
- package/testing/core/index.js.map +1 -0
- package/{utilities/testing → testing/core}/itAsync.d.ts +0 -0
- package/testing/core/itAsync.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/itAsync.js +0 -0
- package/testing/core/itAsync.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockClient.d.ts +0 -0
- package/testing/core/mocking/mockClient.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockClient.js +0 -0
- package/testing/core/mocking/mockClient.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockFetch.d.ts +0 -0
- package/testing/core/mocking/mockFetch.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockFetch.js +1 -1
- package/testing/core/mocking/mockFetch.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockLink.d.ts +0 -1
- package/testing/core/mocking/mockLink.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockLink.js +5 -5
- package/testing/core/mocking/mockLink.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockQueryManager.d.ts +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockQueryManager.js +1 -1
- package/testing/core/mocking/mockQueryManager.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.d.ts +1 -4
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.js +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockWatchQuery.d.ts +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/mocking/mockWatchQuery.js +0 -0
- package/testing/core/mocking/mockWatchQuery.js.map +1 -0
- package/{utilities/testing → testing/core}/observableToPromise.d.ts +2 -3
- package/testing/core/observableToPromise.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/observableToPromise.js +1 -1
- package/testing/core/observableToPromise.js.map +1 -0
- package/testing/core/package.json +8 -0
- package/testing/core/subscribeAndCount.d.ts +4 -0
- package/testing/core/subscribeAndCount.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/subscribeAndCount.js +1 -1
- package/testing/core/subscribeAndCount.js.map +1 -0
- package/{utilities/testing → testing/core}/withConsoleSpy.d.ts +0 -0
- package/testing/core/withConsoleSpy.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/withConsoleSpy.js +0 -0
- package/testing/core/withConsoleSpy.js.map +1 -0
- package/{utilities/testing → testing/core}/wrap.d.ts +0 -0
- package/testing/core/wrap.d.ts.map +1 -0
- package/{utilities/testing → testing/core}/wrap.js +0 -0
- package/testing/core/wrap.js.map +1 -0
- package/testing/index.d.ts +2 -1
- package/testing/index.d.ts.map +1 -1
- package/testing/index.js +2 -1
- package/testing/index.js.map +1 -1
- package/testing/package.json +2 -1
- package/{utilities/testing/mocking → testing/react}/MockedProvider.d.ts +5 -5
- package/testing/react/MockedProvider.d.ts.map +1 -0
- package/{utilities/testing/mocking → testing/react}/MockedProvider.js +4 -4
- package/testing/react/MockedProvider.js.map +1 -0
- package/testing/testing.cjs +58 -0
- package/testing/testing.cjs.map +1 -0
- package/utilities/common/errorHandling.d.ts +1 -1
- package/utilities/common/errorHandling.d.ts.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/makeUniqueId.js +1 -1
- package/utilities/common/makeUniqueId.js.map +1 -1
- package/utilities/common/mergeDeep.d.ts.map +1 -1
- package/utilities/common/mergeDeep.js +6 -1
- package/utilities/common/mergeDeep.js.map +1 -1
- package/utilities/globals/fix-graphql.js +1 -1
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js +1 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/{globals.cjs.js → globals.cjs} +3 -3
- package/utilities/globals/globals.cjs.map +1 -0
- package/utilities/globals/index.js +1 -1
- package/utilities/globals/package.json +2 -1
- package/utilities/graphql/directives.js +5 -5
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts.map +1 -1
- package/utilities/graphql/fragments.js +4 -4
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/storeUtils.js +6 -6
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/observables/Concast.d.ts +0 -1
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/asyncMap.d.ts +0 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/subclassing.d.ts +0 -1
- package/utilities/observables/subclassing.d.ts.map +1 -1
- package/utilities/package.json +2 -1
- package/utilities/{utilities.cjs.js → utilities.cjs} +31 -26
- package/utilities/utilities.cjs.map +1 -0
- package/version.js +1 -1
- package/apollo-client.cjs.js.map +0 -1
- package/apollo-client.cjs.min.js +0 -1
- package/cache/cache.cjs.js.map +0 -1
- package/core/core.cjs.js.map +0 -1
- package/errors/errors.cjs.js.map +0 -1
- package/link/batch/batch.cjs.js.map +0 -1
- package/link/batch-http/batch-http.cjs.js.map +0 -1
- package/link/context/context.cjs.js.map +0 -1
- package/link/core/core.cjs.js.map +0 -1
- package/link/error/error.cjs.js.map +0 -1
- package/link/http/http.cjs.js.map +0 -1
- package/link/persisted-queries/persisted-queries.cjs.js.map +0 -1
- package/link/retry/retry.cjs.js.map +0 -1
- package/link/schema/schema.cjs.js.map +0 -1
- package/link/utils/utils.cjs.js.map +0 -1
- package/link/ws/ws.cjs.js.map +0 -1
- package/main.cjs.js.map +0 -1
- package/react/components/components.cjs.js.map +0 -1
- package/react/context/context.cjs.js.map +0 -1
- package/react/data/MutationData.d.ts +0 -29
- package/react/data/MutationData.d.ts.map +0 -1
- package/react/data/MutationData.js +0 -115
- package/react/data/MutationData.js.map +0 -1
- package/react/data/OperationData.d.ts +0 -24
- package/react/data/OperationData.d.ts.map +0 -1
- package/react/data/OperationData.js +0 -53
- package/react/data/OperationData.js.map +0 -1
- package/react/data/QueryData.d.ts +0 -44
- package/react/data/QueryData.d.ts.map +0 -1
- package/react/data/QueryData.js +0 -298
- package/react/data/QueryData.js.map +0 -1
- package/react/data/SubscriptionData.d.ts +0 -28
- package/react/data/SubscriptionData.d.ts.map +0 -1
- package/react/data/SubscriptionData.js +0 -122
- package/react/data/SubscriptionData.js.map +0 -1
- package/react/data/data.cjs.js +0 -581
- package/react/data/data.cjs.js.map +0 -1
- package/react/data/index.d.ts +0 -6
- package/react/data/index.d.ts.map +0 -1
- package/react/data/index.js +0 -6
- package/react/data/index.js.map +0 -1
- package/react/data/package.json +0 -7
- package/react/hoc/hoc.cjs.js.map +0 -1
- package/react/hooks/hooks.cjs.js +0 -195
- package/react/hooks/hooks.cjs.js.map +0 -1
- package/react/hooks/utils/useAfterFastRefresh.d.ts +0 -3
- package/react/hooks/utils/useAfterFastRefresh.d.ts.map +0 -1
- package/react/hooks/utils/useAfterFastRefresh.js +0 -19
- package/react/hooks/utils/useAfterFastRefresh.js.map +0 -1
- package/react/hooks/utils/useBaseQuery.d.ts +0 -7
- package/react/hooks/utils/useBaseQuery.d.ts.map +0 -1
- package/react/hooks/utils/useBaseQuery.js +0 -55
- package/react/hooks/utils/useBaseQuery.js.map +0 -1
- package/react/hooks/utils/useDeepMemo.d.ts +0 -2
- package/react/hooks/utils/useDeepMemo.d.ts.map +0 -1
- package/react/hooks/utils/useDeepMemo.js +0 -10
- package/react/hooks/utils/useDeepMemo.js.map +0 -1
- package/react/parser/parser.cjs.js.map +0 -1
- package/react/react.cjs.js.map +0 -1
- package/react/ssr/ssr.cjs.js.map +0 -1
- package/testing/testing.cjs.js.map +0 -1
- package/utilities/globals/globals.cjs.js.map +0 -1
- package/utilities/testing/index.d.ts.map +0 -1
- package/utilities/testing/index.js.map +0 -1
- package/utilities/testing/itAsync.d.ts.map +0 -1
- package/utilities/testing/itAsync.js.map +0 -1
- package/utilities/testing/mocking/MockedProvider.d.ts.map +0 -1
- package/utilities/testing/mocking/MockedProvider.js.map +0 -1
- package/utilities/testing/mocking/mockClient.d.ts.map +0 -1
- package/utilities/testing/mocking/mockClient.js.map +0 -1
- package/utilities/testing/mocking/mockFetch.d.ts.map +0 -1
- package/utilities/testing/mocking/mockFetch.js.map +0 -1
- package/utilities/testing/mocking/mockLink.d.ts.map +0 -1
- package/utilities/testing/mocking/mockLink.js.map +0 -1
- package/utilities/testing/mocking/mockQueryManager.d.ts.map +0 -1
- package/utilities/testing/mocking/mockQueryManager.js.map +0 -1
- package/utilities/testing/mocking/mockSubscriptionLink.d.ts.map +0 -1
- package/utilities/testing/mocking/mockSubscriptionLink.js.map +0 -1
- package/utilities/testing/mocking/mockWatchQuery.d.ts.map +0 -1
- package/utilities/testing/mocking/mockWatchQuery.js.map +0 -1
- package/utilities/testing/observableToPromise.d.ts.map +0 -1
- package/utilities/testing/observableToPromise.js.map +0 -1
- package/utilities/testing/subscribeAndCount.d.ts +0 -5
- package/utilities/testing/subscribeAndCount.d.ts.map +0 -1
- package/utilities/testing/subscribeAndCount.js.map +0 -1
- package/utilities/testing/withConsoleSpy.d.ts.map +0 -1
- package/utilities/testing/withConsoleSpy.js.map +0 -1
- package/utilities/testing/wrap.d.ts.map +0 -1
- package/utilities/testing/wrap.js.map +0 -1
- package/utilities/utilities.cjs.js.map +0 -1
package/invariantErrorCodes.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// consult the @apollo/client/invariantErrorCodes.js file specific to
|
|
6
6
|
// your @apollo/client version. This file is not meant to be imported.
|
|
7
7
|
{
|
|
8
|
-
"@apollo/client version": "3.
|
|
8
|
+
"@apollo/client version": "3.5.6",
|
|
9
9
|
|
|
10
10
|
1: {
|
|
11
11
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
@@ -13,44 +13,31 @@
|
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
2: {
|
|
16
|
-
file: "@apollo/client/cache/inmemory/
|
|
17
|
-
node: invariant(
|
|
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
18
|
},
|
|
19
19
|
|
|
20
20
|
3: {
|
|
21
21
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
22
|
-
node:
|
|
22
|
+
node: invariant(!old || old === which, "Cannot change root ".concat(which, " __typename more than once"))
|
|
23
23
|
},
|
|
24
24
|
|
|
25
25
|
4: {
|
|
26
26
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
27
|
-
node:
|
|
27
|
+
node: new InvariantError("Cannot automatically merge arrays")
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
5: {
|
|
31
31
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
32
|
-
node:
|
|
32
|
+
node: invariant(!isReference(value), "Missing selection set for object of type ".concat(getTypenameFromStoreObject(store, value), " returned for query field ").concat(field.name.value))
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
6: {
|
|
36
|
-
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
37
|
-
|
|
38
|
-
node: new InvariantError("Can't find field '" + selection.name.value + "' on " + (isReference(objectOrReference)
|
|
39
|
-
? objectOrReference.__ref + " object"
|
|
40
|
-
: "object " + JSON.stringify(objectOrReference, null, 2)))
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
7: {
|
|
44
|
-
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
45
|
-
node: invariant(!isReference(value), "Missing selection set for object of type " + getTypenameFromStoreObject(store, value) + " returned for query field " + field.name.value)
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
8: {
|
|
49
36
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
50
|
-
node: new InvariantError("Could not identify object "
|
|
37
|
+
node: new InvariantError("Could not identify object ".concat(JSON.stringify(result)))
|
|
51
38
|
},
|
|
52
39
|
|
|
53
|
-
|
|
40
|
+
7: {
|
|
54
41
|
file: "@apollo/client/core/ApolloClient.js",
|
|
55
42
|
|
|
56
43
|
node: new InvariantError("To initialize Apollo Client, you must specify a 'cache' property " +
|
|
@@ -58,7 +45,7 @@
|
|
|
58
45
|
"For more information, please visit: https://go.apollo.dev/c/docs")
|
|
59
46
|
},
|
|
60
47
|
|
|
61
|
-
|
|
48
|
+
8: {
|
|
62
49
|
file: "@apollo/client/core/ApolloClient.js",
|
|
63
50
|
|
|
64
51
|
node: invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +
|
|
@@ -67,76 +54,76 @@
|
|
|
67
54
|
'using a different fetchPolicy, such as cache-first or network-only.')
|
|
68
55
|
},
|
|
69
56
|
|
|
70
|
-
|
|
57
|
+
9: {
|
|
71
58
|
file: "@apollo/client/core/LocalState.js",
|
|
72
|
-
node: invariant(fragment, "No fragment named "
|
|
59
|
+
node: invariant(fragment, "No fragment named ".concat(selection.name.value))
|
|
73
60
|
},
|
|
74
61
|
|
|
75
|
-
|
|
62
|
+
10: {
|
|
76
63
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
77
64
|
node: invariant(pollInterval, 'Attempted to start a polling query without a polling interval.')
|
|
78
65
|
},
|
|
79
66
|
|
|
80
|
-
|
|
67
|
+
11: {
|
|
81
68
|
file: "@apollo/client/core/QueryManager.js",
|
|
82
69
|
node: new InvariantError('QueryManager stopped while query was in flight')
|
|
83
70
|
},
|
|
84
71
|
|
|
85
|
-
|
|
72
|
+
12: {
|
|
86
73
|
file: "@apollo/client/core/QueryManager.js",
|
|
87
74
|
node: invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.')
|
|
88
75
|
},
|
|
89
76
|
|
|
90
|
-
|
|
77
|
+
13: {
|
|
91
78
|
file: "@apollo/client/core/QueryManager.js",
|
|
92
79
|
|
|
93
80
|
node: invariant(fetchPolicy === 'network-only' ||
|
|
94
81
|
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.")
|
|
95
82
|
},
|
|
96
83
|
|
|
97
|
-
|
|
84
|
+
14: {
|
|
98
85
|
file: "@apollo/client/core/QueryManager.js",
|
|
99
86
|
|
|
100
87
|
node: invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
|
|
101
88
|
'in the query option.')
|
|
102
89
|
},
|
|
103
90
|
|
|
104
|
-
|
|
91
|
+
15: {
|
|
105
92
|
file: "@apollo/client/core/QueryManager.js",
|
|
106
93
|
node: invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.')
|
|
107
94
|
},
|
|
108
95
|
|
|
109
|
-
|
|
96
|
+
16: {
|
|
110
97
|
file: "@apollo/client/core/QueryManager.js",
|
|
111
98
|
node: invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.')
|
|
112
99
|
},
|
|
113
100
|
|
|
114
|
-
|
|
101
|
+
17: {
|
|
115
102
|
file: "@apollo/client/core/QueryManager.js",
|
|
116
103
|
node: invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.')
|
|
117
104
|
},
|
|
118
105
|
|
|
119
|
-
|
|
106
|
+
18: {
|
|
120
107
|
file: "@apollo/client/core/QueryManager.js",
|
|
121
108
|
node: new InvariantError('Store reset while query was in flight (not completed in link chain)')
|
|
122
109
|
},
|
|
123
110
|
|
|
124
|
-
|
|
111
|
+
19: {
|
|
125
112
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
126
113
|
node: new InvariantError('request is not implemented')
|
|
127
114
|
},
|
|
128
115
|
|
|
129
|
-
|
|
116
|
+
20: {
|
|
130
117
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
131
118
|
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 ")
|
|
132
119
|
},
|
|
133
120
|
|
|
134
|
-
|
|
121
|
+
21: {
|
|
135
122
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
136
|
-
node: new InvariantError("Network request failed. "
|
|
123
|
+
node: new InvariantError("Network request failed. ".concat(label, " is not serializable: ").concat(e.message))
|
|
137
124
|
},
|
|
138
125
|
|
|
139
|
-
|
|
126
|
+
22: {
|
|
140
127
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
141
128
|
|
|
142
129
|
node: invariant(options && (typeof options.sha256 === 'function' ||
|
|
@@ -145,75 +132,61 @@
|
|
|
145
132
|
'parameter.')
|
|
146
133
|
},
|
|
147
134
|
|
|
148
|
-
|
|
135
|
+
23: {
|
|
149
136
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
150
137
|
node: invariant(forward, 'PersistedQueryLink cannot be the last link in the chain.')
|
|
151
138
|
},
|
|
152
139
|
|
|
153
|
-
|
|
140
|
+
24: {
|
|
154
141
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
155
|
-
node: new InvariantError("illegal argument: "
|
|
142
|
+
node: new InvariantError("illegal argument: ".concat(key))
|
|
156
143
|
},
|
|
157
144
|
|
|
158
|
-
|
|
145
|
+
25: {
|
|
159
146
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
160
147
|
|
|
161
148
|
node: invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
|
|
162
149
|
'Wrap the root component in an <ApolloProvider>.')
|
|
163
150
|
},
|
|
164
151
|
|
|
165
|
-
|
|
152
|
+
26: {
|
|
166
153
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
167
154
|
|
|
168
155
|
node: invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
|
|
169
156
|
'sure you pass in your client via the "client" prop.')
|
|
170
157
|
},
|
|
171
158
|
|
|
172
|
-
|
|
173
|
-
file: "@apollo/client/react/data/OperationData.js",
|
|
174
|
-
|
|
175
|
-
node: invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
|
|
176
|
-
'Wrap the root component in an <ApolloProvider>, or pass an ' +
|
|
177
|
-
'ApolloClient instance in via options.')
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
30: {
|
|
181
|
-
file: "@apollo/client/react/data/OperationData.js",
|
|
182
|
-
|
|
183
|
-
node: invariant(operation.type === type, "Running a " + requiredOperationName + " requires a graphql " +
|
|
184
|
-
(requiredOperationName + ", but a " + usedOperationName + " was used instead."))
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
31: {
|
|
159
|
+
27: {
|
|
188
160
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
189
161
|
|
|
190
162
|
node: invariant(this.withRef, "To access the wrapped instance, you need to specify " +
|
|
191
163
|
"{ withRef: true } in the options")
|
|
192
164
|
},
|
|
193
165
|
|
|
194
|
-
|
|
166
|
+
28: {
|
|
195
167
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
196
168
|
|
|
197
169
|
node: invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
|
|
198
170
|
"{ withRef: true } in the options")
|
|
199
171
|
},
|
|
200
172
|
|
|
201
|
-
|
|
173
|
+
29: {
|
|
202
174
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
203
175
|
|
|
204
|
-
node: invariant(client, '
|
|
205
|
-
'
|
|
176
|
+
node: invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
|
|
177
|
+
'Wrap the root component in an <ApolloProvider>, or pass an ApolloClient' +
|
|
178
|
+
'ApolloClient instance in via options.')
|
|
206
179
|
},
|
|
207
180
|
|
|
208
|
-
|
|
181
|
+
30: {
|
|
209
182
|
file: "@apollo/client/react/parser/index.js",
|
|
210
183
|
|
|
211
|
-
node: invariant(!!document && !!document.kind, "Argument of "
|
|
184
|
+
node: invariant(!!document && !!document.kind, "Argument of ".concat(document, " passed to parser was not a valid GraphQL ") +
|
|
212
185
|
"DocumentNode. You may need to use 'graphql-tag' or another method " +
|
|
213
186
|
"to convert your operation into a document")
|
|
214
187
|
},
|
|
215
188
|
|
|
216
|
-
|
|
189
|
+
31: {
|
|
217
190
|
file: "@apollo/client/react/parser/index.js",
|
|
218
191
|
|
|
219
192
|
node: invariant(!fragments.length ||
|
|
@@ -221,117 +194,124 @@
|
|
|
221
194
|
"You must include a query, subscription or mutation as well")
|
|
222
195
|
},
|
|
223
196
|
|
|
224
|
-
|
|
197
|
+
32: {
|
|
225
198
|
file: "@apollo/client/react/parser/index.js",
|
|
226
199
|
|
|
227
200
|
node: invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
|
|
228
|
-
(document
|
|
229
|
-
|
|
201
|
+
"".concat(document, " had ").concat(queries.length, " queries, ").concat(subscriptions.length, " ") +
|
|
202
|
+
"subscriptions and ".concat(mutations.length, " mutations. ") +
|
|
230
203
|
"You can use 'compose' to join multiple operation types to a component")
|
|
231
204
|
},
|
|
232
205
|
|
|
233
|
-
|
|
206
|
+
33: {
|
|
234
207
|
file: "@apollo/client/react/parser/index.js",
|
|
235
208
|
|
|
236
|
-
node: invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. "
|
|
237
|
-
(definitions.length
|
|
209
|
+
node: invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. ".concat(document, " had ") +
|
|
210
|
+
"".concat(definitions.length, " definitions. ") +
|
|
238
211
|
"You can use 'compose' to join multiple operation types to a component")
|
|
239
212
|
},
|
|
240
213
|
|
|
241
|
-
|
|
214
|
+
34: {
|
|
215
|
+
file: "@apollo/client/react/parser/index.js",
|
|
216
|
+
|
|
217
|
+
node: invariant(operation.type === type, "Running a ".concat(requiredOperationName, " requires a graphql ") +
|
|
218
|
+
"".concat(requiredOperationName, ", but a ").concat(usedOperationName, " was used instead."))
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
35: {
|
|
222
|
+
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
223
|
+
node: invariant(queryWithoutConnection, "query is required")
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
36: {
|
|
242
227
|
file: "@apollo/client/utilities/globals/index.js",
|
|
243
228
|
node: invariant("boolean" === typeof DEV, DEV)
|
|
244
229
|
},
|
|
245
230
|
|
|
246
|
-
|
|
231
|
+
37: {
|
|
247
232
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
248
|
-
node: invariant(evaledValue !== void 0, "Invalid variable referenced in @"
|
|
233
|
+
node: invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive."))
|
|
249
234
|
},
|
|
250
235
|
|
|
251
|
-
|
|
236
|
+
38: {
|
|
252
237
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
253
|
-
node: invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @"
|
|
238
|
+
node: invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive."))
|
|
254
239
|
},
|
|
255
240
|
|
|
256
|
-
|
|
241
|
+
39: {
|
|
257
242
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
258
|
-
node: invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @"
|
|
243
|
+
node: invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive."))
|
|
259
244
|
},
|
|
260
245
|
|
|
261
|
-
|
|
246
|
+
40: {
|
|
262
247
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
263
248
|
|
|
264
249
|
node: invariant(ifValue &&
|
|
265
|
-
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @"
|
|
250
|
+
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @".concat(directiveName, " directive must be a variable or a boolean value."))
|
|
266
251
|
},
|
|
267
252
|
|
|
268
|
-
|
|
253
|
+
41: {
|
|
269
254
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
270
255
|
|
|
271
|
-
node: new InvariantError("Found a "
|
|
256
|
+
node: new InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
|
|
272
257
|
'No operations are allowed when using a fragment as a query. Only fragments are allowed.')
|
|
273
258
|
},
|
|
274
259
|
|
|
275
|
-
|
|
260
|
+
42: {
|
|
276
261
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
277
|
-
node: invariant(fragments.length === 1, "Found "
|
|
262
|
+
node: invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."))
|
|
278
263
|
},
|
|
279
264
|
|
|
280
|
-
|
|
265
|
+
43: {
|
|
281
266
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
282
|
-
node: invariant(fragment, "No fragment named "
|
|
267
|
+
node: invariant(fragment, "No fragment named ".concat(selection.name.value, "."))
|
|
283
268
|
},
|
|
284
269
|
|
|
285
|
-
|
|
270
|
+
44: {
|
|
286
271
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
287
272
|
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")
|
|
288
273
|
},
|
|
289
274
|
|
|
290
|
-
|
|
275
|
+
45: {
|
|
291
276
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
292
|
-
node: new InvariantError("Schema type definitions not allowed in queries. Found: \""
|
|
277
|
+
node: new InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\""))
|
|
293
278
|
},
|
|
294
279
|
|
|
295
|
-
|
|
280
|
+
46: {
|
|
296
281
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
297
|
-
node: invariant(operations.length <= 1, "Ambiguous GraphQL document: contains "
|
|
282
|
+
node: invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations"))
|
|
298
283
|
},
|
|
299
284
|
|
|
300
|
-
|
|
285
|
+
47: {
|
|
301
286
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
302
287
|
node: invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.')
|
|
303
288
|
},
|
|
304
289
|
|
|
305
|
-
|
|
290
|
+
48: {
|
|
306
291
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
307
292
|
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")
|
|
308
293
|
},
|
|
309
294
|
|
|
310
|
-
|
|
295
|
+
49: {
|
|
311
296
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
312
297
|
node: invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.')
|
|
313
298
|
},
|
|
314
299
|
|
|
315
|
-
|
|
300
|
+
50: {
|
|
316
301
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
317
302
|
node: invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.')
|
|
318
303
|
},
|
|
319
304
|
|
|
320
|
-
|
|
305
|
+
51: {
|
|
321
306
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
322
307
|
node: new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.')
|
|
323
308
|
},
|
|
324
309
|
|
|
325
|
-
|
|
310
|
+
52: {
|
|
326
311
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
327
312
|
|
|
328
|
-
node: new InvariantError("The inline argument \""
|
|
313
|
+
node: new InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
|
|
329
314
|
'is not supported. Use variables instead of inline arguments to ' +
|
|
330
315
|
'overcome this limitation.')
|
|
331
|
-
},
|
|
332
|
-
|
|
333
|
-
55: {
|
|
334
|
-
file: "@apollo/client/utilities/testing/mocking/mockLink.js",
|
|
335
|
-
node: invariant(queryWithoutConnection, "query is required")
|
|
336
316
|
}
|
|
337
317
|
}
|
|
@@ -86,7 +86,7 @@ var OperationBatcher = (function () {
|
|
|
86
86
|
results = [results];
|
|
87
87
|
}
|
|
88
88
|
if (nexts.length !== results.length) {
|
|
89
|
-
var error = new Error("server returned results with length "
|
|
89
|
+
var error = new Error("server returned results with length ".concat(results.length, ", expected length of ").concat(nexts.length));
|
|
90
90
|
error.result = results;
|
|
91
91
|
return onError(error);
|
|
92
92
|
}
|
|
@@ -148,4 +148,4 @@ var BatchLink = (function (_super) {
|
|
|
148
148
|
|
|
149
149
|
exports.BatchLink = BatchLink;
|
|
150
150
|
exports.OperationBatcher = OperationBatcher;
|
|
151
|
-
//# sourceMappingURL=batch.cjs.
|
|
151
|
+
//# 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.queuedRequests = 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({}, request);\n var queued = false;\n var key = this.batchKey(request.operation);\n if (!requestCopy.observable) {\n requestCopy.observable = new Observable(function (observer) {\n if (!_this.queuedRequests.has(key)) {\n _this.queuedRequests.set(key, []);\n }\n if (!queued) {\n _this.queuedRequests.get(key).push(requestCopy);\n queued = true;\n }\n requestCopy.next = requestCopy.next || [];\n if (observer.next)\n requestCopy.next.push(observer.next.bind(observer));\n requestCopy.error = requestCopy.error || [];\n if (observer.error)\n requestCopy.error.push(observer.error.bind(observer));\n requestCopy.complete = requestCopy.complete || [];\n if (observer.complete)\n requestCopy.complete.push(observer.complete.bind(observer));\n if (_this.queuedRequests.get(key).length === 1) {\n _this.scheduleQueueConsumption(key);\n }\n else if (_this.batchDebounce) {\n clearTimeout(_this.scheduledBatchTimer);\n _this.scheduleQueueConsumption(key);\n }\n if (_this.queuedRequests.get(key).length === _this.batchMax) {\n _this.consumeQueue(key);\n }\n });\n }\n return requestCopy.observable;\n };\n OperationBatcher.prototype.consumeQueue = function (key) {\n var requestKey = key || '';\n var queuedRequests = this.queuedRequests.get(requestKey);\n if (!queuedRequests) {\n return;\n }\n this.queuedRequests.delete(requestKey);\n var requests = queuedRequests.map(function (queuedRequest) { return queuedRequest.operation; });\n var forwards = queuedRequests.map(function (queuedRequest) { return queuedRequest.forward; });\n var observables = [];\n var nexts = [];\n var errors = [];\n var completes = [];\n queuedRequests.forEach(function (batchableRequest, index) {\n observables.push(batchableRequest.observable);\n nexts.push(batchableRequest.next);\n errors.push(batchableRequest.error);\n completes.push(batchableRequest.complete);\n });\n var batchedObservable = this.batchHandler(requests, 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 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 var requestKey = key || '';\n this.scheduledBatchTimer = (setTimeout(function () {\n if (_this.queuedRequests.get(requestKey) &&\n _this.queuedRequests.get(requestKey).length) {\n _this.consumeQueue(requestKey);\n }\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,CAAC,QAAQ,EAAE,YAAY,GAAG,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AAC/J,QAAQ,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;AACxC,QAAQ,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;AAC3C,QAAQ,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;AAC3C,QAAQ,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,CAAC;AACtC,QAAQ,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;AACzC,QAAQ,IAAI,CAAC,QAAQ,GAAG,QAAQ,KAAK,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AACjE,KAAK;AACL,IAAI,gBAAgB,CAAC,SAAS,CAAC,cAAc,GAAG,UAAU,OAAO,EAAE;AACnE,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC;AACzB,QAAQ,IAAI,WAAW,GAAGA,cAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AAChD,QAAQ,IAAI,MAAM,GAAG,KAAK,CAAC;AAC3B,QAAQ,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACnD,QAAQ,IAAI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,YAAY,YAAY,EAAE,YAAY;AACtC,YAAY,QAAQ,EAAE,QAAQ;AAC9B,SAAS,CAAC,CAAC;AACX,QAAQ,IAAI,WAAW,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,EAAE;AAClD,YAAY,KAAK,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;AACpH,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,OAAO,EAAE;AAChE,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;AAC3C,YAAY,SAAS,EAAE,SAAS;AAChC,YAAY,OAAO,EAAE,OAAO;AAC5B,SAAS,CAAC,CAAC;AACX,KAAK,CAAC;AACN,IAAI,OAAO,SAAS,CAAC;AACrB,CAAC,CAACC,eAAU,CAAC;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batchLink.d.ts","sourceRoot":"","sources":["../../../src/link/batch/batchLink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"batchLink.d.ts","sourceRoot":"","sources":["../../../src/link/batch/batchLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAoB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG9E,yBAAiB,SAAS,CAAC;IACzB,UAAiB,OAAO;QAMtB,aAAa,CAAC,EAAE,MAAM,CAAC;QAOvB,aAAa,CAAC,EAAE,OAAO,CAAC;QAOxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAKlB,YAAY,CAAC,EAAE,YAAY,CAAC;QAK5B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC;KAC7C;CACF;AAED,qBAAa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,OAAO,CAAmB;gBAEtB,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO;IAyBpC,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAMlC"}
|
package/link/batch/batching.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="zen-observable" />
|
|
2
1
|
import { Operation, FetchResult, NextLink } from '../core';
|
|
3
2
|
import { Observable } from '../../utilities';
|
|
4
3
|
export declare type BatchHandler = (operations: Operation[], forward?: (NextLink | undefined)[]) => Observable<FetchResult[]> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batching.d.ts","sourceRoot":"","sources":["../../../src/link/batch/batching.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"batching.d.ts","sourceRoot":"","sources":["../../../src/link/batch/batching.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,oBAAY,YAAY,GAAG,CACzB,UAAU,EAAE,SAAS,EAAE,EACvB,OAAO,CAAC,EAAE,CAAC,QAAQ,GAAG,SAAS,CAAC,EAAE,KAC/B,UAAU,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAC;IAKnB,UAAU,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;CAC9B;AAKD,qBAAa,gBAAgB;IAGpB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAEvD,OAAO,CAAC,mBAAmB,CAAgC;IAC3D,OAAO,CAAC,aAAa,CAAC,CAAU;IAChC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAS;IAGzB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAmC;gBAEvC,EACV,aAAa,EACb,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAQ,GACT,EAAE;QACD,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,YAAY,CAAC;QAC3B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC;KAC7C;IASM,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC;IAmDlE,YAAY,CACjB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS;IA+EtD,OAAO,CAAC,wBAAwB;CAWjC"}
|
package/link/batch/batching.js
CHANGED
|
@@ -80,7 +80,7 @@ var OperationBatcher = (function () {
|
|
|
80
80
|
results = [results];
|
|
81
81
|
}
|
|
82
82
|
if (nexts.length !== results.length) {
|
|
83
|
-
var error = new Error("server returned results with length "
|
|
83
|
+
var error = new Error("server returned results with length ".concat(results.length, ", expected length of ").concat(nexts.length));
|
|
84
84
|
error.result = results;
|
|
85
85
|
return onError(error);
|
|
86
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batching.js","sourceRoot":"","sources":["../../../src/link/batch/batching.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAuB7C;IAcE,0BAAY,EAYX;YAXC,aAAa,mBAAA,EACb,aAAa,mBAAA,EACb,QAAQ,cAAA,EACR,YAAY,kBAAA,EACZ,QAAQ,cAAA;QAQR,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,cAAM,OAAA,EAAE,EAAF,CAAE,CAAC,CAAC;IACzC,CAAC;IAEM,yCAAc,GAArB,UAAsB,OAAyB;QAA/C,iBA+CC;QA9CC,IAAM,WAAW,gBACZ,OAAO,CACX,CAAC;QACF,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,IAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE7C,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE;YAC3B,WAAW,CAAC,UAAU,GAAG,IAAI,UAAU,CAAc,UAAA,QAAQ;gBAC3D,IAAI,CAAC,KAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBACjC,KAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;iBAClC;gBAED,IAAI,CAAC,MAAM,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AA7C,iBAUC;QATC,IAAM,UAAU,GAAG,GAAG,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,GAAG,CAAC,UAAU,CAAC;YACrC,IACE,KAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC;gBACnC,KAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,MAAM,EAC3C;gBACA,KAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;aAC/B;QACH,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAC1B,CAAC;IACH,uBAAC;AAAD,CAAC,AAlLD,IAkLC","sourcesContent":["import { Operation, FetchResult, NextLink } from '../core';\nimport { Observable } from '../../utilities';\n\nexport type BatchHandler = (\n operations: Operation[],\n forward?: (NextLink | undefined)[],\n) => Observable<FetchResult[]> | null;\n\nexport interface BatchableRequest {\n operation: Operation;\n forward?: NextLink;\n\n // promise is created when the query fetch request is\n // added to the queue and is resolved once the result is back\n // from the server.\n observable?: Observable<FetchResult>;\n next?: Array<(result: FetchResult) => void>;\n error?: Array<(error: Error) => void>;\n complete?: Array<() => void>;\n}\n\n// QueryBatcher doesn't fire requests immediately. Requests that were enqueued within\n// a certain amount of time (configurable through `batchInterval`) will be batched together\n// into one query.\nexport class OperationBatcher {\n // Queue on which the QueryBatcher will operate on a per-tick basis.\n // Public only for testing\n public queuedRequests: Map<string, BatchableRequest[]>;\n\n private scheduledBatchTimer: ReturnType<typeof setTimeout>;\n private batchDebounce?: boolean;\n private batchInterval?: number;\n private batchMax: number;\n\n //This function is called to the queries in the queue to the server.\n private batchHandler: BatchHandler;\n private batchKey: (operation: Operation) => string;\n\n constructor({\n batchDebounce,\n batchInterval,\n batchMax,\n batchHandler,\n batchKey,\n }: {\n batchDebounce?: boolean;\n batchInterval?: number;\n batchMax?: number;\n batchHandler: BatchHandler;\n batchKey?: (operation: Operation) => string;\n }) {\n this.queuedRequests = new Map();\n this.batchDebounce = batchDebounce;\n this.batchInterval = batchInterval;\n this.batchMax = batchMax || 0;\n this.batchHandler = batchHandler;\n this.batchKey = batchKey || (() => '');\n }\n\n public enqueueRequest(request: BatchableRequest): Observable<FetchResult> {\n const requestCopy = {\n ...request,\n };\n let queued = false;\n\n const key = this.batchKey(request.operation);\n\n if (!requestCopy.observable) {\n requestCopy.observable = new Observable<FetchResult>(observer => {\n if (!this.queuedRequests.has(key)) {\n this.queuedRequests.set(key, []);\n }\n\n if (!queued) {\n this.queuedRequests.get(key)!.push(requestCopy);\n queued = true;\n }\n\n //called for each subscriber, so need to save all listeners(next, error, complete)\n requestCopy.next = requestCopy.next || [];\n if (observer.next) requestCopy.next.push(observer.next.bind(observer));\n\n requestCopy.error = requestCopy.error || [];\n if (observer.error)\n requestCopy.error.push(observer.error.bind(observer));\n\n requestCopy.complete = requestCopy.complete || [];\n if (observer.complete)\n requestCopy.complete.push(observer.complete.bind(observer));\n\n // The first enqueued request triggers the queue consumption after `batchInterval` milliseconds.\n if (this.queuedRequests.get(key)!.length === 1) {\n this.scheduleQueueConsumption(key);\n } else if (this.batchDebounce) {\n clearTimeout(this.scheduledBatchTimer);\n this.scheduleQueueConsumption(key);\n }\n\n // When amount of requests reaches `batchMax`, trigger the queue consumption without waiting on the `batchInterval`.\n if (this.queuedRequests.get(key)!.length === this.batchMax) {\n this.consumeQueue(key);\n }\n });\n }\n\n return requestCopy.observable;\n }\n\n // Consumes the queue.\n // Returns a list of promises (one for each query).\n public consumeQueue(\n key?: string,\n ): (Observable<FetchResult> | undefined)[] | undefined {\n const requestKey = key || '';\n const queuedRequests = this.queuedRequests.get(requestKey);\n\n if (!queuedRequests) {\n return;\n }\n\n this.queuedRequests.delete(requestKey);\n\n const requests: Operation[] = queuedRequests.map(\n queuedRequest => queuedRequest.operation,\n );\n\n const forwards: (NextLink | undefined)[] = queuedRequests.map(\n queuedRequest => queuedRequest.forward,\n );\n\n const observables: (Observable<FetchResult> | undefined)[] = [];\n const nexts: any[] = [];\n const errors: any[] = [];\n const completes: any[] = [];\n queuedRequests.forEach((batchableRequest, index) => {\n observables.push(batchableRequest.observable);\n nexts.push(batchableRequest.next);\n errors.push(batchableRequest.error);\n completes.push(batchableRequest.complete);\n });\n\n const batchedObservable =\n this.batchHandler(requests, forwards) || Observable.of();\n\n const onError = (error: any) => {\n //each callback list in batch\n errors.forEach(rejecters => {\n if (rejecters) {\n //each subscriber to request\n rejecters.forEach((e: any) => e(error));\n }\n });\n };\n\n batchedObservable.subscribe({\n next: results => {\n if (!Array.isArray(results)) {\n results = [results];\n }\n\n if (nexts.length !== results.length) {\n const error = new Error(\n `server returned results with length ${\n results.length\n }, expected length of ${nexts.length}`,\n );\n (error as any).result = results;\n\n return onError(error);\n }\n\n results.forEach((result, index) => {\n if (nexts[index]) {\n nexts[index].forEach((next: any) => next(result));\n }\n });\n },\n error: onError,\n complete: () => {\n completes.forEach(complete => {\n if (complete) {\n //each subscriber to request\n complete.forEach((c: any) => c());\n }\n });\n },\n });\n\n return observables;\n }\n\n private scheduleQueueConsumption(key?: string): void {\n const requestKey = key || '';\n this.scheduledBatchTimer = (setTimeout(() => {\n if (\n this.queuedRequests.get(requestKey) &&\n this.queuedRequests.get(requestKey)!.length\n ) {\n this.consumeQueue(requestKey);\n }\n }, this.batchInterval));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"batching.js","sourceRoot":"","sources":["../../../src/link/batch/batching.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAuB7C;IAcE,0BAAY,EAYX;YAXC,aAAa,mBAAA,EACb,aAAa,mBAAA,EACb,QAAQ,cAAA,EACR,YAAY,kBAAA,EACZ,QAAQ,cAAA;QAQR,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ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AG,OAAO,CAAC;oBAEhC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;iBACvB;gBAED,OAAO,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,KAAK;oBAC5B,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;wBAChB,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAC,IAAS,IAAK,OAAA,IAAI,CAAC,MAAM,CAAC,EAAZ,CAAY,CAAC,CAAC;qBACnD;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;YACD,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE;gBACR,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;oBACxB,IAAI,QAAQ,EAAE;wBAEZ,QAAQ,CAAC,OAAO,CAAC,UAAC,CAAM,IAAK,OAAA,CAAC,EAAE,EAAH,CAAG,CAAC,CAAC;qBACnC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACrB,CAAC;IAEO,mDAAwB,GAAhC,UAAiC,GAAY;QAA7C,iBAUC;QATC,IAAM,UAAU,GAAG,GAAG,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,GAAG,CAAC,UAAU,CAAC;YACrC,IACE,KAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC;gBACnC,KAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,MAAM,EAC3C;gBACA,KAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;aAC/B;QACH,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAC1B,CAAC;IACH,uBAAC;AAAD,CAAC,AAlLD,IAkLC","sourcesContent":["import { Operation, FetchResult, NextLink } from '../core';\nimport { Observable } from '../../utilities';\n\nexport type BatchHandler = (\n operations: Operation[],\n forward?: (NextLink | undefined)[],\n) => Observable<FetchResult[]> | null;\n\nexport interface BatchableRequest {\n operation: Operation;\n forward?: NextLink;\n\n // promise is created when the query fetch request is\n // added to the queue and is resolved once the result is back\n // from the server.\n observable?: Observable<FetchResult>;\n next?: Array<(result: FetchResult) => void>;\n error?: Array<(error: Error) => void>;\n complete?: Array<() => void>;\n}\n\n// QueryBatcher doesn't fire requests immediately. Requests that were enqueued within\n// a certain amount of time (configurable through `batchInterval`) will be batched together\n// into one query.\nexport class OperationBatcher {\n // Queue on which the QueryBatcher will operate on a per-tick basis.\n // Public only for testing\n public queuedRequests: Map<string, BatchableRequest[]>;\n\n private scheduledBatchTimer: ReturnType<typeof setTimeout>;\n private batchDebounce?: boolean;\n private batchInterval?: number;\n private batchMax: number;\n\n //This function is called to the queries in the queue to the server.\n private batchHandler: BatchHandler;\n private batchKey: (operation: Operation) => string;\n\n constructor({\n batchDebounce,\n batchInterval,\n batchMax,\n batchHandler,\n batchKey,\n }: {\n batchDebounce?: boolean;\n batchInterval?: number;\n batchMax?: number;\n batchHandler: BatchHandler;\n batchKey?: (operation: Operation) => string;\n }) {\n this.queuedRequests = new Map();\n this.batchDebounce = batchDebounce;\n this.batchInterval = batchInterval;\n this.batchMax = batchMax || 0;\n this.batchHandler = batchHandler;\n this.batchKey = batchKey || (() => '');\n }\n\n public enqueueRequest(request: BatchableRequest): Observable<FetchResult> {\n const requestCopy = {\n ...request,\n };\n let queued = false;\n\n const key = this.batchKey(request.operation);\n\n if (!requestCopy.observable) {\n requestCopy.observable = new Observable<FetchResult>(observer => {\n if (!this.queuedRequests.has(key)) {\n this.queuedRequests.set(key, []);\n }\n\n if (!queued) {\n this.queuedRequests.get(key)!.push(requestCopy);\n queued = true;\n }\n\n //called for each subscriber, so need to save all listeners(next, error, complete)\n requestCopy.next = requestCopy.next || [];\n if (observer.next) requestCopy.next.push(observer.next.bind(observer));\n\n requestCopy.error = requestCopy.error || [];\n if (observer.error)\n requestCopy.error.push(observer.error.bind(observer));\n\n requestCopy.complete = requestCopy.complete || [];\n if (observer.complete)\n requestCopy.complete.push(observer.complete.bind(observer));\n\n // The first enqueued request triggers the queue consumption after `batchInterval` milliseconds.\n if (this.queuedRequests.get(key)!.length === 1) {\n this.scheduleQueueConsumption(key);\n } else if (this.batchDebounce) {\n clearTimeout(this.scheduledBatchTimer);\n this.scheduleQueueConsumption(key);\n }\n\n // When amount of requests reaches `batchMax`, trigger the queue consumption without waiting on the `batchInterval`.\n if (this.queuedRequests.get(key)!.length === this.batchMax) {\n this.consumeQueue(key);\n }\n });\n }\n\n return requestCopy.observable;\n }\n\n // Consumes the queue.\n // Returns a list of promises (one for each query).\n public consumeQueue(\n key?: string,\n ): (Observable<FetchResult> | undefined)[] | undefined {\n const requestKey = key || '';\n const queuedRequests = this.queuedRequests.get(requestKey);\n\n if (!queuedRequests) {\n return;\n }\n\n this.queuedRequests.delete(requestKey);\n\n const requests: Operation[] = queuedRequests.map(\n queuedRequest => queuedRequest.operation,\n );\n\n const forwards: (NextLink | undefined)[] = queuedRequests.map(\n queuedRequest => queuedRequest.forward,\n );\n\n const observables: (Observable<FetchResult> | undefined)[] = [];\n const nexts: any[] = [];\n const errors: any[] = [];\n const completes: any[] = [];\n queuedRequests.forEach((batchableRequest, index) => {\n observables.push(batchableRequest.observable);\n nexts.push(batchableRequest.next);\n errors.push(batchableRequest.error);\n completes.push(batchableRequest.complete);\n });\n\n const batchedObservable =\n this.batchHandler(requests, forwards) || Observable.of();\n\n const onError = (error: any) => {\n //each callback list in batch\n errors.forEach(rejecters => {\n if (rejecters) {\n //each subscriber to request\n rejecters.forEach((e: any) => e(error));\n }\n });\n };\n\n batchedObservable.subscribe({\n next: results => {\n if (!Array.isArray(results)) {\n results = [results];\n }\n\n if (nexts.length !== results.length) {\n const error = new Error(\n `server returned results with length ${\n results.length\n }, expected length of ${nexts.length}`,\n );\n (error as any).result = results;\n\n return onError(error);\n }\n\n results.forEach((result, index) => {\n if (nexts[index]) {\n nexts[index].forEach((next: any) => next(result));\n }\n });\n },\n error: onError,\n complete: () => {\n completes.forEach(complete => {\n if (complete) {\n //each subscriber to request\n complete.forEach((c: any) => c());\n }\n });\n },\n });\n\n return observables;\n }\n\n private scheduleQueueConsumption(key?: string): void {\n const requestKey = key || '';\n this.scheduledBatchTimer = (setTimeout(() => {\n if (\n this.queuedRequests.get(requestKey) &&\n this.queuedRequests.get(requestKey)!.length\n ) {\n this.consumeQueue(requestKey);\n }\n }, this.batchInterval));\n }\n}\n"]}
|
package/link/batch/package.json
CHANGED
|
@@ -13,7 +13,7 @@ var BatchHttpLink = (function (_super) {
|
|
|
13
13
|
tslib.__extends(BatchHttpLink, _super);
|
|
14
14
|
function BatchHttpLink(fetchParams) {
|
|
15
15
|
var _this = _super.call(this) || this;
|
|
16
|
-
var _a = fetchParams || {}, _b = _a.uri, uri = _b === void 0 ? '/graphql' : _b, fetcher = _a.fetch, includeExtensions = _a.includeExtensions, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, requestOptions = tslib.__rest(_a, ["uri", "fetch", "includeExtensions", "batchInterval", "batchDebounce", "batchMax", "batchKey"]);
|
|
16
|
+
var _a = fetchParams || {}, _b = _a.uri, uri = _b === void 0 ? '/graphql' : _b, fetcher = _a.fetch, _c = _a.print, print = _c === void 0 ? http.defaultPrinter : _c, includeExtensions = _a.includeExtensions, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, requestOptions = tslib.__rest(_a, ["uri", "fetch", "print", "includeExtensions", "batchInterval", "batchDebounce", "batchMax", "batchKey"]);
|
|
17
17
|
http.checkFetcher(fetcher);
|
|
18
18
|
if (!fetcher) {
|
|
19
19
|
fetcher = fetch;
|
|
@@ -47,7 +47,7 @@ var BatchHttpLink = (function (_super) {
|
|
|
47
47
|
headers: tslib.__assign(tslib.__assign({}, clientAwarenessHeaders), context.headers),
|
|
48
48
|
};
|
|
49
49
|
var optsAndBody = operations.map(function (operation) {
|
|
50
|
-
return http.
|
|
50
|
+
return http.selectHttpOptionsAndBodyInternal(operation, print, http.fallbackHttpConfig, linkConfig, contextConfig);
|
|
51
51
|
});
|
|
52
52
|
var loadedBody = optsAndBody.map(function (_a) {
|
|
53
53
|
var body = _a.body;
|
|
@@ -124,4 +124,4 @@ var BatchHttpLink = (function (_super) {
|
|
|
124
124
|
}(core.ApolloLink));
|
|
125
125
|
|
|
126
126
|
exports.BatchHttpLink = BatchHttpLink;
|
|
127
|
-
//# sourceMappingURL=batch-http.cjs.
|
|
127
|
+
//# sourceMappingURL=batch-http.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-http.cjs","sources":["batchHttpLink.js"],"sourcesContent":["import { __assign, __extends, __rest } from \"tslib\";\nimport { ApolloLink } from '../core';\nimport { Observable } from '../../utilities';\nimport { fromError } from '../utils';\nimport { serializeFetchParameter, selectURI, parseAndCheckHttpResponse, checkFetcher, selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig, createSignalIfSupported, } from '../http';\nimport { BatchLink } from '../batch';\nvar BatchHttpLink = (function (_super) {\n __extends(BatchHttpLink, _super);\n function BatchHttpLink(fetchParams) {\n var _this = _super.call(this) || this;\n var _a = fetchParams || {}, _b = _a.uri, uri = _b === void 0 ? '/graphql' : _b, fetcher = _a.fetch, _c = _a.print, print = _c === void 0 ? defaultPrinter : _c, includeExtensions = _a.includeExtensions, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, requestOptions = __rest(_a, [\"uri\", \"fetch\", \"print\", \"includeExtensions\", \"batchInterval\", \"batchDebounce\", \"batchMax\", \"batchKey\"]);\n checkFetcher(fetcher);\n if (!fetcher) {\n fetcher = fetch;\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n _this.batchDebounce = batchDebounce;\n _this.batchInterval = batchInterval || 10;\n _this.batchMax = batchMax || 10;\n var batchHandler = function (operations) {\n var chosenURI = selectURI(operations[0], uri);\n var context = operations[0].getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: __assign(__assign({}, clientAwarenessHeaders), context.headers),\n };\n var optsAndBody = operations.map(function (operation) {\n return selectHttpOptionsAndBodyInternal(operation, print, fallbackHttpConfig, linkConfig, contextConfig);\n });\n var loadedBody = optsAndBody.map(function (_a) {\n var body = _a.body;\n return body;\n });\n var options = optsAndBody[0].options;\n if (options.method === 'GET') {\n return fromError(new Error('apollo-link-batch-http does not support GET requests'));\n }\n try {\n options.body = serializeFetchParameter(loadedBody, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n var controller;\n if (!options.signal) {\n var _b = createSignalIfSupported(), _controller = _b.controller, signal = _b.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n return new Observable(function (observer) {\n fetcher(chosenURI, options)\n .then(function (response) {\n operations.forEach(function (operation) { return operation.setContext({ response: response }); });\n return response;\n })\n .then(parseAndCheckHttpResponse(operations))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n };\n batchKey =\n batchKey ||\n (function (operation) {\n var context = operation.getContext();\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n return selectURI(operation, uri) + JSON.stringify(contextConfig);\n });\n _this.batcher = new BatchLink({\n batchDebounce: _this.batchDebounce,\n batchInterval: _this.batchInterval,\n batchMax: _this.batchMax,\n batchKey: batchKey,\n batchHandler: batchHandler,\n });\n return _this;\n }\n BatchHttpLink.prototype.request = function (operation) {\n return this.batcher.request(operation);\n };\n return BatchHttpLink;\n}(ApolloLink));\nexport { BatchHttpLink };\n//# sourceMappingURL=batchHttpLink.js.map"],"names":["__extends","defaultPrinter","__rest","checkFetcher","selectURI","__assign","selectHttpOptionsAndBodyInternal","fallbackHttpConfig","fromError","serializeFetchParameter","createSignalIfSupported","Observable","parseAndCheckHttpResponse","BatchLink","ApolloLink"],"mappings":";;;;;;;;;;;AAMG,IAAC,aAAa,IAAI,UAAU,MAAM,EAAE;AACvC,IAAIA,eAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACrC,IAAI,SAAS,aAAa,CAAC,WAAW,EAAE;AACxC,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,IAAI,EAAE,GAAG,WAAW,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,KAAK,CAAC,GAAGC,mBAAc,GAAG,EAAE,EAAE,iBAAiB,GAAG,EAAE,CAAC,iBAAiB,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,cAAc,GAAGC,YAAM,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAC5c,QAAQC,iBAAY,CAAC,OAAO,CAAC,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