@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 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.cjs","sources":["RenderPromises.js","getDataFromTree.js","renderToStringWithData.js"],"sourcesContent":["function makeDefaultQueryInfo() {\n return {\n seen: false,\n observable: null\n };\n}\nvar RenderPromises = (function () {\n function RenderPromises() {\n this.queryPromises = new Map();\n this.queryInfoTrie = new Map();\n this.stopped = false;\n }\n RenderPromises.prototype.stop = function () {\n if (!this.stopped) {\n this.queryPromises.clear();\n this.queryInfoTrie.clear();\n this.stopped = true;\n }\n };\n RenderPromises.prototype.registerSSRObservable = function (observable) {\n if (this.stopped)\n return;\n this.lookupQueryInfo(observable.options).observable = observable;\n };\n RenderPromises.prototype.getSSRObservable = function (props) {\n return this.lookupQueryInfo(props).observable;\n };\n RenderPromises.prototype.addQueryPromise = function (queryInstance, finish) {\n if (!this.stopped) {\n var info = this.lookupQueryInfo(queryInstance.getOptions());\n if (!info.seen) {\n this.queryPromises.set(queryInstance.getOptions(), new Promise(function (resolve) {\n resolve(queryInstance.fetchData());\n }));\n return null;\n }\n }\n return finish ? finish() : null;\n };\n RenderPromises.prototype.addObservableQueryPromise = function (obsQuery) {\n return this.addQueryPromise({\n getOptions: function () { return obsQuery.options; },\n fetchData: function () { return new Promise(function (resolve) {\n var sub = obsQuery.subscribe({\n next: function (result) {\n if (!result.loading) {\n resolve();\n sub.unsubscribe();\n }\n },\n error: function () {\n resolve();\n sub.unsubscribe();\n },\n complete: function () {\n resolve();\n },\n });\n }); },\n });\n };\n RenderPromises.prototype.hasPromises = function () {\n return this.queryPromises.size > 0;\n };\n RenderPromises.prototype.consumeAndAwaitPromises = function () {\n var _this = this;\n var promises = [];\n this.queryPromises.forEach(function (promise, queryInstance) {\n _this.lookupQueryInfo(queryInstance).seen = true;\n promises.push(promise);\n });\n this.queryPromises.clear();\n return Promise.all(promises);\n };\n RenderPromises.prototype.lookupQueryInfo = function (props) {\n var queryInfoTrie = this.queryInfoTrie;\n var query = props.query, variables = props.variables;\n var varMap = queryInfoTrie.get(query) || new Map();\n if (!queryInfoTrie.has(query))\n queryInfoTrie.set(query, varMap);\n var variablesString = JSON.stringify(variables);\n var info = varMap.get(variablesString) || makeDefaultQueryInfo();\n if (!varMap.has(variablesString))\n varMap.set(variablesString, info);\n return info;\n };\n return RenderPromises;\n}());\nexport { RenderPromises };\n//# sourceMappingURL=RenderPromises.js.map","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { getApolloContext } from '../context';\nimport { RenderPromises } from './RenderPromises';\nimport { renderToStaticMarkup } from 'react-dom/server';\nexport function getDataFromTree(tree, context) {\n if (context === void 0) { context = {}; }\n return getMarkupFromTree({\n tree: tree,\n context: context,\n renderFunction: renderToStaticMarkup\n });\n}\nexport function getMarkupFromTree(_a) {\n var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? renderToStaticMarkup : _c;\n var renderPromises = new RenderPromises();\n function process() {\n var ApolloContext = getApolloContext();\n return new Promise(function (resolve) {\n var element = React.createElement(ApolloContext.Provider, { value: __assign(__assign({}, context), { renderPromises: renderPromises }) }, tree);\n resolve(renderFunction(element));\n }).then(function (html) {\n return renderPromises.hasPromises()\n ? renderPromises.consumeAndAwaitPromises().then(process)\n : html;\n }).finally(function () {\n renderPromises.stop();\n });\n }\n return Promise.resolve().then(process);\n}\n//# sourceMappingURL=getDataFromTree.js.map","import { getMarkupFromTree } from './getDataFromTree';\nimport { renderToString } from 'react-dom/server';\nexport function renderToStringWithData(component) {\n return getMarkupFromTree({\n tree: component,\n renderFunction: renderToString\n });\n}\n//# sourceMappingURL=renderToStringWithData.js.map"],"names":["renderToStaticMarkup","context","getApolloContext","React","__assign","renderToString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,oBAAoB,GAAG;AAChC,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,KAAK;AACnB,QAAQ,UAAU,EAAE,IAAI;AACxB,KAAK,CAAC;AACN,CAAC;AACE,IAAC,cAAc,IAAI,YAAY;AAClC,IAAI,SAAS,cAAc,GAAG;AAC9B,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AACvC,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AACvC,QAAQ,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;AAC7B,KAAK;AACL,IAAI,cAAc,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY;AAChD,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AAC3B,YAAY,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACvC,YAAY,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACvC,YAAY,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;AAChC,SAAS;AACT,KAAK,CAAC;AACN,IAAI,cAAc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,EAAEI,qBAAc;AACtC,KAAK,CAAC,CAAC;AACP;;;;;;;"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var context = require('../context');
|
|
8
|
+
var server = require('react-dom/server');
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
for (var k in e) {
|
|
15
|
+
n[k] = e[k];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n["default"] = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
23
|
+
|
|
24
|
+
function makeDefaultQueryInfo() {
|
|
25
|
+
return {
|
|
26
|
+
seen: false,
|
|
27
|
+
observable: null
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
var RenderPromises = (function () {
|
|
31
|
+
function RenderPromises() {
|
|
32
|
+
this.queryPromises = new Map();
|
|
33
|
+
this.queryInfoTrie = new Map();
|
|
34
|
+
this.stopped = false;
|
|
35
|
+
}
|
|
36
|
+
RenderPromises.prototype.stop = function () {
|
|
37
|
+
if (!this.stopped) {
|
|
38
|
+
this.queryPromises.clear();
|
|
39
|
+
this.queryInfoTrie.clear();
|
|
40
|
+
this.stopped = true;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
RenderPromises.prototype.registerSSRObservable = function (observable) {
|
|
44
|
+
if (this.stopped)
|
|
45
|
+
return;
|
|
46
|
+
this.lookupQueryInfo(observable.options).observable = observable;
|
|
47
|
+
};
|
|
48
|
+
RenderPromises.prototype.getSSRObservable = function (props) {
|
|
49
|
+
return this.lookupQueryInfo(props).observable;
|
|
50
|
+
};
|
|
51
|
+
RenderPromises.prototype.addQueryPromise = function (queryInstance, finish) {
|
|
52
|
+
if (!this.stopped) {
|
|
53
|
+
var info = this.lookupQueryInfo(queryInstance.getOptions());
|
|
54
|
+
if (!info.seen) {
|
|
55
|
+
this.queryPromises.set(queryInstance.getOptions(), new Promise(function (resolve) {
|
|
56
|
+
resolve(queryInstance.fetchData());
|
|
57
|
+
}));
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return finish ? finish() : null;
|
|
62
|
+
};
|
|
63
|
+
RenderPromises.prototype.addObservableQueryPromise = function (obsQuery) {
|
|
64
|
+
return this.addQueryPromise({
|
|
65
|
+
getOptions: function () { return obsQuery.options; },
|
|
66
|
+
fetchData: function () { return new Promise(function (resolve) {
|
|
67
|
+
var sub = obsQuery.subscribe({
|
|
68
|
+
next: function (result) {
|
|
69
|
+
if (!result.loading) {
|
|
70
|
+
resolve();
|
|
71
|
+
sub.unsubscribe();
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
error: function () {
|
|
75
|
+
resolve();
|
|
76
|
+
sub.unsubscribe();
|
|
77
|
+
},
|
|
78
|
+
complete: function () {
|
|
79
|
+
resolve();
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}); },
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
RenderPromises.prototype.hasPromises = function () {
|
|
86
|
+
return this.queryPromises.size > 0;
|
|
87
|
+
};
|
|
88
|
+
RenderPromises.prototype.consumeAndAwaitPromises = function () {
|
|
89
|
+
var _this = this;
|
|
90
|
+
var promises = [];
|
|
91
|
+
this.queryPromises.forEach(function (promise, queryInstance) {
|
|
92
|
+
_this.lookupQueryInfo(queryInstance).seen = true;
|
|
93
|
+
promises.push(promise);
|
|
94
|
+
});
|
|
95
|
+
this.queryPromises.clear();
|
|
96
|
+
return Promise.all(promises);
|
|
97
|
+
};
|
|
98
|
+
RenderPromises.prototype.lookupQueryInfo = function (props) {
|
|
99
|
+
var queryInfoTrie = this.queryInfoTrie;
|
|
100
|
+
var query = props.query, variables = props.variables;
|
|
101
|
+
var varMap = queryInfoTrie.get(query) || new Map();
|
|
102
|
+
if (!queryInfoTrie.has(query))
|
|
103
|
+
queryInfoTrie.set(query, varMap);
|
|
104
|
+
var variablesString = JSON.stringify(variables);
|
|
105
|
+
var info = varMap.get(variablesString) || makeDefaultQueryInfo();
|
|
106
|
+
if (!varMap.has(variablesString))
|
|
107
|
+
varMap.set(variablesString, info);
|
|
108
|
+
return info;
|
|
109
|
+
};
|
|
110
|
+
return RenderPromises;
|
|
111
|
+
}());
|
|
112
|
+
|
|
113
|
+
function getDataFromTree(tree, context) {
|
|
114
|
+
if (context === void 0) { context = {}; }
|
|
115
|
+
return getMarkupFromTree({
|
|
116
|
+
tree: tree,
|
|
117
|
+
context: context,
|
|
118
|
+
renderFunction: server.renderToStaticMarkup
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function getMarkupFromTree(_a) {
|
|
122
|
+
var tree = _a.tree, _b = _a.context, context$1 = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? server.renderToStaticMarkup : _c;
|
|
123
|
+
var renderPromises = new RenderPromises();
|
|
124
|
+
function process() {
|
|
125
|
+
var ApolloContext = context.getApolloContext();
|
|
126
|
+
return new Promise(function (resolve) {
|
|
127
|
+
var element = React__namespace.createElement(ApolloContext.Provider, { value: tslib.__assign(tslib.__assign({}, context$1), { renderPromises: renderPromises }) }, tree);
|
|
128
|
+
resolve(renderFunction(element));
|
|
129
|
+
}).then(function (html) {
|
|
130
|
+
return renderPromises.hasPromises()
|
|
131
|
+
? renderPromises.consumeAndAwaitPromises().then(process)
|
|
132
|
+
: html;
|
|
133
|
+
}).finally(function () {
|
|
134
|
+
renderPromises.stop();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return Promise.resolve().then(process);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function renderToStringWithData(component) {
|
|
141
|
+
return getMarkupFromTree({
|
|
142
|
+
tree: component,
|
|
143
|
+
renderFunction: server.renderToString
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
exports.RenderPromises = RenderPromises;
|
|
148
|
+
exports.getDataFromTree = getDataFromTree;
|
|
149
|
+
exports.getMarkupFromTree = getMarkupFromTree;
|
|
150
|
+
exports.renderToStringWithData = renderToStringWithData;
|
|
151
|
+
//# sourceMappingURL=ssr.cjs.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DocumentNode } from 'graphql';
|
|
3
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
4
|
+
import { Observable, ObservableSubscription } from '../../utilities';
|
|
5
|
+
import { FetchResult } from '../../link/core';
|
|
6
|
+
import { ApolloError } from '../../errors';
|
|
7
|
+
import { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, MutationOptions, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy } from '../../core';
|
|
8
|
+
import { NextFetchPolicyContext } from '../../core/watchQueryOptions';
|
|
9
|
+
export type { DefaultContext as Context } from "../../core";
|
|
10
|
+
export type CommonOptions<TOptions> = TOptions & {
|
|
11
|
+
client?: ApolloClient<object>;
|
|
12
|
+
};
|
|
13
|
+
export interface BaseQueryOptions<TVariables extends OperationVariables = OperationVariables> extends Omit<WatchQueryOptions<TVariables>, "query"> {
|
|
14
|
+
ssr?: boolean;
|
|
15
|
+
client?: ApolloClient<any>;
|
|
16
|
+
context?: DefaultContext;
|
|
17
|
+
}
|
|
18
|
+
export interface QueryFunctionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseQueryOptions<TVariables> {
|
|
19
|
+
skip?: boolean;
|
|
20
|
+
onCompleted?: (data: TData) => void;
|
|
21
|
+
onError?: (error: ApolloError) => void;
|
|
22
|
+
defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;
|
|
23
|
+
}
|
|
24
|
+
export type ObservableQueryFields<TData, TVariables extends OperationVariables> = Pick<ObservableQuery<TData, TVariables>, 'startPolling' | 'stopPolling' | 'subscribeToMore' | 'updateQuery' | 'refetch' | 'reobserve' | 'variables' | 'fetchMore'>;
|
|
25
|
+
export interface QueryResult<TData = any, TVariables extends OperationVariables = OperationVariables> extends ObservableQueryFields<TData, TVariables> {
|
|
26
|
+
client: ApolloClient<any>;
|
|
27
|
+
observable: ObservableQuery<TData, TVariables>;
|
|
28
|
+
data: TData | undefined;
|
|
29
|
+
previousData?: TData;
|
|
30
|
+
error?: ApolloError;
|
|
31
|
+
loading: boolean;
|
|
32
|
+
networkStatus: NetworkStatus;
|
|
33
|
+
called: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface QueryDataOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends QueryFunctionOptions<TData, TVariables> {
|
|
36
|
+
children?: (result: QueryResult<TData, TVariables>) => ReactNode;
|
|
37
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
38
|
+
}
|
|
39
|
+
export interface QueryHookOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends QueryFunctionOptions<TData, TVariables> {
|
|
40
|
+
query?: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
41
|
+
}
|
|
42
|
+
export interface LazyQueryHookOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends Omit<QueryHookOptions<TData, TVariables>, 'skip'> {
|
|
43
|
+
}
|
|
44
|
+
export type SuspensePolicy = 'always' | 'initial';
|
|
45
|
+
export type SuspenseQueryHookFetchPolicy = Extract<WatchQueryFetchPolicy, 'cache-first' | 'network-only' | 'no-cache' | 'cache-and-network'>;
|
|
46
|
+
export interface SuspenseQueryHookOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends Pick<QueryHookOptions<TData, TVariables>, 'client' | 'variables' | 'errorPolicy' | 'context' | 'canonizeResults' | 'returnPartialData' | 'refetchWritePolicy'> {
|
|
47
|
+
fetchPolicy?: SuspenseQueryHookFetchPolicy;
|
|
48
|
+
nextFetchPolicy?: SuspenseQueryHookFetchPolicy | ((currentFetchPolicy: SuspenseQueryHookFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => SuspenseQueryHookFetchPolicy);
|
|
49
|
+
suspensePolicy?: SuspensePolicy;
|
|
50
|
+
}
|
|
51
|
+
export interface QueryLazyOptions<TVariables> {
|
|
52
|
+
variables?: TVariables;
|
|
53
|
+
context?: DefaultContext;
|
|
54
|
+
}
|
|
55
|
+
export type LazyQueryResult<TData, TVariables extends OperationVariables> = QueryResult<TData, TVariables>;
|
|
56
|
+
export type QueryTuple<TData, TVariables extends OperationVariables> = LazyQueryResultTuple<TData, TVariables>;
|
|
57
|
+
export type LazyQueryExecFunction<TData, TVariables extends OperationVariables> = (options?: Partial<LazyQueryHookOptions<TData, TVariables>>) => Promise<QueryResult<TData, TVariables>>;
|
|
58
|
+
export type LazyQueryResultTuple<TData, TVariables extends OperationVariables> = [
|
|
59
|
+
LazyQueryExecFunction<TData, TVariables>,
|
|
60
|
+
QueryResult<TData, TVariables>
|
|
61
|
+
];
|
|
62
|
+
export type RefetchQueriesFunction = (...args: any[]) => InternalRefetchQueriesInclude;
|
|
63
|
+
export interface BaseMutationOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends Omit<MutationOptions<TData, TVariables, TContext, TCache>, "mutation"> {
|
|
64
|
+
client?: ApolloClient<object>;
|
|
65
|
+
notifyOnNetworkStatusChange?: boolean;
|
|
66
|
+
onCompleted?: (data: TData, clientOptions?: BaseMutationOptions) => void;
|
|
67
|
+
onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;
|
|
68
|
+
ignoreResults?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface MutationFunctionOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
|
|
71
|
+
mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
72
|
+
}
|
|
73
|
+
export interface MutationResult<TData = any> {
|
|
74
|
+
data?: TData | null;
|
|
75
|
+
error?: ApolloError;
|
|
76
|
+
loading: boolean;
|
|
77
|
+
called: boolean;
|
|
78
|
+
client: ApolloClient<object>;
|
|
79
|
+
reset(): void;
|
|
80
|
+
}
|
|
81
|
+
export declare type MutationFunction<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> = (options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>) => Promise<FetchResult<TData>>;
|
|
82
|
+
export interface MutationHookOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
|
|
83
|
+
mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
84
|
+
}
|
|
85
|
+
export interface MutationDataOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
|
|
86
|
+
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
87
|
+
}
|
|
88
|
+
export type MutationTuple<TData, TVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> = [
|
|
89
|
+
(options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>) => Promise<FetchResult<TData>>,
|
|
90
|
+
MutationResult<TData>
|
|
91
|
+
];
|
|
92
|
+
export interface OnDataOptions<TData = any> {
|
|
93
|
+
client: ApolloClient<object>;
|
|
94
|
+
data: SubscriptionResult<TData>;
|
|
95
|
+
}
|
|
96
|
+
export interface OnSubscriptionDataOptions<TData = any> {
|
|
97
|
+
client: ApolloClient<object>;
|
|
98
|
+
subscriptionData: SubscriptionResult<TData>;
|
|
99
|
+
}
|
|
100
|
+
export interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> {
|
|
101
|
+
variables?: TVariables;
|
|
102
|
+
fetchPolicy?: FetchPolicy;
|
|
103
|
+
shouldResubscribe?: boolean | ((options: BaseSubscriptionOptions<TData, TVariables>) => boolean);
|
|
104
|
+
client?: ApolloClient<object>;
|
|
105
|
+
skip?: boolean;
|
|
106
|
+
context?: DefaultContext;
|
|
107
|
+
onComplete?: () => void;
|
|
108
|
+
onData?: (options: OnDataOptions<TData>) => any;
|
|
109
|
+
onSubscriptionData?: (options: OnSubscriptionDataOptions<TData>) => any;
|
|
110
|
+
onError?: (error: ApolloError) => void;
|
|
111
|
+
onSubscriptionComplete?: () => void;
|
|
112
|
+
}
|
|
113
|
+
export interface SubscriptionResult<TData = any, TVariables = any> {
|
|
114
|
+
loading: boolean;
|
|
115
|
+
data?: TData;
|
|
116
|
+
error?: ApolloError;
|
|
117
|
+
variables?: TVariables;
|
|
118
|
+
}
|
|
119
|
+
export interface SubscriptionHookOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseSubscriptionOptions<TData, TVariables> {
|
|
120
|
+
subscription?: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
121
|
+
}
|
|
122
|
+
export interface SubscriptionDataOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseSubscriptionOptions<TData, TVariables> {
|
|
123
|
+
subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
124
|
+
children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);
|
|
125
|
+
}
|
|
126
|
+
export interface SubscriptionCurrentObservable {
|
|
127
|
+
query?: Observable<any>;
|
|
128
|
+
subscription?: ObservableSubscription;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;CAC/E;AAED,MAAM,WAAW,6BAA6B;IAC5C,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IACxB,YAAY,CAAC,EAAE,sBAAsB,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { Observable, ObservableSubscription } from '../../utilities';\nimport { FetchResult } from '../../link/core';\nimport { ApolloError } from '../../errors';\nimport {\n ApolloCache,\n ApolloClient,\n DefaultContext,\n FetchPolicy,\n MutationOptions,\n NetworkStatus,\n ObservableQuery,\n OperationVariables,\n InternalRefetchQueriesInclude,\n WatchQueryOptions,\n WatchQueryFetchPolicy,\n} from '../../core';\nimport { NextFetchPolicyContext } from '../../core/watchQueryOptions';\n\n/* Common types */\n\nexport type { DefaultContext as Context } from \"../../core\";\n\nexport type CommonOptions<TOptions> = TOptions & {\n client?: ApolloClient<object>;\n};\n\n/* Query types */\n\nexport interface BaseQueryOptions<TVariables extends OperationVariables = OperationVariables>\nextends Omit<WatchQueryOptions<TVariables>, \"query\"> {\n ssr?: boolean;\n client?: ApolloClient<any>;\n context?: DefaultContext;\n}\n\nexport interface QueryFunctionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends BaseQueryOptions<TVariables> {\n skip?: boolean;\n onCompleted?: (data: TData) => void;\n onError?: (error: ApolloError) => void;\n\n // Default WatchQueryOptions for this useQuery, providing initial values for\n // unspecified options, superseding client.defaultOptions.watchQuery (option\n // by option, not whole), but never overriding options previously passed to\n // useQuery (or options added/modified later by other means).\n // TODO What about about default values that are expensive to evaluate?\n defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;\n}\n\nexport type ObservableQueryFields<TData, TVariables extends OperationVariables> = Pick<\n ObservableQuery<TData, TVariables>,\n | 'startPolling'\n | 'stopPolling'\n | 'subscribeToMore'\n | 'updateQuery'\n | 'refetch'\n | 'reobserve'\n | 'variables'\n | 'fetchMore'\n>;\n\nexport interface QueryResult<TData = any, TVariables extends OperationVariables = OperationVariables>\n extends ObservableQueryFields<TData, TVariables> {\n client: ApolloClient<any>;\n observable: ObservableQuery<TData, TVariables>;\n data: TData | undefined;\n previousData?: TData;\n error?: ApolloError;\n loading: boolean;\n networkStatus: NetworkStatus;\n called: boolean;\n}\n\nexport interface QueryDataOptions<TData = any, TVariables extends OperationVariables = OperationVariables>\n extends QueryFunctionOptions<TData, TVariables> {\n children?: (result: QueryResult<TData, TVariables>) => ReactNode;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface QueryHookOptions<TData = any, TVariables extends OperationVariables = OperationVariables>\n extends QueryFunctionOptions<TData, TVariables> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface LazyQueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends Omit<QueryHookOptions<TData, TVariables>, 'skip'> {}\n\n/**\n * suspensePolicy determines how suspense behaves for a refetch. The options are:\n * - always (default): Re-suspend a component when a refetch occurs\n * - initial: Only suspend on the first fetch\n */\nexport type SuspensePolicy =\n | 'always'\n | 'initial'\n\nexport type SuspenseQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n | 'cache-first'\n | 'network-only'\n | 'no-cache'\n | 'cache-and-network'\n>;\n\nexport interface SuspenseQueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends Pick<\n QueryHookOptions<TData, TVariables>,\n | 'client'\n | 'variables'\n | 'errorPolicy'\n | 'context'\n | 'canonizeResults'\n | 'returnPartialData'\n | 'refetchWritePolicy'\n> {\n fetchPolicy?: SuspenseQueryHookFetchPolicy;\n nextFetchPolicy?:\n | SuspenseQueryHookFetchPolicy\n | ((\n currentFetchPolicy: SuspenseQueryHookFetchPolicy,\n context: NextFetchPolicyContext<TData, TVariables>\n ) => SuspenseQueryHookFetchPolicy);\n suspensePolicy?: SuspensePolicy;\n}\n\n/**\n * @deprecated TODO Delete this unused interface.\n */\nexport interface QueryLazyOptions<TVariables> {\n variables?: TVariables;\n context?: DefaultContext;\n}\n\n/**\n * @deprecated TODO Delete this unused type alias.\n */\nexport type LazyQueryResult<TData, TVariables extends OperationVariables> = QueryResult<TData, TVariables>;\n\n/**\n * @deprecated TODO Delete this unused type alias.\n */\nexport type QueryTuple<TData, TVariables extends OperationVariables> =\n LazyQueryResultTuple<TData, TVariables>;\n\nexport type LazyQueryExecFunction<TData, TVariables extends OperationVariables> = (\n options?: Partial<LazyQueryHookOptions<TData, TVariables>>,\n) => Promise<QueryResult<TData, TVariables>>;\n\nexport type LazyQueryResultTuple<TData, TVariables extends OperationVariables> = [\n LazyQueryExecFunction<TData, TVariables>,\n QueryResult<TData, TVariables>,\n];\n\n/* Mutation types */\n\nexport type RefetchQueriesFunction = (\n ...args: any[]\n) => InternalRefetchQueriesInclude;\n\nexport interface BaseMutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>\n> extends Omit<\n MutationOptions<TData, TVariables, TContext, TCache>,\n | \"mutation\"\n> {\n client?: ApolloClient<object>;\n notifyOnNetworkStatusChange?: boolean;\n onCompleted?: (data: TData, clientOptions?: BaseMutationOptions) => void;\n onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;\n ignoreResults?: boolean;\n}\n\nexport interface MutationFunctionOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationResult<TData = any> {\n data?: TData | null;\n error?: ApolloError;\n loading: boolean;\n called: boolean;\n client: ApolloClient<object>;\n reset(): void;\n}\n\nexport declare type MutationFunction<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n) => Promise<FetchResult<TData>>;\n\nexport interface MutationHookOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationDataOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type MutationTuple<\n TData,\n TVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = [\n (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n // TODO This FetchResult<TData> seems strange here, as opposed to an\n // ApolloQueryResult<TData>\n ) => Promise<FetchResult<TData>>,\n MutationResult<TData>,\n];\n\n/* Subscription types */\n\nexport interface OnDataOptions<TData = any> {\n client: ApolloClient<object>;\n data: SubscriptionResult<TData>;\n}\n\nexport interface OnSubscriptionDataOptions<TData = any> {\n client: ApolloClient<object>;\n subscriptionData: SubscriptionResult<TData>;\n}\n\nexport interface BaseSubscriptionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> {\n variables?: TVariables;\n fetchPolicy?: FetchPolicy;\n shouldResubscribe?:\n | boolean\n | ((options: BaseSubscriptionOptions<TData, TVariables>) => boolean);\n client?: ApolloClient<object>;\n skip?: boolean;\n context?: DefaultContext;\n onComplete?: () => void;\n onData?: (options: OnDataOptions<TData>) => any;\n /**\n * @deprecated Use onData instead\n */\n onSubscriptionData?: (options: OnSubscriptionDataOptions<TData>) => any;\n onError?: (error: ApolloError) => void;\n /**\n * @deprecated Use onComplete instead\n */\n onSubscriptionComplete?: () => void;\n}\n\nexport interface SubscriptionResult<TData = any, TVariables = any> {\n loading: boolean;\n data?: TData;\n error?: ApolloError;\n // This was added by the legacy useSubscription type, and is tested in unit\n // tests, but probably shouldn’t be added to the result.\n variables?: TVariables;\n}\n\nexport interface SubscriptionHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface SubscriptionDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);\n}\n\nexport interface SubscriptionCurrentObservable {\n query?: Observable<any>;\n subscription?: ObservableSubscription;\n}\n"]}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var globals = require('../../utilities/globals');
|
|
7
|
+
var graphql = require('graphql');
|
|
8
|
+
var equality = require('@wry/equality');
|
|
9
|
+
var core = require('../../link/core');
|
|
10
|
+
var utilities = require('../../utilities');
|
|
11
|
+
var core$1 = require('../../core');
|
|
12
|
+
var cache = require('../../cache');
|
|
13
|
+
|
|
14
|
+
function requestToKey(request, addTypename) {
|
|
15
|
+
var queryString = request.query &&
|
|
16
|
+
graphql.print(addTypename ? utilities.addTypenameToDocument(request.query) : request.query);
|
|
17
|
+
var requestKey = { query: queryString };
|
|
18
|
+
return JSON.stringify(requestKey);
|
|
19
|
+
}
|
|
20
|
+
var MockLink = (function (_super) {
|
|
21
|
+
tslib.__extends(MockLink, _super);
|
|
22
|
+
function MockLink(mockedResponses, addTypename, options) {
|
|
23
|
+
if (addTypename === void 0) { addTypename = true; }
|
|
24
|
+
if (options === void 0) { options = Object.create(null); }
|
|
25
|
+
var _this = this;
|
|
26
|
+
var _a;
|
|
27
|
+
_this = _super.call(this) || this;
|
|
28
|
+
_this.addTypename = true;
|
|
29
|
+
_this.showWarnings = true;
|
|
30
|
+
_this.mockedResponsesByKey = {};
|
|
31
|
+
_this.addTypename = addTypename;
|
|
32
|
+
_this.showWarnings = (_a = options.showWarnings) !== null && _a !== void 0 ? _a : true;
|
|
33
|
+
if (mockedResponses) {
|
|
34
|
+
mockedResponses.forEach(function (mockedResponse) {
|
|
35
|
+
_this.addMockedResponse(mockedResponse);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
MockLink.prototype.addMockedResponse = function (mockedResponse) {
|
|
41
|
+
var normalizedMockedResponse = this.normalizeMockedResponse(mockedResponse);
|
|
42
|
+
var key = requestToKey(normalizedMockedResponse.request, this.addTypename);
|
|
43
|
+
var mockedResponses = this.mockedResponsesByKey[key];
|
|
44
|
+
if (!mockedResponses) {
|
|
45
|
+
mockedResponses = [];
|
|
46
|
+
this.mockedResponsesByKey[key] = mockedResponses;
|
|
47
|
+
}
|
|
48
|
+
mockedResponses.push(normalizedMockedResponse);
|
|
49
|
+
};
|
|
50
|
+
MockLink.prototype.request = function (operation) {
|
|
51
|
+
var _this = this;
|
|
52
|
+
this.operation = operation;
|
|
53
|
+
var key = requestToKey(operation, this.addTypename);
|
|
54
|
+
var unmatchedVars = [];
|
|
55
|
+
var requestVariables = operation.variables || {};
|
|
56
|
+
var mockedResponses = this.mockedResponsesByKey[key];
|
|
57
|
+
var responseIndex = mockedResponses ? mockedResponses.findIndex(function (res, index) {
|
|
58
|
+
var mockedResponseVars = res.request.variables || {};
|
|
59
|
+
if (equality.equal(requestVariables, mockedResponseVars)) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
unmatchedVars.push(mockedResponseVars);
|
|
63
|
+
return false;
|
|
64
|
+
}) : -1;
|
|
65
|
+
var response = responseIndex >= 0
|
|
66
|
+
? mockedResponses[responseIndex]
|
|
67
|
+
: void 0;
|
|
68
|
+
var configError;
|
|
69
|
+
if (!response) {
|
|
70
|
+
configError = new Error("No more mocked responses for the query: ".concat(graphql.print(operation.query), "\nExpected variables: ").concat(utilities.stringifyForDisplay(operation.variables), "\n").concat(unmatchedVars.length > 0 ? "\nFailed to match ".concat(unmatchedVars.length, " mock").concat(unmatchedVars.length === 1 ? "" : "s", " for this query. The mocked response had the following variables:\n").concat(unmatchedVars.map(function (d) { return " ".concat(utilities.stringifyForDisplay(d)); }).join('\n'), "\n") : ""));
|
|
71
|
+
if (this.showWarnings) {
|
|
72
|
+
console.warn(configError.message +
|
|
73
|
+
'\nThis typically indicates a configuration error in your mocks ' +
|
|
74
|
+
'setup, usually due to a typo or mismatched variable.');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
mockedResponses.splice(responseIndex, 1);
|
|
79
|
+
var newData = response.newData;
|
|
80
|
+
if (newData) {
|
|
81
|
+
response.result = newData();
|
|
82
|
+
mockedResponses.push(response);
|
|
83
|
+
}
|
|
84
|
+
if (!response.result && !response.error) {
|
|
85
|
+
configError = new Error("Mocked response should contain either result or error: ".concat(key));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return new utilities.Observable(function (observer) {
|
|
89
|
+
var timer = setTimeout(function () {
|
|
90
|
+
if (configError) {
|
|
91
|
+
try {
|
|
92
|
+
if (_this.onError(configError, observer) !== false) {
|
|
93
|
+
throw configError;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
observer.error(error);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else if (response) {
|
|
101
|
+
if (response.error) {
|
|
102
|
+
observer.error(response.error);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
if (response.result) {
|
|
106
|
+
observer.next(typeof response.result === 'function'
|
|
107
|
+
? response.result()
|
|
108
|
+
: response.result);
|
|
109
|
+
}
|
|
110
|
+
observer.complete();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}, response && response.delay || 0);
|
|
114
|
+
return function () {
|
|
115
|
+
clearTimeout(timer);
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
MockLink.prototype.normalizeMockedResponse = function (mockedResponse) {
|
|
120
|
+
var newMockedResponse = utilities.cloneDeep(mockedResponse);
|
|
121
|
+
var queryWithoutConnection = utilities.removeConnectionDirectiveFromDocument(newMockedResponse.request.query);
|
|
122
|
+
globals.__DEV__ ? globals.invariant(queryWithoutConnection, "query is required") : globals.invariant(queryWithoutConnection, 40);
|
|
123
|
+
newMockedResponse.request.query = queryWithoutConnection;
|
|
124
|
+
var query = utilities.removeClientSetsFromDocument(newMockedResponse.request.query);
|
|
125
|
+
if (query) {
|
|
126
|
+
newMockedResponse.request.query = query;
|
|
127
|
+
}
|
|
128
|
+
return newMockedResponse;
|
|
129
|
+
};
|
|
130
|
+
return MockLink;
|
|
131
|
+
}(core.ApolloLink));
|
|
132
|
+
function mockSingleLink() {
|
|
133
|
+
var mockedResponses = [];
|
|
134
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
135
|
+
mockedResponses[_i] = arguments[_i];
|
|
136
|
+
}
|
|
137
|
+
var maybeTypename = mockedResponses[mockedResponses.length - 1];
|
|
138
|
+
var mocks = mockedResponses.slice(0, mockedResponses.length - 1);
|
|
139
|
+
if (typeof maybeTypename !== 'boolean') {
|
|
140
|
+
mocks = mockedResponses;
|
|
141
|
+
maybeTypename = true;
|
|
142
|
+
}
|
|
143
|
+
return new MockLink(mocks, maybeTypename);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var MockSubscriptionLink = (function (_super) {
|
|
147
|
+
tslib.__extends(MockSubscriptionLink, _super);
|
|
148
|
+
function MockSubscriptionLink() {
|
|
149
|
+
var _this = _super.call(this) || this;
|
|
150
|
+
_this.unsubscribers = [];
|
|
151
|
+
_this.setups = [];
|
|
152
|
+
_this.observers = [];
|
|
153
|
+
return _this;
|
|
154
|
+
}
|
|
155
|
+
MockSubscriptionLink.prototype.request = function (operation) {
|
|
156
|
+
var _this = this;
|
|
157
|
+
this.operation = operation;
|
|
158
|
+
return new utilities.Observable(function (observer) {
|
|
159
|
+
_this.setups.forEach(function (x) { return x(); });
|
|
160
|
+
_this.observers.push(observer);
|
|
161
|
+
return function () {
|
|
162
|
+
_this.unsubscribers.forEach(function (x) { return x(); });
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
MockSubscriptionLink.prototype.simulateResult = function (result, complete) {
|
|
167
|
+
var _this = this;
|
|
168
|
+
if (complete === void 0) { complete = false; }
|
|
169
|
+
setTimeout(function () {
|
|
170
|
+
var observers = _this.observers;
|
|
171
|
+
if (!observers.length)
|
|
172
|
+
throw new Error('subscription torn down');
|
|
173
|
+
observers.forEach(function (observer) {
|
|
174
|
+
if (result.result && observer.next)
|
|
175
|
+
observer.next(result.result);
|
|
176
|
+
if (result.error && observer.error)
|
|
177
|
+
observer.error(result.error);
|
|
178
|
+
if (complete && observer.complete)
|
|
179
|
+
observer.complete();
|
|
180
|
+
});
|
|
181
|
+
}, result.delay || 0);
|
|
182
|
+
};
|
|
183
|
+
MockSubscriptionLink.prototype.simulateComplete = function () {
|
|
184
|
+
var observers = this.observers;
|
|
185
|
+
if (!observers.length)
|
|
186
|
+
throw new Error('subscription torn down');
|
|
187
|
+
observers.forEach(function (observer) {
|
|
188
|
+
if (observer.complete)
|
|
189
|
+
observer.complete();
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
MockSubscriptionLink.prototype.onSetup = function (listener) {
|
|
193
|
+
this.setups = this.setups.concat([listener]);
|
|
194
|
+
};
|
|
195
|
+
MockSubscriptionLink.prototype.onUnsubscribe = function (listener) {
|
|
196
|
+
this.unsubscribers = this.unsubscribers.concat([listener]);
|
|
197
|
+
};
|
|
198
|
+
return MockSubscriptionLink;
|
|
199
|
+
}(core.ApolloLink));
|
|
200
|
+
function mockObservableLink() {
|
|
201
|
+
return new MockSubscriptionLink();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function createMockClient(data, query, variables) {
|
|
205
|
+
if (variables === void 0) { variables = {}; }
|
|
206
|
+
return new core$1.ApolloClient({
|
|
207
|
+
link: mockSingleLink({
|
|
208
|
+
request: { query: query, variables: variables },
|
|
209
|
+
result: { data: data },
|
|
210
|
+
}).setOnError(function (error) { throw error; }),
|
|
211
|
+
cache: new cache.InMemoryCache({ addTypename: false }),
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function subscribeAndCount(reject, observable, cb) {
|
|
216
|
+
var queue = Promise.resolve();
|
|
217
|
+
var handleCount = 0;
|
|
218
|
+
var subscription = utilities.asyncMap(observable, function (result) {
|
|
219
|
+
return queue = queue.then(function () {
|
|
220
|
+
return cb(++handleCount, result);
|
|
221
|
+
}).catch(error);
|
|
222
|
+
}).subscribe({ error: error });
|
|
223
|
+
function error(e) {
|
|
224
|
+
subscription.unsubscribe();
|
|
225
|
+
reject(e);
|
|
226
|
+
}
|
|
227
|
+
return subscription;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function wrap(key) {
|
|
231
|
+
return function (message, callback, timeout) { return (key ? it[key] : it)(message, function () {
|
|
232
|
+
var _this = this;
|
|
233
|
+
return new Promise(function (resolve, reject) { return callback.call(_this, resolve, reject); });
|
|
234
|
+
}, timeout); };
|
|
235
|
+
}
|
|
236
|
+
var wrappedIt = wrap();
|
|
237
|
+
var itAsync = Object.assign(function () {
|
|
238
|
+
var args = [];
|
|
239
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
240
|
+
args[_i] = arguments[_i];
|
|
241
|
+
}
|
|
242
|
+
return wrappedIt.apply(this, args);
|
|
243
|
+
}, {
|
|
244
|
+
only: wrap("only"),
|
|
245
|
+
skip: wrap("skip"),
|
|
246
|
+
todo: wrap("todo"),
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
function wait(ms) {
|
|
250
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
251
|
+
return tslib.__generator(this, function (_a) {
|
|
252
|
+
return [2, new Promise(function (resolve) { return setTimeout(resolve, ms); })];
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function tick() {
|
|
257
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
258
|
+
return tslib.__generator(this, function (_a) {
|
|
259
|
+
return [2, wait(0)];
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function wrapTestFunction(fn, consoleMethodName) {
|
|
265
|
+
return function () {
|
|
266
|
+
var _this = this;
|
|
267
|
+
var args = arguments;
|
|
268
|
+
var spy = jest.spyOn(console, consoleMethodName);
|
|
269
|
+
spy.mockImplementation(function () { });
|
|
270
|
+
return new Promise(function (resolve) {
|
|
271
|
+
resolve(fn === null || fn === void 0 ? void 0 : fn.apply(_this, args));
|
|
272
|
+
}).finally(function () {
|
|
273
|
+
expect(spy).toMatchSnapshot();
|
|
274
|
+
spy.mockReset();
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function withErrorSpy(it) {
|
|
279
|
+
var args = [];
|
|
280
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
281
|
+
args[_i - 1] = arguments[_i];
|
|
282
|
+
}
|
|
283
|
+
args[1] = wrapTestFunction(args[1], "error");
|
|
284
|
+
return it.apply(void 0, args);
|
|
285
|
+
}
|
|
286
|
+
function withWarningSpy(it) {
|
|
287
|
+
var args = [];
|
|
288
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
289
|
+
args[_i - 1] = arguments[_i];
|
|
290
|
+
}
|
|
291
|
+
args[1] = wrapTestFunction(args[1], "warn");
|
|
292
|
+
return it.apply(void 0, args);
|
|
293
|
+
}
|
|
294
|
+
function withLogSpy(it) {
|
|
295
|
+
var args = [];
|
|
296
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
297
|
+
args[_i - 1] = arguments[_i];
|
|
298
|
+
}
|
|
299
|
+
args[1] = wrapTestFunction(args[1], "log");
|
|
300
|
+
return it.apply(void 0, args);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
exports.MockLink = MockLink;
|
|
304
|
+
exports.MockSubscriptionLink = MockSubscriptionLink;
|
|
305
|
+
exports.createMockClient = createMockClient;
|
|
306
|
+
exports.itAsync = itAsync;
|
|
307
|
+
exports.mockObservableLink = mockObservableLink;
|
|
308
|
+
exports.mockSingleLink = mockSingleLink;
|
|
309
|
+
exports.subscribeAndCount = subscribeAndCount;
|
|
310
|
+
exports.tick = tick;
|
|
311
|
+
exports.wait = wait;
|
|
312
|
+
exports.withErrorSpy = withErrorSpy;
|
|
313
|
+
exports.withLogSpy = withLogSpy;
|
|
314
|
+
exports.withWarningSpy = withWarningSpy;
|
|
315
|
+
//# sourceMappingURL=core.cjs.map
|