@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,913 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var globals = require('../../utilities/globals');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var context = require('../context');
|
|
8
|
+
var tslib = require('tslib');
|
|
9
|
+
var utilities = require('../../utilities');
|
|
10
|
+
var equality = require('@wry/equality');
|
|
11
|
+
var core = require('../../core');
|
|
12
|
+
var errors = require('../../errors');
|
|
13
|
+
var parser = require('../parser');
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
for (var k in e) {
|
|
20
|
+
n[k] = e[k];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
n["default"] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
+
|
|
29
|
+
function useApolloClient(override) {
|
|
30
|
+
var context$1 = React.useContext(context.getApolloContext());
|
|
31
|
+
var client = override || context$1.client;
|
|
32
|
+
globals.__DEV__ ? globals.invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
|
|
33
|
+
'Wrap the root component in an <ApolloProvider>, or pass an ApolloClient ' +
|
|
34
|
+
'instance in via options.') : globals.invariant(!!client, 32);
|
|
35
|
+
return client;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var didWarnUncachedGetSnapshot = false;
|
|
39
|
+
var uSESKey = "useSyncExternalStore";
|
|
40
|
+
var realHook = React__namespace[uSESKey];
|
|
41
|
+
var useSyncExternalStore = realHook || (function (subscribe, getSnapshot, getServerSnapshot) {
|
|
42
|
+
var value = getSnapshot();
|
|
43
|
+
if (globals.__DEV__ &&
|
|
44
|
+
!didWarnUncachedGetSnapshot &&
|
|
45
|
+
value !== getSnapshot()) {
|
|
46
|
+
didWarnUncachedGetSnapshot = true;
|
|
47
|
+
globals.__DEV__ && globals.invariant.error('The result of getSnapshot should be cached to avoid an infinite loop');
|
|
48
|
+
}
|
|
49
|
+
var _a = React__namespace.useState({ inst: { value: value, getSnapshot: getSnapshot } }), inst = _a[0].inst, forceUpdate = _a[1];
|
|
50
|
+
if (utilities.canUseLayoutEffect) {
|
|
51
|
+
React__namespace.useLayoutEffect(function () {
|
|
52
|
+
Object.assign(inst, { value: value, getSnapshot: getSnapshot });
|
|
53
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
54
|
+
forceUpdate({ inst: inst });
|
|
55
|
+
}
|
|
56
|
+
}, [subscribe, value, getSnapshot]);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
Object.assign(inst, { value: value, getSnapshot: getSnapshot });
|
|
60
|
+
}
|
|
61
|
+
React__namespace.useEffect(function () {
|
|
62
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
63
|
+
forceUpdate({ inst: inst });
|
|
64
|
+
}
|
|
65
|
+
return subscribe(function handleStoreChange() {
|
|
66
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
67
|
+
forceUpdate({ inst: inst });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}, [subscribe]);
|
|
71
|
+
return value;
|
|
72
|
+
});
|
|
73
|
+
function checkIfSnapshotChanged(_a) {
|
|
74
|
+
var value = _a.value, getSnapshot = _a.getSnapshot;
|
|
75
|
+
try {
|
|
76
|
+
return value !== getSnapshot();
|
|
77
|
+
}
|
|
78
|
+
catch (_b) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
84
|
+
function useQuery(query, options) {
|
|
85
|
+
if (options === void 0) { options = Object.create(null); }
|
|
86
|
+
return useInternalState(useApolloClient(options.client), query).useQuery(options);
|
|
87
|
+
}
|
|
88
|
+
function useInternalState(client, query) {
|
|
89
|
+
var stateRef = React.useRef();
|
|
90
|
+
if (!stateRef.current ||
|
|
91
|
+
client !== stateRef.current.client ||
|
|
92
|
+
query !== stateRef.current.query) {
|
|
93
|
+
stateRef.current = new InternalState(client, query, stateRef.current);
|
|
94
|
+
}
|
|
95
|
+
var state = stateRef.current;
|
|
96
|
+
var _a = React.useState(0); _a[0]; var setTick = _a[1];
|
|
97
|
+
state.forceUpdate = function () {
|
|
98
|
+
setTick(function (tick) { return tick + 1; });
|
|
99
|
+
};
|
|
100
|
+
return state;
|
|
101
|
+
}
|
|
102
|
+
var InternalState = (function () {
|
|
103
|
+
function InternalState(client, query, previous) {
|
|
104
|
+
this.client = client;
|
|
105
|
+
this.query = query;
|
|
106
|
+
this.asyncResolveFns = new Set();
|
|
107
|
+
this.optionsToIgnoreOnce = new (utilities.canUseWeakSet ? WeakSet : Set)();
|
|
108
|
+
this.ssrDisabledResult = utilities.maybeDeepFreeze({
|
|
109
|
+
loading: true,
|
|
110
|
+
data: void 0,
|
|
111
|
+
error: void 0,
|
|
112
|
+
networkStatus: core.NetworkStatus.loading,
|
|
113
|
+
});
|
|
114
|
+
this.skipStandbyResult = utilities.maybeDeepFreeze({
|
|
115
|
+
loading: false,
|
|
116
|
+
data: void 0,
|
|
117
|
+
error: void 0,
|
|
118
|
+
networkStatus: core.NetworkStatus.ready,
|
|
119
|
+
});
|
|
120
|
+
this.toQueryResultCache = new (utilities.canUseWeakMap ? WeakMap : Map)();
|
|
121
|
+
parser.verifyDocumentType(query, parser.DocumentType.Query);
|
|
122
|
+
var previousResult = previous && previous.result;
|
|
123
|
+
var previousData = previousResult && previousResult.data;
|
|
124
|
+
if (previousData) {
|
|
125
|
+
this.previousData = previousData;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
InternalState.prototype.forceUpdate = function () {
|
|
129
|
+
globals.__DEV__ && globals.invariant.warn("Calling default no-op implementation of InternalState#forceUpdate");
|
|
130
|
+
};
|
|
131
|
+
InternalState.prototype.asyncUpdate = function (signal) {
|
|
132
|
+
var _this = this;
|
|
133
|
+
return new Promise(function (resolve, reject) {
|
|
134
|
+
var watchQueryOptions = _this.watchQueryOptions;
|
|
135
|
+
var handleAborted = function () {
|
|
136
|
+
_this.asyncResolveFns.delete(resolve);
|
|
137
|
+
_this.optionsToIgnoreOnce.delete(watchQueryOptions);
|
|
138
|
+
signal.removeEventListener('abort', handleAborted);
|
|
139
|
+
reject(signal.reason);
|
|
140
|
+
};
|
|
141
|
+
_this.asyncResolveFns.add(resolve);
|
|
142
|
+
_this.optionsToIgnoreOnce.add(watchQueryOptions);
|
|
143
|
+
signal.addEventListener('abort', handleAborted);
|
|
144
|
+
_this.forceUpdate();
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
InternalState.prototype.useQuery = function (options) {
|
|
148
|
+
var _this = this;
|
|
149
|
+
this.renderPromises = React.useContext(context.getApolloContext()).renderPromises;
|
|
150
|
+
this.useOptions(options);
|
|
151
|
+
var obsQuery = this.useObservableQuery();
|
|
152
|
+
var result = useSyncExternalStore(React.useCallback(function () {
|
|
153
|
+
if (_this.renderPromises) {
|
|
154
|
+
return function () { };
|
|
155
|
+
}
|
|
156
|
+
var onNext = function () {
|
|
157
|
+
var previousResult = _this.result;
|
|
158
|
+
var result = obsQuery.getCurrentResult();
|
|
159
|
+
if (previousResult &&
|
|
160
|
+
previousResult.loading === result.loading &&
|
|
161
|
+
previousResult.networkStatus === result.networkStatus &&
|
|
162
|
+
equality.equal(previousResult.data, result.data)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
_this.setResult(result);
|
|
166
|
+
};
|
|
167
|
+
var onError = function (error) {
|
|
168
|
+
var last = obsQuery["last"];
|
|
169
|
+
subscription.unsubscribe();
|
|
170
|
+
try {
|
|
171
|
+
obsQuery.resetLastResults();
|
|
172
|
+
subscription = obsQuery.subscribe(onNext, onError);
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
obsQuery["last"] = last;
|
|
176
|
+
}
|
|
177
|
+
if (!hasOwnProperty.call(error, 'graphQLErrors')) {
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
var previousResult = _this.result;
|
|
181
|
+
if (!previousResult ||
|
|
182
|
+
(previousResult && previousResult.loading) ||
|
|
183
|
+
!equality.equal(error, previousResult.error)) {
|
|
184
|
+
_this.setResult({
|
|
185
|
+
data: (previousResult && previousResult.data),
|
|
186
|
+
error: error,
|
|
187
|
+
loading: false,
|
|
188
|
+
networkStatus: core.NetworkStatus.error,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
var subscription = obsQuery.subscribe(onNext, onError);
|
|
193
|
+
return function () { return subscription.unsubscribe(); };
|
|
194
|
+
}, [
|
|
195
|
+
obsQuery,
|
|
196
|
+
this.renderPromises,
|
|
197
|
+
this.client.disableNetworkFetches,
|
|
198
|
+
]), function () { return _this.getCurrentResult(); }, function () { return _this.getCurrentResult(); });
|
|
199
|
+
this.unsafeHandlePartialRefetch(result);
|
|
200
|
+
var queryResult = this.toQueryResult(result);
|
|
201
|
+
if (!queryResult.loading && this.asyncResolveFns.size) {
|
|
202
|
+
this.asyncResolveFns.forEach(function (resolve) { return resolve(queryResult); });
|
|
203
|
+
this.asyncResolveFns.clear();
|
|
204
|
+
}
|
|
205
|
+
return queryResult;
|
|
206
|
+
};
|
|
207
|
+
InternalState.prototype.useOptions = function (options) {
|
|
208
|
+
var _a;
|
|
209
|
+
var watchQueryOptions = this.createWatchQueryOptions(this.queryHookOptions = options);
|
|
210
|
+
var currentWatchQueryOptions = this.watchQueryOptions;
|
|
211
|
+
if (this.optionsToIgnoreOnce.has(currentWatchQueryOptions) ||
|
|
212
|
+
!equality.equal(watchQueryOptions, currentWatchQueryOptions)) {
|
|
213
|
+
this.watchQueryOptions = watchQueryOptions;
|
|
214
|
+
if (currentWatchQueryOptions && this.observable) {
|
|
215
|
+
this.optionsToIgnoreOnce.delete(currentWatchQueryOptions);
|
|
216
|
+
this.observable.reobserve(this.getObsQueryOptions());
|
|
217
|
+
this.previousData = ((_a = this.result) === null || _a === void 0 ? void 0 : _a.data) || this.previousData;
|
|
218
|
+
this.result = void 0;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
this.onCompleted = options.onCompleted || InternalState.prototype.onCompleted;
|
|
222
|
+
this.onError = options.onError || InternalState.prototype.onError;
|
|
223
|
+
if ((this.renderPromises || this.client.disableNetworkFetches) &&
|
|
224
|
+
this.queryHookOptions.ssr === false &&
|
|
225
|
+
!this.queryHookOptions.skip) {
|
|
226
|
+
this.result = this.ssrDisabledResult;
|
|
227
|
+
}
|
|
228
|
+
else if (this.queryHookOptions.skip ||
|
|
229
|
+
this.watchQueryOptions.fetchPolicy === 'standby') {
|
|
230
|
+
this.result = this.skipStandbyResult;
|
|
231
|
+
}
|
|
232
|
+
else if (this.result === this.ssrDisabledResult ||
|
|
233
|
+
this.result === this.skipStandbyResult) {
|
|
234
|
+
this.result = void 0;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
InternalState.prototype.getObsQueryOptions = function () {
|
|
238
|
+
var toMerge = [];
|
|
239
|
+
var globalDefaults = this.client.defaultOptions.watchQuery;
|
|
240
|
+
if (globalDefaults)
|
|
241
|
+
toMerge.push(globalDefaults);
|
|
242
|
+
if (this.queryHookOptions.defaultOptions) {
|
|
243
|
+
toMerge.push(this.queryHookOptions.defaultOptions);
|
|
244
|
+
}
|
|
245
|
+
toMerge.push(utilities.compact(this.observable && this.observable.options, this.watchQueryOptions));
|
|
246
|
+
return toMerge.reduce(core.mergeOptions);
|
|
247
|
+
};
|
|
248
|
+
InternalState.prototype.createWatchQueryOptions = function (_a) {
|
|
249
|
+
var _b;
|
|
250
|
+
if (_a === void 0) { _a = {}; }
|
|
251
|
+
var skip = _a.skip; _a.ssr; _a.onCompleted; _a.onError; _a.defaultOptions; var otherOptions = tslib.__rest(_a, ["skip", "ssr", "onCompleted", "onError", "defaultOptions"]);
|
|
252
|
+
var watchQueryOptions = Object.assign(otherOptions, { query: this.query });
|
|
253
|
+
if (this.renderPromises &&
|
|
254
|
+
(watchQueryOptions.fetchPolicy === 'network-only' ||
|
|
255
|
+
watchQueryOptions.fetchPolicy === 'cache-and-network')) {
|
|
256
|
+
watchQueryOptions.fetchPolicy = 'cache-first';
|
|
257
|
+
}
|
|
258
|
+
if (!watchQueryOptions.variables) {
|
|
259
|
+
watchQueryOptions.variables = {};
|
|
260
|
+
}
|
|
261
|
+
if (skip) {
|
|
262
|
+
var _c = watchQueryOptions.fetchPolicy, fetchPolicy = _c === void 0 ? this.getDefaultFetchPolicy() : _c, _d = watchQueryOptions.initialFetchPolicy, initialFetchPolicy = _d === void 0 ? fetchPolicy : _d;
|
|
263
|
+
Object.assign(watchQueryOptions, {
|
|
264
|
+
initialFetchPolicy: initialFetchPolicy,
|
|
265
|
+
fetchPolicy: 'standby',
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
else if (!watchQueryOptions.fetchPolicy) {
|
|
269
|
+
watchQueryOptions.fetchPolicy =
|
|
270
|
+
((_b = this.observable) === null || _b === void 0 ? void 0 : _b.options.initialFetchPolicy) ||
|
|
271
|
+
this.getDefaultFetchPolicy();
|
|
272
|
+
}
|
|
273
|
+
return watchQueryOptions;
|
|
274
|
+
};
|
|
275
|
+
InternalState.prototype.getDefaultFetchPolicy = function () {
|
|
276
|
+
var _a, _b;
|
|
277
|
+
return (((_a = this.queryHookOptions.defaultOptions) === null || _a === void 0 ? void 0 : _a.fetchPolicy) ||
|
|
278
|
+
((_b = this.client.defaultOptions.watchQuery) === null || _b === void 0 ? void 0 : _b.fetchPolicy) ||
|
|
279
|
+
"cache-first");
|
|
280
|
+
};
|
|
281
|
+
InternalState.prototype.onCompleted = function (data) { };
|
|
282
|
+
InternalState.prototype.onError = function (error) { };
|
|
283
|
+
InternalState.prototype.useObservableQuery = function () {
|
|
284
|
+
var obsQuery = this.observable =
|
|
285
|
+
this.renderPromises
|
|
286
|
+
&& this.renderPromises.getSSRObservable(this.watchQueryOptions)
|
|
287
|
+
|| this.observable
|
|
288
|
+
|| this.client.watchQuery(this.getObsQueryOptions());
|
|
289
|
+
this.obsQueryFields = React.useMemo(function () { return ({
|
|
290
|
+
refetch: obsQuery.refetch.bind(obsQuery),
|
|
291
|
+
reobserve: obsQuery.reobserve.bind(obsQuery),
|
|
292
|
+
fetchMore: obsQuery.fetchMore.bind(obsQuery),
|
|
293
|
+
updateQuery: obsQuery.updateQuery.bind(obsQuery),
|
|
294
|
+
startPolling: obsQuery.startPolling.bind(obsQuery),
|
|
295
|
+
stopPolling: obsQuery.stopPolling.bind(obsQuery),
|
|
296
|
+
subscribeToMore: obsQuery.subscribeToMore.bind(obsQuery),
|
|
297
|
+
}); }, [obsQuery]);
|
|
298
|
+
var ssrAllowed = !(this.queryHookOptions.ssr === false ||
|
|
299
|
+
this.queryHookOptions.skip);
|
|
300
|
+
if (this.renderPromises && ssrAllowed) {
|
|
301
|
+
this.renderPromises.registerSSRObservable(obsQuery);
|
|
302
|
+
if (obsQuery.getCurrentResult().loading) {
|
|
303
|
+
this.renderPromises.addObservableQueryPromise(obsQuery);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return obsQuery;
|
|
307
|
+
};
|
|
308
|
+
InternalState.prototype.setResult = function (nextResult) {
|
|
309
|
+
var previousResult = this.result;
|
|
310
|
+
if (previousResult && previousResult.data) {
|
|
311
|
+
this.previousData = previousResult.data;
|
|
312
|
+
}
|
|
313
|
+
this.result = nextResult;
|
|
314
|
+
this.forceUpdate();
|
|
315
|
+
this.handleErrorOrCompleted(nextResult, previousResult);
|
|
316
|
+
};
|
|
317
|
+
InternalState.prototype.handleErrorOrCompleted = function (result, previousResult) {
|
|
318
|
+
var _this = this;
|
|
319
|
+
if (!result.loading) {
|
|
320
|
+
var error_1 = this.toApolloError(result);
|
|
321
|
+
Promise.resolve().then(function () {
|
|
322
|
+
if (error_1) {
|
|
323
|
+
_this.onError(error_1);
|
|
324
|
+
}
|
|
325
|
+
else if (result.data &&
|
|
326
|
+
(previousResult === null || previousResult === void 0 ? void 0 : previousResult.networkStatus) !== result.networkStatus &&
|
|
327
|
+
result.networkStatus === core.NetworkStatus.ready) {
|
|
328
|
+
_this.onCompleted(result.data);
|
|
329
|
+
}
|
|
330
|
+
}).catch(function (error) {
|
|
331
|
+
globals.__DEV__ && globals.invariant.warn(error);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
InternalState.prototype.toApolloError = function (result) {
|
|
336
|
+
return utilities.isNonEmptyArray(result.errors)
|
|
337
|
+
? new errors.ApolloError({ graphQLErrors: result.errors })
|
|
338
|
+
: result.error;
|
|
339
|
+
};
|
|
340
|
+
InternalState.prototype.getCurrentResult = function () {
|
|
341
|
+
if (!this.result) {
|
|
342
|
+
this.handleErrorOrCompleted(this.result = this.observable.getCurrentResult());
|
|
343
|
+
}
|
|
344
|
+
return this.result;
|
|
345
|
+
};
|
|
346
|
+
InternalState.prototype.toQueryResult = function (result) {
|
|
347
|
+
var queryResult = this.toQueryResultCache.get(result);
|
|
348
|
+
if (queryResult)
|
|
349
|
+
return queryResult;
|
|
350
|
+
var data = result.data; result.partial; var resultWithoutPartial = tslib.__rest(result, ["data", "partial"]);
|
|
351
|
+
this.toQueryResultCache.set(result, queryResult = tslib.__assign(tslib.__assign(tslib.__assign({ data: data }, resultWithoutPartial), this.obsQueryFields), { client: this.client, observable: this.observable, variables: this.observable.variables, called: !this.queryHookOptions.skip, previousData: this.previousData }));
|
|
352
|
+
if (!queryResult.error && utilities.isNonEmptyArray(result.errors)) {
|
|
353
|
+
queryResult.error = new errors.ApolloError({ graphQLErrors: result.errors });
|
|
354
|
+
}
|
|
355
|
+
return queryResult;
|
|
356
|
+
};
|
|
357
|
+
InternalState.prototype.unsafeHandlePartialRefetch = function (result) {
|
|
358
|
+
if (result.partial &&
|
|
359
|
+
this.queryHookOptions.partialRefetch &&
|
|
360
|
+
!result.loading &&
|
|
361
|
+
(!result.data || Object.keys(result.data).length === 0) &&
|
|
362
|
+
this.observable.options.fetchPolicy !== 'cache-only') {
|
|
363
|
+
Object.assign(result, {
|
|
364
|
+
loading: true,
|
|
365
|
+
networkStatus: core.NetworkStatus.refetch,
|
|
366
|
+
});
|
|
367
|
+
this.observable.refetch();
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
return InternalState;
|
|
371
|
+
}());
|
|
372
|
+
|
|
373
|
+
var EAGER_METHODS = [
|
|
374
|
+
'refetch',
|
|
375
|
+
'reobserve',
|
|
376
|
+
'fetchMore',
|
|
377
|
+
'updateQuery',
|
|
378
|
+
'startPolling',
|
|
379
|
+
'subscribeToMore',
|
|
380
|
+
];
|
|
381
|
+
function useLazyQuery(query, options) {
|
|
382
|
+
var _a;
|
|
383
|
+
var abortControllersRef = React.useRef(new Set());
|
|
384
|
+
var execOptionsRef = React.useRef();
|
|
385
|
+
var merged = execOptionsRef.current ? utilities.mergeOptions(options, execOptionsRef.current) : options;
|
|
386
|
+
var internalState = useInternalState(useApolloClient(options && options.client), (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query);
|
|
387
|
+
var useQueryResult = internalState.useQuery(tslib.__assign(tslib.__assign({}, merged), { skip: !execOptionsRef.current }));
|
|
388
|
+
var initialFetchPolicy = useQueryResult.observable.options.initialFetchPolicy ||
|
|
389
|
+
internalState.getDefaultFetchPolicy();
|
|
390
|
+
var result = Object.assign(useQueryResult, {
|
|
391
|
+
called: !!execOptionsRef.current,
|
|
392
|
+
});
|
|
393
|
+
var eagerMethods = React.useMemo(function () {
|
|
394
|
+
var eagerMethods = {};
|
|
395
|
+
var _loop_1 = function (key) {
|
|
396
|
+
var method = result[key];
|
|
397
|
+
eagerMethods[key] = function () {
|
|
398
|
+
if (!execOptionsRef.current) {
|
|
399
|
+
execOptionsRef.current = Object.create(null);
|
|
400
|
+
internalState.forceUpdate();
|
|
401
|
+
}
|
|
402
|
+
return method.apply(this, arguments);
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
for (var _i = 0, EAGER_METHODS_1 = EAGER_METHODS; _i < EAGER_METHODS_1.length; _i++) {
|
|
406
|
+
var key = EAGER_METHODS_1[_i];
|
|
407
|
+
_loop_1(key);
|
|
408
|
+
}
|
|
409
|
+
return eagerMethods;
|
|
410
|
+
}, []);
|
|
411
|
+
Object.assign(result, eagerMethods);
|
|
412
|
+
React.useEffect(function () {
|
|
413
|
+
return function () {
|
|
414
|
+
abortControllersRef.current.forEach(function (controller) {
|
|
415
|
+
controller.abort();
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
}, []);
|
|
419
|
+
var execute = React.useCallback(function (executeOptions) {
|
|
420
|
+
var controller = new AbortController();
|
|
421
|
+
abortControllersRef.current.add(controller);
|
|
422
|
+
execOptionsRef.current = executeOptions ? tslib.__assign(tslib.__assign({}, executeOptions), { fetchPolicy: executeOptions.fetchPolicy || initialFetchPolicy }) : {
|
|
423
|
+
fetchPolicy: initialFetchPolicy,
|
|
424
|
+
};
|
|
425
|
+
var promise = internalState
|
|
426
|
+
.asyncUpdate(controller.signal)
|
|
427
|
+
.then(function (queryResult) {
|
|
428
|
+
abortControllersRef.current.delete(controller);
|
|
429
|
+
return Object.assign(queryResult, eagerMethods);
|
|
430
|
+
});
|
|
431
|
+
promise.catch(function () {
|
|
432
|
+
abortControllersRef.current.delete(controller);
|
|
433
|
+
});
|
|
434
|
+
return promise;
|
|
435
|
+
}, []);
|
|
436
|
+
return [execute, result];
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function useMutation(mutation, options) {
|
|
440
|
+
var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
|
|
441
|
+
parser.verifyDocumentType(mutation, parser.DocumentType.Mutation);
|
|
442
|
+
var _a = React.useState({
|
|
443
|
+
called: false,
|
|
444
|
+
loading: false,
|
|
445
|
+
client: client,
|
|
446
|
+
}), result = _a[0], setResult = _a[1];
|
|
447
|
+
var ref = React.useRef({
|
|
448
|
+
result: result,
|
|
449
|
+
mutationId: 0,
|
|
450
|
+
isMounted: true,
|
|
451
|
+
client: client,
|
|
452
|
+
mutation: mutation,
|
|
453
|
+
options: options,
|
|
454
|
+
});
|
|
455
|
+
{
|
|
456
|
+
Object.assign(ref.current, { client: client, options: options, mutation: mutation });
|
|
457
|
+
}
|
|
458
|
+
var execute = React.useCallback(function (executeOptions) {
|
|
459
|
+
if (executeOptions === void 0) { executeOptions = {}; }
|
|
460
|
+
var _a = ref.current, client = _a.client, options = _a.options, mutation = _a.mutation;
|
|
461
|
+
var baseOptions = tslib.__assign(tslib.__assign({}, options), { mutation: mutation });
|
|
462
|
+
if (!ref.current.result.loading && !baseOptions.ignoreResults && ref.current.isMounted) {
|
|
463
|
+
setResult(ref.current.result = {
|
|
464
|
+
loading: true,
|
|
465
|
+
error: void 0,
|
|
466
|
+
data: void 0,
|
|
467
|
+
called: true,
|
|
468
|
+
client: client,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
var mutationId = ++ref.current.mutationId;
|
|
472
|
+
var clientOptions = core.mergeOptions(baseOptions, executeOptions);
|
|
473
|
+
return client.mutate(clientOptions).then(function (response) {
|
|
474
|
+
var _a;
|
|
475
|
+
var data = response.data, errors$1 = response.errors;
|
|
476
|
+
var error = errors$1 && errors$1.length > 0
|
|
477
|
+
? new errors.ApolloError({ graphQLErrors: errors$1 })
|
|
478
|
+
: void 0;
|
|
479
|
+
if (mutationId === ref.current.mutationId &&
|
|
480
|
+
!clientOptions.ignoreResults) {
|
|
481
|
+
var result_1 = {
|
|
482
|
+
called: true,
|
|
483
|
+
loading: false,
|
|
484
|
+
data: data,
|
|
485
|
+
error: error,
|
|
486
|
+
client: client,
|
|
487
|
+
};
|
|
488
|
+
if (ref.current.isMounted && !equality.equal(ref.current.result, result_1)) {
|
|
489
|
+
setResult(ref.current.result = result_1);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
var onCompleted = executeOptions.onCompleted || ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onCompleted);
|
|
493
|
+
onCompleted === null || onCompleted === void 0 ? void 0 : onCompleted(response.data, clientOptions);
|
|
494
|
+
return response;
|
|
495
|
+
}).catch(function (error) {
|
|
496
|
+
var _a;
|
|
497
|
+
if (mutationId === ref.current.mutationId &&
|
|
498
|
+
ref.current.isMounted) {
|
|
499
|
+
var result_2 = {
|
|
500
|
+
loading: false,
|
|
501
|
+
error: error,
|
|
502
|
+
data: void 0,
|
|
503
|
+
called: true,
|
|
504
|
+
client: client,
|
|
505
|
+
};
|
|
506
|
+
if (!equality.equal(ref.current.result, result_2)) {
|
|
507
|
+
setResult(ref.current.result = result_2);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
var onError = executeOptions.onError || ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError);
|
|
511
|
+
if (onError) {
|
|
512
|
+
onError(error, clientOptions);
|
|
513
|
+
return { data: void 0, errors: error };
|
|
514
|
+
}
|
|
515
|
+
throw error;
|
|
516
|
+
});
|
|
517
|
+
}, []);
|
|
518
|
+
var reset = React.useCallback(function () {
|
|
519
|
+
if (ref.current.isMounted) {
|
|
520
|
+
setResult({ called: false, loading: false, client: client });
|
|
521
|
+
}
|
|
522
|
+
}, []);
|
|
523
|
+
React.useEffect(function () {
|
|
524
|
+
ref.current.isMounted = true;
|
|
525
|
+
return function () {
|
|
526
|
+
ref.current.isMounted = false;
|
|
527
|
+
};
|
|
528
|
+
}, []);
|
|
529
|
+
return [execute, tslib.__assign({ reset: reset }, result)];
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
function useSubscription(subscription, options) {
|
|
533
|
+
var hasIssuedDeprecationWarningRef = React.useRef(false);
|
|
534
|
+
var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
|
|
535
|
+
parser.verifyDocumentType(subscription, parser.DocumentType.Subscription);
|
|
536
|
+
var _a = React.useState({
|
|
537
|
+
loading: !(options === null || options === void 0 ? void 0 : options.skip),
|
|
538
|
+
error: void 0,
|
|
539
|
+
data: void 0,
|
|
540
|
+
variables: options === null || options === void 0 ? void 0 : options.variables,
|
|
541
|
+
}), result = _a[0], setResult = _a[1];
|
|
542
|
+
if (!hasIssuedDeprecationWarningRef.current) {
|
|
543
|
+
hasIssuedDeprecationWarningRef.current = true;
|
|
544
|
+
if (options === null || options === void 0 ? void 0 : options.onSubscriptionData) {
|
|
545
|
+
globals.__DEV__ && globals.invariant.warn(options.onData
|
|
546
|
+
? "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
|
|
547
|
+
: "'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead.");
|
|
548
|
+
}
|
|
549
|
+
if (options === null || options === void 0 ? void 0 : options.onSubscriptionComplete) {
|
|
550
|
+
globals.__DEV__ && globals.invariant.warn(options.onComplete
|
|
551
|
+
? "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
|
|
552
|
+
: "'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead.");
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
var _b = React.useState(function () {
|
|
556
|
+
if (options === null || options === void 0 ? void 0 : options.skip) {
|
|
557
|
+
return null;
|
|
558
|
+
}
|
|
559
|
+
return client.subscribe({
|
|
560
|
+
query: subscription,
|
|
561
|
+
variables: options === null || options === void 0 ? void 0 : options.variables,
|
|
562
|
+
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
|
563
|
+
context: options === null || options === void 0 ? void 0 : options.context,
|
|
564
|
+
});
|
|
565
|
+
}), observable = _b[0], setObservable = _b[1];
|
|
566
|
+
var canResetObservableRef = React.useRef(false);
|
|
567
|
+
React.useEffect(function () {
|
|
568
|
+
return function () {
|
|
569
|
+
canResetObservableRef.current = true;
|
|
570
|
+
};
|
|
571
|
+
}, []);
|
|
572
|
+
var ref = React.useRef({ client: client, subscription: subscription, options: options });
|
|
573
|
+
React.useEffect(function () {
|
|
574
|
+
var _a, _b, _c, _d;
|
|
575
|
+
var shouldResubscribe = options === null || options === void 0 ? void 0 : options.shouldResubscribe;
|
|
576
|
+
if (typeof shouldResubscribe === 'function') {
|
|
577
|
+
shouldResubscribe = !!shouldResubscribe(options);
|
|
578
|
+
}
|
|
579
|
+
if (options === null || options === void 0 ? void 0 : options.skip) {
|
|
580
|
+
if (!(options === null || options === void 0 ? void 0 : options.skip) !== !((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.skip) || canResetObservableRef.current) {
|
|
581
|
+
setResult({
|
|
582
|
+
loading: false,
|
|
583
|
+
data: void 0,
|
|
584
|
+
error: void 0,
|
|
585
|
+
variables: options === null || options === void 0 ? void 0 : options.variables,
|
|
586
|
+
});
|
|
587
|
+
setObservable(null);
|
|
588
|
+
canResetObservableRef.current = false;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
else if ((shouldResubscribe !== false &&
|
|
592
|
+
(client !== ref.current.client ||
|
|
593
|
+
subscription !== ref.current.subscription ||
|
|
594
|
+
(options === null || options === void 0 ? void 0 : options.fetchPolicy) !== ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.fetchPolicy) ||
|
|
595
|
+
!(options === null || options === void 0 ? void 0 : options.skip) !== !((_c = ref.current.options) === null || _c === void 0 ? void 0 : _c.skip) ||
|
|
596
|
+
!equality.equal(options === null || options === void 0 ? void 0 : options.variables, (_d = ref.current.options) === null || _d === void 0 ? void 0 : _d.variables))) ||
|
|
597
|
+
canResetObservableRef.current) {
|
|
598
|
+
setResult({
|
|
599
|
+
loading: true,
|
|
600
|
+
data: void 0,
|
|
601
|
+
error: void 0,
|
|
602
|
+
variables: options === null || options === void 0 ? void 0 : options.variables,
|
|
603
|
+
});
|
|
604
|
+
setObservable(client.subscribe({
|
|
605
|
+
query: subscription,
|
|
606
|
+
variables: options === null || options === void 0 ? void 0 : options.variables,
|
|
607
|
+
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
|
608
|
+
context: options === null || options === void 0 ? void 0 : options.context,
|
|
609
|
+
}));
|
|
610
|
+
canResetObservableRef.current = false;
|
|
611
|
+
}
|
|
612
|
+
Object.assign(ref.current, { client: client, subscription: subscription, options: options });
|
|
613
|
+
}, [client, subscription, options, canResetObservableRef.current]);
|
|
614
|
+
React.useEffect(function () {
|
|
615
|
+
if (!observable) {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
var subscription = observable.subscribe({
|
|
619
|
+
next: function (fetchResult) {
|
|
620
|
+
var _a, _b;
|
|
621
|
+
var result = {
|
|
622
|
+
loading: false,
|
|
623
|
+
data: fetchResult.data,
|
|
624
|
+
error: void 0,
|
|
625
|
+
variables: options === null || options === void 0 ? void 0 : options.variables,
|
|
626
|
+
};
|
|
627
|
+
setResult(result);
|
|
628
|
+
if ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onData) {
|
|
629
|
+
ref.current.options.onData({
|
|
630
|
+
client: client,
|
|
631
|
+
data: result
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
else if ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onSubscriptionData) {
|
|
635
|
+
ref.current.options.onSubscriptionData({
|
|
636
|
+
client: client,
|
|
637
|
+
subscriptionData: result
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
error: function (error) {
|
|
642
|
+
var _a, _b;
|
|
643
|
+
setResult({
|
|
644
|
+
loading: false,
|
|
645
|
+
data: void 0,
|
|
646
|
+
error: error,
|
|
647
|
+
variables: options === null || options === void 0 ? void 0 : options.variables,
|
|
648
|
+
});
|
|
649
|
+
(_b = (_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
650
|
+
},
|
|
651
|
+
complete: function () {
|
|
652
|
+
var _a, _b;
|
|
653
|
+
if ((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onComplete) {
|
|
654
|
+
ref.current.options.onComplete();
|
|
655
|
+
}
|
|
656
|
+
else if ((_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onSubscriptionComplete) {
|
|
657
|
+
ref.current.options.onSubscriptionComplete();
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
});
|
|
661
|
+
return function () {
|
|
662
|
+
subscription.unsubscribe();
|
|
663
|
+
};
|
|
664
|
+
}, [observable]);
|
|
665
|
+
return result;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function useReactiveVar(rv) {
|
|
669
|
+
var value = rv();
|
|
670
|
+
var setValue = React.useState(value)[1];
|
|
671
|
+
React.useEffect(function () {
|
|
672
|
+
var probablySameValue = rv();
|
|
673
|
+
if (value !== probablySameValue) {
|
|
674
|
+
setValue(probablySameValue);
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
return rv.onNextChange(setValue);
|
|
678
|
+
}
|
|
679
|
+
}, [value]);
|
|
680
|
+
return value;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
function useFragment_experimental(options) {
|
|
684
|
+
var cache = useApolloClient().cache;
|
|
685
|
+
var fragment = options.fragment, fragmentName = options.fragmentName, from = options.from, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, rest = tslib.__rest(options, ["fragment", "fragmentName", "from", "optimistic"]);
|
|
686
|
+
var diffOptions = tslib.__assign(tslib.__assign({}, rest), { id: typeof from === "string" ? from : cache.identify(from), query: cache["getFragmentDoc"](fragment, fragmentName), optimistic: optimistic });
|
|
687
|
+
var resultRef = React.useRef();
|
|
688
|
+
var latestDiff = cache.diff(diffOptions);
|
|
689
|
+
var getSnapshot = function () {
|
|
690
|
+
var latestDiffToResult = diffToResult(latestDiff);
|
|
691
|
+
return resultRef.current &&
|
|
692
|
+
equality.equal(resultRef.current.data, latestDiffToResult.data)
|
|
693
|
+
? resultRef.current
|
|
694
|
+
: (resultRef.current = latestDiffToResult);
|
|
695
|
+
};
|
|
696
|
+
return useSyncExternalStore(function (forceUpdate) {
|
|
697
|
+
return cache.watch(tslib.__assign(tslib.__assign({}, diffOptions), { immediate: true, callback: function (diff) {
|
|
698
|
+
if (!equality.equal(diff, latestDiff)) {
|
|
699
|
+
resultRef.current = diffToResult((latestDiff = diff));
|
|
700
|
+
forceUpdate();
|
|
701
|
+
}
|
|
702
|
+
} }));
|
|
703
|
+
}, getSnapshot, getSnapshot);
|
|
704
|
+
}
|
|
705
|
+
function diffToResult(diff) {
|
|
706
|
+
var result = {
|
|
707
|
+
data: diff.result,
|
|
708
|
+
complete: !!diff.complete,
|
|
709
|
+
};
|
|
710
|
+
if (diff.missing) {
|
|
711
|
+
result.missing = utilities.mergeDeepArray(diff.missing.map(function (error) { return error.missing; }));
|
|
712
|
+
}
|
|
713
|
+
return result;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
function useDeepMemo(memoFn, deps) {
|
|
717
|
+
var ref = React.useRef();
|
|
718
|
+
if (!ref.current || !equality.equal(ref.current.deps, deps)) {
|
|
719
|
+
ref.current = { value: memoFn(), deps: deps };
|
|
720
|
+
}
|
|
721
|
+
return ref.current.value;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
var useIsomorphicLayoutEffect = utilities.canUseLayoutEffect
|
|
725
|
+
? React.useLayoutEffect
|
|
726
|
+
: React.useEffect;
|
|
727
|
+
|
|
728
|
+
function useSuspenseCache() {
|
|
729
|
+
var suspenseCache = React.useContext(context.getApolloContext()).suspenseCache;
|
|
730
|
+
globals.__DEV__ ? globals.invariant(suspenseCache, 'Could not find a "suspenseCache" in the context. Wrap the root component ' +
|
|
731
|
+
'in an <ApolloProvider> and provide a suspenseCache.') : globals.invariant(suspenseCache, 33);
|
|
732
|
+
return suspenseCache;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
var SUPPORTED_FETCH_POLICIES = [
|
|
736
|
+
'cache-first',
|
|
737
|
+
'network-only',
|
|
738
|
+
'no-cache',
|
|
739
|
+
'cache-and-network',
|
|
740
|
+
];
|
|
741
|
+
var DEFAULT_FETCH_POLICY = 'cache-first';
|
|
742
|
+
var DEFAULT_SUSPENSE_POLICY = 'always';
|
|
743
|
+
var DEFAULT_ERROR_POLICY = 'none';
|
|
744
|
+
function useSuspenseQuery_experimental(query, options) {
|
|
745
|
+
if (options === void 0) { options = Object.create(null); }
|
|
746
|
+
var suspenseCache = useSuspenseCache();
|
|
747
|
+
var client = useApolloClient(options.client);
|
|
748
|
+
var watchQueryOptions = useWatchQueryOptions({ query: query, options: options, client: client });
|
|
749
|
+
var previousWatchQueryOptionsRef = React.useRef(watchQueryOptions);
|
|
750
|
+
var deferred = useIsDeferred(query);
|
|
751
|
+
var fetchPolicy = watchQueryOptions.fetchPolicy, errorPolicy = watchQueryOptions.errorPolicy, returnPartialData = watchQueryOptions.returnPartialData, variables = watchQueryOptions.variables;
|
|
752
|
+
var cacheEntry = suspenseCache.lookup(query, variables);
|
|
753
|
+
var observable = React.useState(function () {
|
|
754
|
+
return (cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.observable) || client.watchQuery(watchQueryOptions);
|
|
755
|
+
})[0];
|
|
756
|
+
var result = useObservableQueryResult(observable);
|
|
757
|
+
var hasFullResult = result.data && !result.partial;
|
|
758
|
+
var hasPartialResult = result.data && result.partial;
|
|
759
|
+
var usePartialResult = returnPartialData && hasPartialResult;
|
|
760
|
+
var allowsThrownErrors = errorPolicy === 'none' && (!deferred || !hasPartialResult);
|
|
761
|
+
if (result.error &&
|
|
762
|
+
(result.error.networkError || allowsThrownErrors)) {
|
|
763
|
+
throw result.error;
|
|
764
|
+
}
|
|
765
|
+
if (result.loading) {
|
|
766
|
+
if (!cacheEntry) {
|
|
767
|
+
cacheEntry = suspenseCache.add(query, variables, {
|
|
768
|
+
promise: maybeWrapConcastWithCustomPromise(observable.reobserveAsConcast(watchQueryOptions), { deferred: deferred }),
|
|
769
|
+
observable: observable,
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
var hasUsableResult = usePartialResult ||
|
|
773
|
+
(fetchPolicy === 'cache-and-network' && hasFullResult);
|
|
774
|
+
if (!hasUsableResult && !cacheEntry.fulfilled) {
|
|
775
|
+
throw cacheEntry.promise;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
React.useEffect(function () {
|
|
779
|
+
var variables = watchQueryOptions.variables, query = watchQueryOptions.query;
|
|
780
|
+
var previousOpts = previousWatchQueryOptionsRef.current;
|
|
781
|
+
if (variables !== previousOpts.variables || query !== previousOpts.query) {
|
|
782
|
+
suspenseCache.remove(previousOpts.query, previousOpts.variables);
|
|
783
|
+
suspenseCache.add(query, variables, {
|
|
784
|
+
promise: observable.reobserve({ query: query, variables: variables }),
|
|
785
|
+
observable: observable,
|
|
786
|
+
});
|
|
787
|
+
previousWatchQueryOptionsRef.current = watchQueryOptions;
|
|
788
|
+
}
|
|
789
|
+
}, [watchQueryOptions]);
|
|
790
|
+
React.useEffect(function () {
|
|
791
|
+
return function () {
|
|
792
|
+
suspenseCache.remove(query, variables);
|
|
793
|
+
};
|
|
794
|
+
}, []);
|
|
795
|
+
return React.useMemo(function () {
|
|
796
|
+
return {
|
|
797
|
+
client: client,
|
|
798
|
+
data: result.data,
|
|
799
|
+
error: errorPolicy === 'ignore' ? void 0 : toApolloError(result),
|
|
800
|
+
fetchMore: function (options) {
|
|
801
|
+
var promise = observable.fetchMore(options);
|
|
802
|
+
suspenseCache.add(query, watchQueryOptions.variables, {
|
|
803
|
+
promise: promise,
|
|
804
|
+
observable: observable,
|
|
805
|
+
});
|
|
806
|
+
return promise;
|
|
807
|
+
},
|
|
808
|
+
refetch: function (variables) {
|
|
809
|
+
var promise = observable.refetch(variables);
|
|
810
|
+
suspenseCache.add(query, watchQueryOptions.variables, {
|
|
811
|
+
promise: promise,
|
|
812
|
+
observable: observable,
|
|
813
|
+
});
|
|
814
|
+
return promise;
|
|
815
|
+
},
|
|
816
|
+
subscribeToMore: function (options) { return observable.subscribeToMore(options); },
|
|
817
|
+
};
|
|
818
|
+
}, [client, result, observable, errorPolicy]);
|
|
819
|
+
}
|
|
820
|
+
function validateOptions(options) {
|
|
821
|
+
var query = options.query, _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? DEFAULT_FETCH_POLICY : _a, returnPartialData = options.returnPartialData;
|
|
822
|
+
parser.verifyDocumentType(query, parser.DocumentType.Query);
|
|
823
|
+
validateFetchPolicy(fetchPolicy);
|
|
824
|
+
validatePartialDataReturn(fetchPolicy, returnPartialData);
|
|
825
|
+
}
|
|
826
|
+
function validateFetchPolicy(fetchPolicy) {
|
|
827
|
+
globals.__DEV__ ? globals.invariant(SUPPORTED_FETCH_POLICIES.includes(fetchPolicy), "The fetch policy `".concat(fetchPolicy, "` is not supported with suspense.")) : globals.invariant(SUPPORTED_FETCH_POLICIES.includes(fetchPolicy), 34);
|
|
828
|
+
}
|
|
829
|
+
function validatePartialDataReturn(fetchPolicy, returnPartialData) {
|
|
830
|
+
if (fetchPolicy === 'no-cache' && returnPartialData) {
|
|
831
|
+
globals.__DEV__ && globals.invariant.warn('Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy.');
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
function toApolloError(result) {
|
|
835
|
+
return utilities.isNonEmptyArray(result.errors)
|
|
836
|
+
? new core.ApolloError({ graphQLErrors: result.errors })
|
|
837
|
+
: result.error;
|
|
838
|
+
}
|
|
839
|
+
function maybeWrapConcastWithCustomPromise(concast, _a) {
|
|
840
|
+
var deferred = _a.deferred;
|
|
841
|
+
if (deferred) {
|
|
842
|
+
return new Promise(function (resolve, reject) {
|
|
843
|
+
var subscription = concast.subscribe({
|
|
844
|
+
next: function (value) {
|
|
845
|
+
resolve(value);
|
|
846
|
+
subscription.unsubscribe();
|
|
847
|
+
},
|
|
848
|
+
error: reject,
|
|
849
|
+
});
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
return concast.promise;
|
|
853
|
+
}
|
|
854
|
+
function useWatchQueryOptions(_a) {
|
|
855
|
+
var query = _a.query, options = _a.options, client = _a.client;
|
|
856
|
+
var defaultOptions = client.defaultOptions.watchQuery;
|
|
857
|
+
var watchQueryOptions = useDeepMemo(function () {
|
|
858
|
+
var errorPolicy = options.errorPolicy, fetchPolicy = options.fetchPolicy, _a = options.suspensePolicy, suspensePolicy = _a === void 0 ? DEFAULT_SUSPENSE_POLICY : _a, variables = options.variables, watchQueryOptions = tslib.__rest(options, ["errorPolicy", "fetchPolicy", "suspensePolicy", "variables"]);
|
|
859
|
+
return tslib.__assign(tslib.__assign({}, watchQueryOptions), { query: query, errorPolicy: errorPolicy || (defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.errorPolicy) || DEFAULT_ERROR_POLICY, fetchPolicy: fetchPolicy || (defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.fetchPolicy) || DEFAULT_FETCH_POLICY, notifyOnNetworkStatusChange: suspensePolicy === 'always', fetchOnFirstSubscribe: false, variables: utilities.compact(tslib.__assign(tslib.__assign({}, defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.variables), variables)) });
|
|
860
|
+
}, [options, query, defaultOptions]);
|
|
861
|
+
if (globals.__DEV__) {
|
|
862
|
+
validateOptions(watchQueryOptions);
|
|
863
|
+
}
|
|
864
|
+
return watchQueryOptions;
|
|
865
|
+
}
|
|
866
|
+
function useIsDeferred(query) {
|
|
867
|
+
return React.useMemo(function () { return utilities.hasDirectives(['defer'], query); }, [query]);
|
|
868
|
+
}
|
|
869
|
+
function useObservableQueryResult(observable) {
|
|
870
|
+
var resultRef = React.useRef();
|
|
871
|
+
var isMountedRef = React.useRef(false);
|
|
872
|
+
if (!resultRef.current) {
|
|
873
|
+
resultRef.current = observable.getCurrentResult();
|
|
874
|
+
}
|
|
875
|
+
useIsomorphicLayoutEffect(function () {
|
|
876
|
+
isMountedRef.current = true;
|
|
877
|
+
return function () {
|
|
878
|
+
isMountedRef.current = false;
|
|
879
|
+
};
|
|
880
|
+
}, []);
|
|
881
|
+
return useSyncExternalStore(React.useCallback(function (forceUpdate) {
|
|
882
|
+
function handleUpdate() {
|
|
883
|
+
var previousResult = resultRef.current;
|
|
884
|
+
var result = observable.getCurrentResult();
|
|
885
|
+
if (previousResult.loading === result.loading &&
|
|
886
|
+
previousResult.networkStatus === result.networkStatus &&
|
|
887
|
+
equality.equal(previousResult.data, result.data)) {
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
resultRef.current = result;
|
|
891
|
+
if (isMountedRef.current) {
|
|
892
|
+
forceUpdate();
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
var subscription = observable.subscribe({
|
|
896
|
+
next: handleUpdate,
|
|
897
|
+
error: handleUpdate,
|
|
898
|
+
});
|
|
899
|
+
return function () {
|
|
900
|
+
subscription.unsubscribe();
|
|
901
|
+
};
|
|
902
|
+
}, [observable]), function () { return resultRef.current; }, function () { return resultRef.current; });
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
exports.useApolloClient = useApolloClient;
|
|
906
|
+
exports.useFragment_experimental = useFragment_experimental;
|
|
907
|
+
exports.useLazyQuery = useLazyQuery;
|
|
908
|
+
exports.useMutation = useMutation;
|
|
909
|
+
exports.useQuery = useQuery;
|
|
910
|
+
exports.useReactiveVar = useReactiveVar;
|
|
911
|
+
exports.useSubscription = useSubscription;
|
|
912
|
+
exports.useSuspenseQuery_experimental = useSuspenseQuery_experimental;
|
|
913
|
+
//# sourceMappingURL=hooks.cjs.map
|