@apollo/client 3.8.0-alpha.9 → 3.8.0-beta.0
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/apollo-client.cjs +1030 -673
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +35 -31
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +35 -31
- package/cache/core/cache.d.ts +5 -4
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js +1 -0
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +2 -2
- package/cache/core/types/Cache.d.ts.map +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +4 -4
- package/cache/core/types/DataProxy.d.ts.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.d.ts +3 -3
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +5 -5
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +2 -2
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts.map +1 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +6 -5
- package/cache/inmemory/helpers.d.ts.map +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +9 -7
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +14 -15
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.d.ts +1 -1
- package/cache/inmemory/key-extractor.d.ts.map +1 -1
- package/cache/inmemory/key-extractor.js +2 -2
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/policies.d.ts +7 -6
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +6 -6
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.d.ts.map +1 -1
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +6 -6
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +10 -5
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +6 -6
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +6 -6
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +7 -8
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/config/jest/setup.d.ts +1 -0
- package/config/jest/setup.d.ts.map +1 -1
- package/config/jest/setup.js +3 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +13 -10
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +18 -16
- package/core/ApolloClient.js.map +1 -1
- package/core/DocumentTransform.d.ts +24 -0
- package/core/DocumentTransform.d.ts.map +1 -0
- package/core/DocumentTransform.js +68 -0
- package/core/DocumentTransform.js.map +1 -0
- package/core/LocalState.d.ts +7 -9
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +6 -10
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +11 -8
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +48 -28
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +9 -9
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +15 -11
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +115 -108
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +332 -172
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +332 -172
- package/core/equalByQuery.d.ts +4 -0
- package/core/equalByQuery.d.ts.map +1 -0
- package/{react/hooks/compareResults.js → core/equalByQuery.js} +14 -10
- package/core/equalByQuery.js.map +1 -0
- package/core/index.d.ts +2 -1
- package/core/index.d.ts.map +1 -1
- package/core/index.js +2 -1
- package/core/index.js.map +1 -1
- package/core/networkStatus.d.ts +1 -0
- package/core/networkStatus.d.ts.map +1 -1
- package/core/networkStatus.js +3 -0
- package/core/networkStatus.js.map +1 -1
- package/core/types.d.ts +14 -14
- package/core/types.d.ts.map +1 -1
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +6 -7
- package/core/watchQueryOptions.d.ts.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +642 -0
- package/dev/dev.cjs.map +1 -0
- package/dev/dev.cjs.native.js +642 -0
- package/dev/index.d.ts +4 -0
- package/dev/index.d.ts.map +1 -0
- package/dev/index.js +4 -0
- package/dev/index.js.map +1 -0
- package/dev/loadDevMessages.d.ts +2 -0
- package/dev/loadDevMessages.d.ts.map +1 -0
- package/dev/loadDevMessages.js +6 -0
- package/dev/loadDevMessages.js.map +1 -0
- package/dev/loadErrorMessageHandler.d.ts +3 -0
- package/dev/loadErrorMessageHandler.d.ts.map +1 -0
- package/dev/loadErrorMessageHandler.js +26 -0
- package/dev/loadErrorMessageHandler.js.map +1 -0
- package/dev/loadErrorMessages.d.ts +2 -0
- package/dev/loadErrorMessages.d.ts.map +1 -0
- package/dev/loadErrorMessages.js +6 -0
- package/dev/loadErrorMessages.js.map +1 -0
- package/dev/package.json +8 -0
- package/errors/errors.cjs +17 -17
- package/errors/errors.cjs.map +1 -1
- package/errors/errors.cjs.native.js +17 -17
- package/errors/index.d.ts +26 -10
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +17 -19
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.d.ts +13 -0
- package/invariantErrorCodes.d.ts.map +1 -0
- package/invariantErrorCodes.js +331 -144
- package/invariantErrorCodes.js.map +1 -0
- package/link/batch/batchLink.d.ts +4 -3
- package/link/batch/batchLink.d.ts.map +1 -1
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.d.ts +1 -1
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch-http/batch-http.cjs +23 -2
- package/link/batch-http/batch-http.cjs.map +1 -1
- package/link/batch-http/batch-http.cjs.native.js +23 -2
- package/link/batch-http/batchHttpLink.d.ts +3 -2
- package/link/batch-http/batchHttpLink.d.ts.map +1 -1
- package/link/batch-http/batchHttpLink.js +7 -2
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/context/index.d.ts +3 -2
- package/link/context/index.d.ts.map +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.d.ts +3 -2
- package/link/core/ApolloLink.d.ts.map +1 -1
- package/link/core/ApolloLink.js +3 -13
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs +2 -12
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -12
- package/link/core/types.d.ts +8 -3
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +4 -3
- package/link/error/index.d.ts.map +1 -1
- package/link/error/index.js.map +1 -1
- package/link/http/HttpLink.d.ts +3 -2
- package/link/http/HttpLink.d.ts.map +1 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.js +2 -2
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.d.ts +1 -1
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +21 -20
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +73 -43
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +73 -43
- package/link/http/iterators/nodeStream.d.ts +1 -1
- package/link/http/iterators/nodeStream.d.ts.map +1 -1
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js +47 -26
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/responseIterator.d.ts +1 -1
- package/link/http/responseIterator.d.ts.map +1 -1
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/rewriteURIForGET.d.ts +1 -1
- package/link/http/rewriteURIForGET.d.ts.map +1 -1
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +3 -2
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.d.ts +1 -1
- package/link/http/selectURI.d.ts.map +1 -1
- package/link/http/selectURI.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.d.ts.map +1 -1
- package/link/http/serializeFetchParameter.js +2 -2
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.d.ts +4 -3
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +16 -20
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs +15 -19
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +15 -19
- package/link/remove-typename/index.d.ts +2 -0
- package/link/remove-typename/index.d.ts.map +1 -0
- package/link/remove-typename/index.js +2 -0
- package/link/remove-typename/index.js.map +1 -0
- package/link/remove-typename/package.json +8 -0
- package/link/remove-typename/remove-typename.cjs +82 -0
- package/link/remove-typename/remove-typename.cjs.map +1 -0
- package/link/remove-typename/remove-typename.cjs.native.js +82 -0
- package/link/remove-typename/removeTypenameFromVariables.d.ts +11 -0
- package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -0
- package/link/remove-typename/removeTypenameFromVariables.js +74 -0
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -0
- package/link/retry/delayFunction.d.ts +1 -1
- package/link/retry/delayFunction.d.ts.map +1 -1
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/retryFunction.d.ts +1 -1
- package/link/retry/retryFunction.d.ts.map +1 -1
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.d.ts +4 -3
- package/link/retry/retryLink.d.ts.map +1 -1
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +3 -2
- package/link/schema/index.d.ts.map +1 -1
- package/link/schema/index.js.map +1 -1
- package/link/subscriptions/index.d.ts +2 -1
- package/link/subscriptions/index.d.ts.map +1 -1
- package/link/subscriptions/index.js +8 -3
- package/link/subscriptions/index.js.map +1 -1
- package/link/subscriptions/subscriptions.cjs +8 -3
- package/link/subscriptions/subscriptions.cjs.map +1 -1
- package/link/subscriptions/subscriptions.cjs.native.js +8 -3
- package/link/utils/createOperation.d.ts +1 -1
- package/link/utils/createOperation.d.ts.map +1 -1
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/filterOperationVariables.d.ts +5 -0
- package/link/utils/filterOperationVariables.d.ts.map +1 -0
- package/link/utils/filterOperationVariables.js +18 -0
- package/link/utils/filterOperationVariables.js.map +1 -0
- package/link/utils/index.d.ts +1 -0
- package/link/utils/index.d.ts.map +1 -1
- package/link/utils/index.js +1 -0
- package/link/utils/index.js.map +1 -1
- package/link/utils/throwServerError.d.ts +1 -1
- package/link/utils/throwServerError.d.ts.map +1 -1
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.d.ts +1 -1
- package/link/utils/toPromise.d.ts.map +1 -1
- package/link/utils/toPromise.js +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/transformOperation.d.ts +1 -1
- package/link/utils/transformOperation.d.ts.map +1 -1
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/utils.cjs +20 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +20 -2
- package/link/utils/validateOperation.d.ts +1 -1
- package/link/utils/validateOperation.d.ts.map +1 -1
- package/link/utils/validateOperation.js +2 -2
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.d.ts +5 -3
- package/link/ws/index.d.ts.map +1 -1
- package/link/ws/index.js.map +1 -1
- package/package.json +36 -32
- package/react/cache/QueryReference.d.ts +34 -0
- package/react/cache/QueryReference.d.ts.map +1 -0
- package/react/cache/QueryReference.js +107 -0
- package/react/cache/QueryReference.js.map +1 -0
- package/react/cache/SuspenseCache.d.ts +10 -13
- package/react/cache/SuspenseCache.d.ts.map +1 -1
- package/react/cache/SuspenseCache.js +18 -41
- package/react/cache/SuspenseCache.js.map +1 -1
- package/react/cache/types.d.ts +2 -0
- package/react/cache/types.d.ts.map +1 -0
- package/react/cache/types.js +2 -0
- package/react/cache/types.js.map +1 -0
- package/react/components/Mutation.d.ts +2 -2
- package/react/components/Mutation.d.ts.map +1 -1
- package/react/components/Mutation.js.map +1 -1
- package/react/components/Query.d.ts +2 -2
- package/react/components/Query.d.ts.map +1 -1
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.d.ts +2 -2
- package/react/components/Subscription.d.ts.map +1 -1
- package/react/components/Subscription.js.map +1 -1
- package/react/components/types.d.ts +4 -4
- package/react/components/types.d.ts.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.d.ts +1 -1
- package/react/context/ApolloConsumer.d.ts.map +1 -1
- package/react/context/ApolloConsumer.js +2 -3
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +10 -3
- package/react/context/ApolloContext.d.ts.map +1 -1
- package/react/context/ApolloContext.js +10 -8
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +2 -2
- package/react/context/ApolloProvider.d.ts.map +1 -1
- package/react/context/ApolloProvider.js +8 -13
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/context.cjs +18 -22
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +18 -22
- package/react/context/index.d.ts +1 -1
- package/react/context/index.d.ts.map +1 -1
- package/react/context/index.js +1 -1
- package/react/context/index.js.map +1 -1
- package/react/hoc/graphql.d.ts +3 -3
- package/react/hoc/graphql.d.ts.map +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +2 -2
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +2 -3
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/hoc.cjs +2 -4
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -4
- package/react/hoc/mutation-hoc.d.ts +4 -4
- package/react/hoc/mutation-hoc.d.ts.map +1 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.d.ts +2 -2
- package/react/hoc/query-hoc.d.ts.map +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.d.ts +2 -2
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/types.d.ts +4 -4
- package/react/hoc/types.d.ts.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.d.ts +1 -1
- package/react/hoc/withApollo.d.ts.map +1 -1
- package/react/hoc/withApollo.js +2 -3
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs +223 -219
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +223 -219
- package/react/hooks/index.d.ts +2 -1
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js +2 -1
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/internal/__use.d.ts +4 -0
- package/react/hooks/internal/__use.d.ts.map +1 -0
- package/react/hooks/internal/__use.js +17 -0
- package/react/hooks/internal/__use.js.map +1 -0
- package/react/hooks/internal/index.d.ts +2 -0
- package/react/hooks/internal/index.d.ts.map +1 -1
- package/react/hooks/internal/index.js +2 -0
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts.map +1 -1
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +2 -2
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +2 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +1 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +11 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +1 -0
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.d.ts.map +1 -1
- package/react/hooks/useApolloClient.js +2 -4
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +18 -0
- package/react/hooks/useBackgroundQuery.d.ts.map +1 -0
- package/react/hooks/useBackgroundQuery.js +69 -0
- package/react/hooks/useBackgroundQuery.js.map +1 -0
- package/react/hooks/useFragment.d.ts +14 -9
- package/react/hooks/useFragment.d.ts.map +1 -1
- package/react/hooks/useFragment.js +2 -2
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +4 -4
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js +13 -22
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +4 -4
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +6 -6
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +29 -28
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -1
- package/react/hooks/useReactiveVar.d.ts.map +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +4 -4
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +27 -19
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseCache.d.ts +1 -1
- package/react/hooks/useSuspenseCache.d.ts.map +1 -1
- package/react/hooks/useSuspenseCache.js +2 -4
- package/react/hooks/useSuspenseCache.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +39 -7
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +68 -149
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.d.ts.map +1 -1
- package/react/index.js +1 -1
- package/react/index.js.map +1 -1
- package/react/parser/index.d.ts +1 -1
- package/react/parser/index.d.ts.map +1 -1
- package/react/parser/index.js +20 -17
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +19 -16
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +19 -16
- package/react/react.cjs +116 -35
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +116 -35
- package/react/ssr/RenderPromises.d.ts +2 -2
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/renderToStringWithData.d.ts +1 -1
- package/react/ssr/renderToStringWithData.d.ts.map +1 -1
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/types/types.d.ts +10 -13
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +1 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +1 -1
- package/testing/core/mocking/mockClient.d.ts +2 -2
- package/testing/core/mocking/mockClient.d.ts.map +1 -1
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +2 -1
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +3 -3
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -2
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
- package/testing/core/mocking/mockWatchQuery.js.map +1 -1
- package/testing/core/observableToPromise.d.ts +2 -2
- package/testing/core/observableToPromise.d.ts.map +1 -1
- package/testing/core/observableToPromise.js.map +1 -1
- package/testing/core/subscribeAndCount.d.ts +1 -1
- package/testing/core/subscribeAndCount.d.ts.map +1 -1
- package/testing/core/subscribeAndCount.js.map +1 -1
- package/testing/matchers/index.d.ts +2 -0
- package/testing/matchers/index.d.ts.map +1 -0
- package/testing/matchers/index.js +6 -0
- package/testing/matchers/index.js.map +1 -0
- package/testing/matchers/toMatchDocument.d.ts +4 -0
- package/testing/matchers/toMatchDocument.d.ts.map +1 -0
- package/testing/matchers/toMatchDocument.js +34 -0
- package/testing/matchers/toMatchDocument.js.map +1 -0
- package/testing/react/MockedProvider.d.ts +8 -7
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +7 -6
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +7 -51
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +7 -51
- package/utilities/common/compact.d.ts +1 -1
- package/utilities/common/compact.d.ts.map +1 -1
- package/utilities/common/compact.js.map +1 -1
- package/utilities/common/errorHandling.d.ts +1 -1
- package/utilities/common/errorHandling.d.ts.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/incrementalResult.d.ts +2 -1
- package/utilities/common/incrementalResult.d.ts.map +1 -1
- package/utilities/common/incrementalResult.js +4 -0
- package/utilities/common/incrementalResult.js.map +1 -1
- package/utilities/common/mergeOptions.d.ts +1 -1
- package/utilities/common/mergeOptions.d.ts.map +1 -1
- package/utilities/common/mergeOptions.js +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/common/objects.d.ts +1 -0
- package/utilities/common/objects.d.ts.map +1 -1
- package/utilities/common/objects.js +6 -0
- package/utilities/common/objects.js.map +1 -1
- package/utilities/common/omitDeep.d.ts +3 -0
- package/utilities/common/omitDeep.d.ts.map +1 -0
- package/utilities/common/omitDeep.js +41 -0
- package/utilities/common/omitDeep.js.map +1 -0
- package/utilities/common/responseIterator.d.ts +2 -2
- package/utilities/common/responseIterator.d.ts.map +1 -1
- package/utilities/common/responseIterator.js.map +1 -1
- package/utilities/common/stringifyForDisplay.d.ts +1 -1
- package/utilities/common/stringifyForDisplay.d.ts.map +1 -1
- package/utilities/common/stringifyForDisplay.js +3 -2
- package/utilities/common/stringifyForDisplay.js.map +1 -1
- package/utilities/common/stripTypename.d.ts +2 -0
- package/utilities/common/stripTypename.d.ts.map +1 -0
- package/utilities/common/stripTypename.js +5 -0
- package/utilities/common/stripTypename.js.map +1 -0
- package/utilities/globals/global.d.ts +6 -3
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/globals.cjs +67 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +67 -1
- package/utilities/globals/index.d.ts +2 -2
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +2 -2
- package/utilities/globals/index.js.map +1 -1
- package/utilities/globals/invariantWrappers.d.ts +24 -0
- package/utilities/globals/invariantWrappers.d.ts.map +1 -0
- package/utilities/globals/invariantWrappers.js +53 -0
- package/utilities/globals/invariantWrappers.js.map +1 -0
- package/utilities/graphql/directives.d.ts +1 -1
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +6 -7
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts +1 -1
- package/utilities/graphql/fragments.d.ts.map +1 -1
- package/utilities/graphql/fragments.js +8 -5
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts +1 -1
- package/utilities/graphql/getFromAST.d.ts.map +1 -1
- package/utilities/graphql/getFromAST.js +9 -9
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/operations.d.ts +5 -0
- package/utilities/graphql/operations.d.ts.map +1 -0
- package/utilities/graphql/operations.js +16 -0
- package/utilities/graphql/operations.js.map +1 -0
- package/utilities/graphql/storeUtils.d.ts +2 -2
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +16 -7
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts +1 -1
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +30 -21
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +6 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +4 -0
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.d.ts +2 -1
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/Observable.d.ts +2 -1
- package/utilities/observables/Observable.d.ts.map +1 -1
- package/utilities/observables/Observable.js +1 -1
- package/utilities/observables/Observable.js.map +1 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.d.ts +1 -1
- package/utilities/observables/iteration.d.ts.map +1 -1
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/policies/pagination.d.ts +1 -1
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/promises/decoration.d.ts +17 -0
- package/utilities/promises/decoration.d.ts.map +1 -0
- package/utilities/promises/decoration.js +37 -0
- package/utilities/promises/decoration.js.map +1 -0
- package/utilities/types/DeepOmit.d.ts +10 -0
- package/utilities/types/DeepOmit.d.ts.map +1 -0
- package/utilities/types/DeepOmit.js +2 -0
- package/utilities/types/DeepOmit.js.map +1 -0
- package/utilities/types/DeepPartial.d.ts +12 -0
- package/utilities/types/DeepPartial.d.ts.map +1 -0
- package/utilities/types/DeepPartial.js +2 -0
- package/utilities/types/DeepPartial.js.map +1 -0
- package/utilities/types/Primitive.d.ts +2 -0
- package/utilities/types/Primitive.d.ts.map +1 -0
- package/utilities/types/Primitive.js +2 -0
- package/utilities/types/Primitive.js.map +1 -0
- package/utilities/utilities.cjs +181 -45
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +181 -45
- package/version.js +1 -1
- package/cache/inmemory/__mocks__/optimism.d.ts +0 -2
- package/cache/inmemory/__mocks__/optimism.d.ts.map +0 -1
- package/cache/inmemory/__mocks__/optimism.js +0 -14
- package/cache/inmemory/__mocks__/optimism.js.map +0 -1
- package/react/hooks/compareResults.d.ts +0 -3
- package/react/hooks/compareResults.d.ts.map +0 -1
- package/react/hooks/compareResults.js.map +0 -1
package/react/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,gBAAgB,GAKjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,YAAY,GAEb,MAAM,sBAAsB,CAAC","sourcesContent":["import '../../utilities/globals';\n\nexport * from './useApolloClient';\nexport * from './useLazyQuery';\nexport * from './useMutation';\nexport { useQuery } from './useQuery';\nexport * from './useSubscription';\nexport * from './useReactiveVar';\nexport * from './useFragment';\nexport {\n useSuspenseQuery,\n UseSuspenseQueryResult,\n FetchMoreFunction,\n RefetchFunction,\n SubscribeToMoreFunction,\n} from './useSuspenseQuery';\nexport {\n useBackgroundQuery,\n useReadQuery,\n UseBackgroundQueryResult,\n} from './useBackgroundQuery';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__use.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/__use.ts"],"names":[],"mappings":"AAGA,KAAK,GAAG,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AASzC,eAAO,MAAM,KAAK,KAaf,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { wrapPromiseWithState } from "../../../utilities/index.js";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var useKey = 'use';
|
|
4
|
+
var realHook = React[useKey];
|
|
5
|
+
export var __use = realHook ||
|
|
6
|
+
function __use(promise) {
|
|
7
|
+
var statefulPromise = wrapPromiseWithState(promise);
|
|
8
|
+
switch (statefulPromise.status) {
|
|
9
|
+
case 'pending':
|
|
10
|
+
throw statefulPromise;
|
|
11
|
+
case 'rejected':
|
|
12
|
+
throw statefulPromise.reason;
|
|
13
|
+
case 'fulfilled':
|
|
14
|
+
return statefulPromise.value;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=__use.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__use.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/__use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,IAAM,MAAM,GAAG,KAA2B,CAAC;AAC3C,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAoB,CAAC;AAIlD,MAAM,CAAC,IAAM,KAAK,GAChB,QAAQ;IACR,SAAS,KAAK,CAAS,OAAwB;QAC7C,IAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAEtD,QAAQ,eAAe,CAAC,MAAM,EAAE;YAC9B,KAAK,SAAS;gBACZ,MAAM,eAAe,CAAC;YACxB,KAAK,UAAU;gBACb,MAAM,eAAe,CAAC,MAAM,CAAC;YAC/B,KAAK,WAAW;gBACd,OAAO,eAAe,CAAC,KAAK,CAAC;SAChC;IACH,CAAC,CAAC","sourcesContent":["import { wrapPromiseWithState } from '../../../utilities';\nimport React from 'react';\n\ntype Use = <T>(promise: Promise<T>) => T;\n// Prevent webpack from complaining about our feature detection of the\n// use property of the React namespace, which is expected not\n// to exist when using current stable versions, and that's fine.\nconst useKey = 'use' as keyof typeof React;\nconst realHook = React[useKey] as Use | undefined;\n\n// This is named with two underscores to allow this hook to evade typical rules of\n// hooks (i.e. it can be used conditionally)\nexport const __use =\n realHook ||\n function __use<TValue>(promise: Promise<TValue>) {\n const statefulPromise = wrapPromiseWithState(promise);\n\n switch (statefulPromise.status) {\n case 'pending':\n throw statefulPromise;\n case 'rejected':\n throw statefulPromise.reason;\n case 'fulfilled':\n return statefulPromise.value;\n }\n };\n"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { useDeepMemo } from './useDeepMemo';
|
|
2
2
|
export { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
|
|
3
|
+
export { useStrictModeSafeCleanupEffect } from './useStrictModeSafeCleanupEffect';
|
|
4
|
+
export { __use } from './__use';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { useDeepMemo } from "./useDeepMemo.js";
|
|
2
2
|
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
|
|
3
|
+
export { useStrictModeSafeCleanupEffect } from "./useStrictModeSafeCleanupEffect.js";
|
|
4
|
+
export { __use } from "./__use.js";
|
|
3
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["// These hooks are used internally and are not exported publicly by the library\nexport { useDeepMemo } from './useDeepMemo';\nexport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["// These hooks are used internally and are not exported publicly by the library\nexport { useDeepMemo } from './useDeepMemo';\nexport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\nexport { useStrictModeSafeCleanupEffect } from './useStrictModeSafeCleanupEffect';\nexport { __use } from './__use';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeepMemo.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useDeepMemo.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useDeepMemo.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useDeepMemo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,wBAAgB,WAAW,CAAC,MAAM,EAChC,MAAM,EAAE,MAAM,MAAM,EACpB,IAAI,EAAE,cAAc,UASrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeepMemo.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useDeepMemo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDeepMemo.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useDeepMemo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,MAAM,UAAU,WAAW,CACzB,MAAoB,EACpB,IAAoB;IAEpB,IAAM,GAAG,GAAG,MAAM,EAA2C,CAAC;IAE9D,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;QAClD,GAAG,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE,CAAC;KACzC;IAED,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC;AAC3B,CAAC","sourcesContent":["import type { DependencyList } from 'react';\nimport { useRef } from 'react';\nimport { equal } from '@wry/equality';\n\nexport function useDeepMemo<TValue>(\n memoFn: () => TValue,\n deps: DependencyList\n) {\n const ref = useRef<{ deps: DependencyList; value: TValue }>();\n\n if (!ref.current || !equal(ref.current.deps, deps)) {\n ref.current = { value: memoFn(), deps };\n }\n\n return ref.current.value;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAa,MAAM,OAAO,CAAC;AAQnD,eAAO,MAAM,yBAAyB,wBAEzB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useLayoutEffect, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export var useIsomorphicLayoutEffect =
|
|
2
|
+
import { canUseDOM } from "../../../utilities/index.js";
|
|
3
|
+
export var useIsomorphicLayoutEffect = canUseDOM
|
|
4
4
|
? useLayoutEffect
|
|
5
5
|
: useEffect;
|
|
6
6
|
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsomorphicLayoutEffect.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useIsomorphicLayoutEffect.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,MAAM,CAAC,IAAM,yBAAyB,GAAG,SAAS;IAChD,CAAC,CAAC,eAAe;IACjB,CAAC,CAAC,SAAS,CAAC","sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\nimport { canUseDOM } from '../../../utilities';\n\n// use canUseDOM here instead of canUseLayoutEffect because we want to be able\n// to use useLayoutEffect in our jest tests. useLayoutEffect seems to work fine\n// in useSuspenseQuery tests, but to honor the original comment about the\n// warnings for useSyncExternalStore implementation, canUseLayoutEffect is left\n// alone.\nexport const useIsomorphicLayoutEffect = canUseDOM\n ? useLayoutEffect\n : useEffect;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStrictModeSafeCleanupEffect.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useStrictModeSafeCleanupEffect.ts"],"names":[],"mappings":"AAEA,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,IAAI,QAUjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export function useStrictModeSafeCleanupEffect(cleanup) {
|
|
3
|
+
var timeout;
|
|
4
|
+
useEffect(function () {
|
|
5
|
+
clearTimeout(timeout);
|
|
6
|
+
return function () {
|
|
7
|
+
timeout = setTimeout(cleanup);
|
|
8
|
+
};
|
|
9
|
+
}, []);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=useStrictModeSafeCleanupEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStrictModeSafeCleanupEffect.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useStrictModeSafeCleanupEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,UAAU,8BAA8B,CAAC,OAAmB;IAChE,IAAI,OAAuB,CAAC;IAE5B,SAAS,CAAC;QACR,YAAY,CAAC,OAAO,CAAC,CAAC;QAEtB,OAAO;YACL,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["import { useEffect } from 'react';\n\nexport function useStrictModeSafeCleanupEffect(cleanup: () => void) {\n let timeout: NodeJS.Timeout;\n\n useEffect(() => {\n clearTimeout(timeout);\n\n return () => {\n timeout = setTimeout(cleanup);\n };\n }, []);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useApolloClient.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"useApolloClient.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,wBAAgB,eAAe,CAC7B,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,GAC9B,YAAY,CAAC,MAAM,CAAC,CAWtB"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { invariant
|
|
1
|
+
import { invariant } from "../../utilities/globals/index.js";
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { getApolloContext } from "../context/index.js";
|
|
4
4
|
export function useApolloClient(override) {
|
|
5
5
|
var context = useContext(getApolloContext());
|
|
6
6
|
var client = override || context.client;
|
|
7
|
-
|
|
8
|
-
'Wrap the root component in an <ApolloProvider>, or pass an ApolloClient ' +
|
|
9
|
-
'instance in via options.') : invariant(!!client, 32);
|
|
7
|
+
invariant(!!client, 49);
|
|
10
8
|
return client;
|
|
11
9
|
}
|
|
12
10
|
//# sourceMappingURL=useApolloClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useApolloClient.js","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,UAAU,eAAe,CAC7B,QAA+B;IAE/B,IAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC/C,IAAM,MAAM,GAAG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAC1C,SAAS,CACP,CAAC,CAAC,MAAM,EACR,oEAAoE;QACpE,0EAA0E;QAC1E,0BAA0B,CAC3B,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { invariant } from '../../utilities/globals';\nimport { useContext } from 'react';\nimport { ApolloClient } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useApolloClient(\n override?: ApolloClient<object>,\n): ApolloClient<object> {\n const context = useContext(getApolloContext());\n const client = override || context.client;\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as an option. ' +\n 'Wrap the root component in an <ApolloProvider>, or pass an ApolloClient ' +\n 'instance in via options.',\n );\n\n return client;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"useApolloClient.js","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,UAAU,eAAe,CAC7B,QAA+B;IAE/B,IAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC/C,IAAM,MAAM,GAAG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAC1C,SAAS,CACP,CAAC,CAAC,MAAM,EACR,oEAAoE;QACpE,0EAA0E;QAC1E,0BAA0B,CAC3B,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { invariant } from '../../utilities/globals';\nimport { useContext } from 'react';\nimport type { ApolloClient } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useApolloClient(\n override?: ApolloClient<object>,\n): ApolloClient<object> {\n const context = useContext(getApolloContext());\n const client = override || context.client;\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as an option. ' +\n 'Wrap the root component in an <ApolloProvider>, or pass an ApolloClient ' +\n 'instance in via options.',\n );\n\n return client;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DocumentNode, OperationVariables, TypedDocumentNode } from '../../core';
|
|
2
|
+
import type { QueryReference } from '../cache/QueryReference';
|
|
3
|
+
import type { SuspenseQueryHookOptions, ObservableQueryFields } from '../types/types';
|
|
4
|
+
import type { FetchMoreFunction } from './useSuspenseQuery';
|
|
5
|
+
export type UseBackgroundQueryResult<TData = any, TVariables extends OperationVariables = OperationVariables> = [
|
|
6
|
+
QueryReference<TData>,
|
|
7
|
+
{
|
|
8
|
+
fetchMore: FetchMoreFunction<TData, TVariables>;
|
|
9
|
+
refetch: ObservableQueryFields<TData, TVariables>['refetch'];
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
export declare function useBackgroundQuery<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: Omit<SuspenseQueryHookOptions<TData, TVariables>, 'returnPartialData' | 'refetchWritePolicy'>): UseBackgroundQueryResult<TData>;
|
|
13
|
+
export declare function useReadQuery<TData>(queryRef: QueryReference<TData>): {
|
|
14
|
+
data: TData;
|
|
15
|
+
networkStatus: import("../../core").NetworkStatus;
|
|
16
|
+
error: import("../../errors").ApolloError | undefined;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useBackgroundQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBackgroundQuery.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useBackgroundQuery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAQxB,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,oBAAoB,CAAC;AAI7E,MAAM,MAAM,wBAAwB,CAClC,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,IACxD;IACF,cAAc,CAAC,KAAK,CAAC;IACrB;QACE,SAAS,EAAE,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAChD,OAAO,EAAE,qBAAqB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;KAC9D;CACF,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,EAE1D,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC1D,OAAO,GAAE,IAAI,CACX,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC3C,mBAAmB,GAAG,oBAAoB,CACrB,GACtB,wBAAwB,CAAC,KAAK,CAAC,CA0DjC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC;;;;EAiClE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useEffect, useState, useMemo, useCallback } from 'react';
|
|
2
|
+
import { useApolloClient } from "./useApolloClient.js";
|
|
3
|
+
import { __use } from "./internal/index.js";
|
|
4
|
+
import { useSuspenseCache } from "./useSuspenseCache.js";
|
|
5
|
+
import { toApolloError, useTrackedQueryRefs, useWatchQueryOptions, } from "./useSuspenseQuery.js";
|
|
6
|
+
import { canonicalStringify } from "../../cache/index.js";
|
|
7
|
+
import { invariant } from "../../utilities/globals/index.js";
|
|
8
|
+
export function useBackgroundQuery(query, options) {
|
|
9
|
+
if (options === void 0) { options = Object.create(null); }
|
|
10
|
+
var suspenseCache = useSuspenseCache(options.suspenseCache);
|
|
11
|
+
var client = useApolloClient(options.client);
|
|
12
|
+
var watchQueryOptions = useWatchQueryOptions({ query: query, options: options });
|
|
13
|
+
var variables = watchQueryOptions.variables;
|
|
14
|
+
var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;
|
|
15
|
+
var cacheKey = [client, query, canonicalStringify(variables)].concat(queryKey);
|
|
16
|
+
var queryRef = suspenseCache.getQueryRef(cacheKey, function () {
|
|
17
|
+
return client.watchQuery(watchQueryOptions);
|
|
18
|
+
});
|
|
19
|
+
var _b = useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
|
|
20
|
+
useTrackedQueryRefs(queryRef);
|
|
21
|
+
var fetchMore = useCallback(function (options) {
|
|
22
|
+
var promise = queryRef.fetchMore(options);
|
|
23
|
+
setPromiseCache(function (promiseCache) {
|
|
24
|
+
return new Map(promiseCache).set(queryRef.key, promise);
|
|
25
|
+
});
|
|
26
|
+
return promise;
|
|
27
|
+
}, [queryRef]);
|
|
28
|
+
var refetch = useCallback(function (variables) {
|
|
29
|
+
var promise = queryRef.refetch(variables);
|
|
30
|
+
setPromiseCache(function (promiseCache) {
|
|
31
|
+
return new Map(promiseCache).set(queryRef.key, promise);
|
|
32
|
+
});
|
|
33
|
+
return promise;
|
|
34
|
+
}, [queryRef]);
|
|
35
|
+
queryRef.promiseCache = promiseCache;
|
|
36
|
+
return useMemo(function () {
|
|
37
|
+
return [
|
|
38
|
+
queryRef,
|
|
39
|
+
{
|
|
40
|
+
fetchMore: fetchMore,
|
|
41
|
+
refetch: refetch,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
}, [queryRef, fetchMore, refetch]);
|
|
45
|
+
}
|
|
46
|
+
export function useReadQuery(queryRef) {
|
|
47
|
+
var _a = useState(0), forceUpdate = _a[1];
|
|
48
|
+
invariant(queryRef.promiseCache, 50);
|
|
49
|
+
var promise = queryRef.promiseCache.get(queryRef.key);
|
|
50
|
+
if (!promise) {
|
|
51
|
+
promise = queryRef.promise;
|
|
52
|
+
queryRef.promiseCache.set(queryRef.key, promise);
|
|
53
|
+
}
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
return queryRef.listen(function (promise) {
|
|
56
|
+
queryRef.promiseCache.set(queryRef.key, promise);
|
|
57
|
+
forceUpdate(function (prevState) { return prevState + 1; });
|
|
58
|
+
});
|
|
59
|
+
}, [queryRef]);
|
|
60
|
+
var result = __use(promise);
|
|
61
|
+
return useMemo(function () {
|
|
62
|
+
return {
|
|
63
|
+
data: result.data,
|
|
64
|
+
networkStatus: result.networkStatus,
|
|
65
|
+
error: toApolloError(result),
|
|
66
|
+
};
|
|
67
|
+
}, [result]);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=useBackgroundQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBackgroundQuery.js","sourceRoot":"","sources":["../../../src/react/hooks/useBackgroundQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAMlE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAapD,MAAM,UAAU,kBAAkB,CAIhC,KAA0D,EAC1D,OAGuB;IAHvB,wBAAA,EAAA,UAGI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAEvB,IAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9D,IAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAM,iBAAiB,GAAG,oBAAoB,CAAC,EAAE,KAAK,OAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;IAC3D,IAAA,SAAS,GAAK,iBAAiB,UAAtB,CAAuB;IAChC,IAAA,KAAkB,OAAO,SAAZ,EAAb,QAAQ,mBAAG,EAAE,KAAA,CAAa;IAElC,IAAM,QAAQ,GACZ,CAAC,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAC,SAAS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ationVariables,\n TypedDocumentNode,\n} from '../../core';\nimport { useApolloClient } from './useApolloClient';\nimport type { QueryReference } from '../cache/QueryReference';\nimport type {\n SuspenseQueryHookOptions,\n ObservableQueryFields,\n} from '../types/types';\nimport { __use } from './internal';\nimport { useSuspenseCache } from './useSuspenseCache';\nimport {\n toApolloError,\n useTrackedQueryRefs,\n useWatchQueryOptions,\n} from './useSuspenseQuery';\nimport type { FetchMoreFunction, RefetchFunction } from './useSuspenseQuery';\nimport { canonicalStringify } from '../../cache';\nimport { invariant } from '../../utilities/globals';\n\nexport type UseBackgroundQueryResult<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> = [\n QueryReference<TData>,\n {\n fetchMore: FetchMoreFunction<TData, TVariables>;\n refetch: ObservableQueryFields<TData, TVariables>['refetch'];\n }\n];\n\nexport function useBackgroundQuery<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: Omit<\n SuspenseQueryHookOptions<TData, TVariables>,\n 'returnPartialData' | 'refetchWritePolicy'\n > = Object.create(null)\n): UseBackgroundQueryResult<TData> {\n const suspenseCache = useSuspenseCache(options.suspenseCache);\n const client = useApolloClient(options.client);\n const watchQueryOptions = useWatchQueryOptions({ query, options });\n const { variables } = watchQueryOptions;\n const { queryKey = [] } = options;\n\n const cacheKey = (\n [client, query, canonicalStringify(variables)] as any[]\n ).concat(queryKey);\n\n const queryRef = suspenseCache.getQueryRef(cacheKey, () =>\n client.watchQuery(watchQueryOptions)\n );\n\n const [promiseCache, setPromiseCache] = useState(\n () => new Map([[queryRef.key, queryRef.promise]])\n );\n\n useTrackedQueryRefs(queryRef);\n\n const fetchMore: FetchMoreFunction<TData, TVariables> = useCallback(\n (options) => {\n const promise = queryRef.fetchMore(options);\n\n setPromiseCache((promiseCache) =>\n new Map(promiseCache).set(queryRef.key, promise)\n );\n\n return promise;\n },\n [queryRef]\n );\n\n const refetch: RefetchFunction<TData, TVariables> = useCallback(\n (variables) => {\n const promise = queryRef.refetch(variables);\n\n setPromiseCache((promiseCache) =>\n new Map(promiseCache).set(queryRef.key, promise)\n );\n\n return promise;\n },\n [queryRef]\n );\n\n queryRef.promiseCache = promiseCache;\n\n return useMemo(() => {\n return [\n queryRef,\n {\n fetchMore,\n refetch,\n },\n ];\n }, [queryRef, fetchMore, refetch]);\n}\n\nexport function useReadQuery<TData>(queryRef: QueryReference<TData>) {\n const [, forceUpdate] = useState(0);\n\n invariant(\n queryRef.promiseCache,\n 'It appears that `useReadQuery` was used outside of `useBackgroundQuery`. ' +\n '`useReadQuery` is only supported for use with `useBackgroundQuery`. ' +\n 'Please ensure you are passing the `queryRef` returned from `useBackgroundQuery`.'\n );\n\n let promise = queryRef.promiseCache.get(queryRef.key);\n\n if (!promise) {\n promise = queryRef.promise;\n queryRef.promiseCache.set(queryRef.key, promise);\n }\n\n useEffect(() => {\n return queryRef.listen((promise) => {\n queryRef.promiseCache!.set(queryRef.key, promise);\n forceUpdate((prevState) => prevState + 1);\n });\n }, [queryRef]);\n\n const result = __use(promise);\n\n return useMemo(() => {\n return {\n data: result.data,\n networkStatus: result.networkStatus,\n error: toApolloError(result),\n };\n }, [result]);\n}\n"]}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import type { DeepPartial } from "../../utilities";
|
|
2
|
+
import type { Cache, Reference, StoreObject, MissingTree } from "../../cache";
|
|
3
|
+
import type { OperationVariables } from "../../core";
|
|
4
|
+
import type { NoInfer } from "../types/types";
|
|
5
|
+
export interface UseFragmentOptions<TData, TVars> extends Omit<Cache.DiffOptions<NoInfer<TData>, NoInfer<TVars>>, "id" | "query" | "optimistic" | "previousResult" | "returnPartialData">, Omit<Cache.ReadFragmentOptions<TData, TVars>, "id" | "variables" | "returnPartialData"> {
|
|
5
6
|
from: StoreObject | Reference | string;
|
|
6
7
|
optimistic?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
-
data: TData
|
|
10
|
-
complete:
|
|
9
|
+
export type UseFragmentResult<TData> = {
|
|
10
|
+
data: TData;
|
|
11
|
+
complete: true;
|
|
12
|
+
missing?: never;
|
|
13
|
+
} | {
|
|
14
|
+
data: DeepPartial<TData>;
|
|
15
|
+
complete: false;
|
|
11
16
|
missing?: MissingTree;
|
|
12
|
-
}
|
|
13
|
-
export declare function
|
|
17
|
+
};
|
|
18
|
+
export declare function useFragment<TData = any, TVars = OperationVariables>(options: UseFragmentOptions<TData, TVars>): UseFragmentResult<TData>;
|
|
14
19
|
//# sourceMappingURL=useFragment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFragment.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useFragment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFragment.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useFragment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACZ,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAChD,SAAQ,IAAI,CACV,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAC/C,IAAI,GACJ,OAAO,GACP,YAAY,GACZ,gBAAgB,GAChB,mBAAmB,CACtB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,EAC3C,IAAI,GACJ,WAAW,GACX,mBAAmB,CACtB;IACC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;IAEvC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,iBAAiB,CAAC,KAAK,IAC/B;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,GACD;IACE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEN,wBAAgB,WAAW,CACzB,KAAK,GAAG,GAAG,EACX,KAAK,GAAG,kBAAkB,EAE1B,OAAO,EAAE,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,GACxC,iBAAiB,CAAC,KAAK,CAAC,CA+C1B"}
|
|
@@ -4,10 +4,10 @@ import { equal } from "@wry/equality";
|
|
|
4
4
|
import { mergeDeepArray } from "../../utilities/index.js";
|
|
5
5
|
import { useApolloClient } from "./useApolloClient.js";
|
|
6
6
|
import { useSyncExternalStore } from "./useSyncExternalStore.js";
|
|
7
|
-
export function
|
|
7
|
+
export function useFragment(options) {
|
|
8
8
|
var cache = useApolloClient().cache;
|
|
9
9
|
var fragment = options.fragment, fragmentName = options.fragmentName, from = options.from, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, rest = __rest(options, ["fragment", "fragmentName", "from", "optimistic"]);
|
|
10
|
-
var diffOptions = __assign(__assign({}, rest), { id: typeof from === "string" ? from : cache.identify(from), query: cache["getFragmentDoc"](fragment, fragmentName), optimistic: optimistic });
|
|
10
|
+
var diffOptions = __assign(__assign({}, rest), { returnPartialData: true, id: typeof from === "string" ? from : cache.identify(from), query: cache["getFragmentDoc"](fragment, fragmentName), optimistic: optimistic });
|
|
11
11
|
var resultRef = useRef();
|
|
12
12
|
var latestDiff = cache.diff(diffOptions);
|
|
13
13
|
var getSnapshot = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFragment.js","sourceRoot":"","sources":["../../../src/react/hooks/useFragment.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useFragment.js","sourceRoot":"","sources":["../../../src/react/hooks/useFragment.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAkC9D,MAAM,UAAU,WAAW,CAIzB,OAAyC;IAEjC,IAAA,KAAK,GAAK,eAAe,EAAE,MAAtB,CAAuB;IAGlC,IAAA,QAAQ,GAKN,OAAO,SALD,EACR,YAAY,GAIV,OAAO,aAJG,EACZ,IAAI,GAGF,OAAO,KAHL,EACJ,KAEE,OAAO,WAFQ,EAAjB,UAAU,mBAAG,IAAI,KAAA,EACd,IAAI,UACL,OAAO,EANL,kDAML,CADQ,CACG;IAEZ,IAAM,WAAW,yBACZ,IAAI,KACP,iBAAiB,EAAE,IAAI,EACvB,EAAE,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC1D,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,EACtD,UAAU,YAAA,GACX,CAAC;IAEF,IAAM,SAAS,GAAG,MAAM,EAA4B,CAAC;IACrD,IAAI,UAAU,GAAG,KAAK,CAAC,IAAI,CAAQ,WAAW,CAAC,CAAC;IAGhD,IAAM,WAAW,GAAG;QAClB,IAAM,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;QACpD,OAAO,SAAS,CAAC,OAAO;YACtB,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC;YACtD,CAAC,CAAC,SAAS,CAAC,OAAO;YACnB,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,GAAG,kBAAkB,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,OAAO,oBAAoB,CACzB,UAAC,WAAW;QACV,OAAO,KAAK,CAAC,KAAK,uBACb,WAAW,KACd,SAAS,EAAE,IAAI,EACf,QAAQ,YAAC,IAAI;gBACX,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE;oBAC5B,SAAS,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC;oBACtD,WAAW,EAAE,CAAC;iBACf;YACH,CAAC,IACD,CAAC;IACL,CAAC,EACD,WAAW,EACX,WAAW,CACZ,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CACnB,IAA6B;IAE7B,IAAM,MAAM,GAAG;QACb,IAAI,EAAE,IAAI,CAAC,MAAO;QAClB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ;KACE,CAAC;IAE9B,IAAI,IAAI,CAAC,OAAO,EAAE;QAChB,MAAM,CAAC,OAAO,GAAG,cAAc,CAC7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,OAAO,EAAb,CAAa,CAAC,CACzC,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { useRef } from \"react\";\nimport { equal } from \"@wry/equality\";\n\nimport type { DeepPartial} from \"../../utilities\";\nimport { mergeDeepArray } from \"../../utilities\";\nimport type {\n Cache,\n Reference,\n StoreObject,\n MissingTree,\n} from \"../../cache\";\n\nimport { useApolloClient } from \"./useApolloClient\";\nimport { useSyncExternalStore } from \"./useSyncExternalStore\";\nimport type { OperationVariables } from \"../../core\";\nimport type { NoInfer } from \"../types/types\";\n\nexport interface UseFragmentOptions<TData, TVars>\nextends Omit<\n Cache.DiffOptions<NoInfer<TData>, NoInfer<TVars>>,\n | \"id\"\n | \"query\"\n | \"optimistic\"\n | \"previousResult\"\n | \"returnPartialData\"\n>, Omit<Cache.ReadFragmentOptions<TData, TVars>,\n | \"id\"\n | \"variables\"\n | \"returnPartialData\"\n> {\n from: StoreObject | Reference | string;\n // Override this field to make it optional (default: true).\n optimistic?: boolean;\n}\n\nexport type UseFragmentResult<TData> =\n | {\n data: TData;\n complete: true;\n missing?: never;\n }\n | {\n data: DeepPartial<TData>;\n complete: false;\n missing?: MissingTree;\n };\n\nexport function useFragment<\n TData = any,\n TVars = OperationVariables\n>(\n options: UseFragmentOptions<TData, TVars>,\n): UseFragmentResult<TData> {\n const { cache } = useApolloClient();\n\n const {\n fragment,\n fragmentName,\n from,\n optimistic = true,\n ...rest\n } = options;\n\n const diffOptions: Cache.DiffOptions<TData, TVars> = {\n ...rest,\n returnPartialData: true,\n id: typeof from === \"string\" ? from : cache.identify(from),\n query: cache[\"getFragmentDoc\"](fragment, fragmentName),\n optimistic\n };\n\n const resultRef = useRef<UseFragmentResult<TData>>();\n let latestDiff = cache.diff<TData>(diffOptions);\n\n // Used for both getSnapshot and getServerSnapshot\n const getSnapshot = () => {\n const latestDiffToResult = diffToResult(latestDiff);\n return resultRef.current &&\n equal(resultRef.current.data, latestDiffToResult.data)\n ? resultRef.current\n : (resultRef.current = latestDiffToResult);\n };\n\n return useSyncExternalStore(\n (forceUpdate) => {\n return cache.watch({\n ...diffOptions,\n immediate: true,\n callback(diff) {\n if (!equal(diff, latestDiff)) {\n resultRef.current = diffToResult((latestDiff = diff));\n forceUpdate();\n }\n },\n });\n },\n getSnapshot,\n getSnapshot\n );\n}\n\nfunction diffToResult<TData>(\n diff: Cache.DiffResult<TData>,\n): UseFragmentResult<TData> {\n const result = {\n data: diff.result!,\n complete: !!diff.complete,\n } as UseFragmentResult<TData>;\n\n if (diff.missing) {\n result.missing = mergeDeepArray(\n diff.missing.map(error => error.missing),\n );\n }\n\n return result;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
-
import { OperationVariables } from '../../core';
|
|
4
|
-
import { LazyQueryHookOptions, LazyQueryResultTuple, NoInfer } from '../types/types';
|
|
1
|
+
import type { DocumentNode } from 'graphql';
|
|
2
|
+
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
+
import type { OperationVariables } from '../../core';
|
|
4
|
+
import type { LazyQueryHookOptions, LazyQueryResultTuple, NoInfer } from '../types/types';
|
|
5
5
|
export declare function useLazyQuery<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: LazyQueryHookOptions<NoInfer<TData>, NoInfer<TVariables>>): LazyQueryResultTuple<TData, TVariables>;
|
|
6
6
|
//# sourceMappingURL=useLazyQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLazyQuery.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useLazyQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useLazyQuery.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useLazyQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,KAAK,EAEV,oBAAoB,EACpB,oBAAoB,EACpB,OAAO,EAER,MAAM,gBAAgB,CAAC;AAexB,wBAAgB,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,EAClG,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC1D,OAAO,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,GAClE,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,CA8EzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import { useCallback,
|
|
2
|
+
import { useCallback, useMemo, useRef } from 'react';
|
|
3
3
|
import { mergeOptions } from "../../utilities/index.js";
|
|
4
4
|
import { useInternalState } from "./useQuery.js";
|
|
5
5
|
import { useApolloClient } from "./useApolloClient.js";
|
|
@@ -12,11 +12,15 @@ var EAGER_METHODS = [
|
|
|
12
12
|
'subscribeToMore',
|
|
13
13
|
];
|
|
14
14
|
export function useLazyQuery(query, options) {
|
|
15
|
-
var _a
|
|
16
|
-
var abortControllersRef = useRef(new Set());
|
|
15
|
+
var _a;
|
|
17
16
|
var execOptionsRef = useRef();
|
|
18
|
-
var
|
|
19
|
-
var
|
|
17
|
+
var optionsRef = useRef();
|
|
18
|
+
var queryRef = useRef();
|
|
19
|
+
var merged = mergeOptions(options, execOptionsRef.current || {});
|
|
20
|
+
var document = (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query;
|
|
21
|
+
optionsRef.current = merged;
|
|
22
|
+
queryRef.current = document;
|
|
23
|
+
var internalState = useInternalState(useApolloClient(options && options.client), document);
|
|
20
24
|
var useQueryResult = internalState.useQuery(__assign(__assign({}, merged), { skip: !execOptionsRef.current }));
|
|
21
25
|
var initialFetchPolicy = useQueryResult.observable.options.initialFetchPolicy ||
|
|
22
26
|
internalState.getDefaultFetchPolicy();
|
|
@@ -42,28 +46,15 @@ export function useLazyQuery(query, options) {
|
|
|
42
46
|
return eagerMethods;
|
|
43
47
|
}, []);
|
|
44
48
|
Object.assign(result, eagerMethods);
|
|
45
|
-
useEffect(function () {
|
|
46
|
-
return function () {
|
|
47
|
-
abortControllersRef.current.forEach(function (controller) {
|
|
48
|
-
controller.abort();
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
}, []);
|
|
52
49
|
var execute = useCallback(function (executeOptions) {
|
|
53
|
-
var controller = new AbortController();
|
|
54
|
-
abortControllersRef.current.add(controller);
|
|
55
50
|
execOptionsRef.current = executeOptions ? __assign(__assign({}, executeOptions), { fetchPolicy: executeOptions.fetchPolicy || initialFetchPolicy }) : {
|
|
56
51
|
fetchPolicy: initialFetchPolicy,
|
|
57
52
|
};
|
|
53
|
+
var options = mergeOptions(optionsRef.current, __assign({ query: queryRef.current }, execOptionsRef.current));
|
|
58
54
|
var promise = internalState
|
|
59
|
-
.
|
|
60
|
-
.then(function (queryResult) {
|
|
61
|
-
|
|
62
|
-
return Object.assign(queryResult, eagerMethods);
|
|
63
|
-
});
|
|
64
|
-
promise.catch(function () {
|
|
65
|
-
abortControllersRef.current.delete(controller);
|
|
66
|
-
});
|
|
55
|
+
.executeQuery(__assign(__assign({}, options), { skip: false }))
|
|
56
|
+
.then(function (queryResult) { return Object.assign(queryResult, eagerMethods); });
|
|
57
|
+
promise.catch(function () { });
|
|
67
58
|
return promise;
|
|
68
59
|
}, []);
|
|
69
60
|
return [execute, result];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLazyQuery.js","sourceRoot":"","sources":["../../../src/react/hooks/useLazyQuery.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"useLazyQuery.js","sourceRoot":"","sources":["../../../src/react/hooks/useLazyQuery.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,E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,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import type { DocumentNode } from 'graphql';\nimport type { TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport type { OperationVariables } from '../../core';\nimport { mergeOptions } from '../../utilities';\nimport type {\n LazyQueryHookExecOptions,\n LazyQueryHookOptions,\n LazyQueryResultTuple,\n NoInfer,\n QueryResult,\n} from '../types/types';\nimport { useInternalState } from './useQuery';\nimport { useApolloClient } from './useApolloClient';\n\n// The following methods, when called will execute the query, regardless of\n// whether the useLazyQuery execute function was called before.\nconst EAGER_METHODS = [\n 'refetch',\n 'reobserve',\n 'fetchMore',\n 'updateQuery',\n 'startPolling',\n 'subscribeToMore',\n] as const;\n\nexport function useLazyQuery<TData = any, TVariables extends OperationVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: LazyQueryHookOptions<NoInfer<TData>, NoInfer<TVariables>>\n): LazyQueryResultTuple<TData, TVariables> {\n const execOptionsRef = useRef<Partial<LazyQueryHookExecOptions<TData, TVariables>>>();\n const optionsRef = useRef<LazyQueryHookOptions<TData, TVariables>>();\n const queryRef = useRef<DocumentNode | TypedDocumentNode<TData, TVariables>>();\n const merged = mergeOptions(options, execOptionsRef.current || {});\n const document = merged?.query ?? query;\n\n // Use refs to track options and the used query to ensure the `execute` \n // function remains referentially stable between renders.\n optionsRef.current = merged;\n queryRef.current = document;\n\n const internalState = useInternalState<TData, TVariables>(\n useApolloClient(options && options.client),\n document\n );\n\n const useQueryResult = internalState.useQuery({\n ...merged,\n skip: !execOptionsRef.current,\n });\n\n const initialFetchPolicy =\n useQueryResult.observable.options.initialFetchPolicy ||\n internalState.getDefaultFetchPolicy();\n\n const result: QueryResult<TData, TVariables> =\n Object.assign(useQueryResult, {\n called: !!execOptionsRef.current,\n });\n\n // We use useMemo here to make sure the eager methods have a stable identity.\n const eagerMethods = useMemo(() => {\n const eagerMethods: Record<string, any> = {};\n for (const key of EAGER_METHODS) {\n const method = result[key];\n eagerMethods[key] = function () {\n if (!execOptionsRef.current) {\n execOptionsRef.current = Object.create(null);\n // Only the first time populating execOptionsRef.current matters here.\n internalState.forceUpdate();\n }\n return method.apply(this, arguments);\n };\n }\n\n return eagerMethods;\n }, []);\n\n Object.assign(result, eagerMethods);\n\n const execute = useCallback<\n LazyQueryResultTuple<TData, TVariables>[0]\n >(executeOptions => {\n execOptionsRef.current = executeOptions ? {\n ...executeOptions,\n fetchPolicy: executeOptions.fetchPolicy || initialFetchPolicy,\n } : {\n fetchPolicy: initialFetchPolicy,\n };\n\n const options = mergeOptions(optionsRef.current, {\n query: queryRef.current,\n ...execOptionsRef.current,\n })\n\n const promise = internalState\n .executeQuery({ ...options, skip: false })\n .then((queryResult) => Object.assign(queryResult, eagerMethods));\n\n // Because the return value of `useLazyQuery` is usually floated, we need\n // to catch the promise to prevent unhandled rejections.\n promise.catch(() => {});\n\n return promise;\n }, []);\n\n return [execute, result];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
-
import { MutationHookOptions, MutationTuple, NoInfer } from '../types/types';
|
|
4
|
-
import { ApolloCache, DefaultContext, OperationVariables } from '../../core';
|
|
1
|
+
import type { DocumentNode } from 'graphql';
|
|
2
|
+
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
+
import type { MutationHookOptions, MutationTuple, NoInfer } from '../types/types';
|
|
4
|
+
import type { ApolloCache, DefaultContext, OperationVariables } from '../../core';
|
|
5
5
|
export declare function useMutation<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>>(mutation: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: MutationHookOptions<NoInfer<TData>, NoInfer<TVariables>, TContext, TCache>): MutationTuple<TData, TVariables, TContext, TCache>;
|
|
6
6
|
//# sourceMappingURL=useMutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useMutation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useMutation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EAEV,mBAAmB,EAEnB,aAAa,EACb,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAAC,MAAM,YAAY,CAAC;AASxC,wBAAgB,WAAW,CACzB,KAAK,GAAG,GAAG,EACX,UAAU,GAAG,kBAAkB,EAC/B,QAAQ,GAAG,cAAc,EACzB,MAAM,SAAS,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EAElD,QAAQ,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC7D,OAAO,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GACnF,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CA8HpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { mergeOptions
|
|
3
|
+
import { mergeOptions } from "../../utilities/index.js";
|
|
4
4
|
import { equal } from '@wry/equality';
|
|
5
5
|
import { DocumentType, verifyDocumentType } from "../parser/index.js";
|
|
6
6
|
import { ApolloError } from "../../errors/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMutation.js","sourceRoot":"","sources":["../../../src/react/hooks/useMutation.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useMutation.js","sourceRoot":"","sources":["../../../src/react/hooks/useMutation.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAejE,OAAO,EACL,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,WAAW,CAMzB,QAA6D,EAC7D,OAAoF;IAEpF,IAAM,MAAM,GAAG,eAAe,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC;IAChD,kBAAkB,CAAC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAA,KAAsB,QAAQ,CAAgC;QAClE,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,KAAK;QACd,MAAM,QAAA;KACP,CAAC,EAJK,MAAM,QAAA,EAAE,SAAS,QAItB,CAAC;IAEH,IAAM,GAAG,GAAG,MAAM,CAAC;QACjB,MAAM,QAAA;QACN,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,IAAI;QACf,MAAM,QAAA;QACN,QAAQ,UAAA;QACR,OAAO,SAAA;KACR,CAAC,CAAC;IAIH;QACE,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,CAAA,CAAA;YAEtE,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;gBAG9B,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;aACxC;YAED,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,KAAK,GAAG,WAAW,CAAC;QACxB,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE;YACzB,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;SACtD;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC;QACR,GAAG,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAE7B,OAAO;YACL,GAAG,CAAC,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;QAChC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,OAAO,aAAI,KAAK,OAAA,IAAK,MAAM,EAAG,CAAC;AACzC,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { DocumentNode } from 'graphql';\nimport type { TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport type {\n MutationFunctionOptions,\n MutationHookOptions,\n MutationResult,\n MutationTuple,\n NoInfer,\n} from '../types/types';\n\nimport type {\n ApolloCache,\n DefaultContext,\n OperationVariables} from '../../core';\nimport {\n mergeOptions\n} from '../../utilities';\nimport { equal } from '@wry/equality';\nimport { DocumentType, verifyDocumentType } from '../parser';\nimport { ApolloError } from '../../errors';\nimport { useApolloClient } from './useApolloClient';\n\nexport function useMutation<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n>(\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: MutationHookOptions<NoInfer<TData>, NoInfer<TVariables>, TContext, TCache>,\n): MutationTuple<TData, TVariables, TContext, TCache> {\n const client = useApolloClient(options?.client);\n verifyDocumentType(mutation, DocumentType.Mutation);\n const [result, setResult] = useState<Omit<MutationResult, 'reset'>>({\n called: false,\n loading: false,\n client,\n });\n\n const ref = useRef({\n result,\n mutationId: 0,\n isMounted: true,\n client,\n mutation,\n options,\n });\n\n // TODO: Trying to assign these in a useEffect or useLayoutEffect breaks\n // higher-order components.\n {\n Object.assign(ref.current, { client, options, mutation });\n }\n\n const execute = useCallback((\n executeOptions: MutationFunctionOptions<\n TData,\n TVariables,\n TContext,\n TCache\n > = {}\n ) => {\n const {options, mutation} = ref.current;\n const baseOptions = { ...options, mutation };\n const client = executeOptions.client || ref.current.client;\n\n if (!ref.current.result.loading && !baseOptions.ignoreResults && ref.current.isMounted) {\n setResult(ref.current.result = {\n loading: true,\n error: void 0,\n data: void 0,\n called: true,\n client,\n });\n }\n\n const mutationId = ++ref.current.mutationId;\n const clientOptions = mergeOptions(\n baseOptions,\n executeOptions as any,\n );\n\n return client.mutate(clientOptions).then((response) => {\n const { data, errors } = response;\n const error =\n errors && errors.length > 0\n ? new ApolloError({ graphQLErrors: errors })\n : void 0;\n\n if (\n mutationId === ref.current.mutationId &&\n !clientOptions.ignoreResults\n ) {\n const result = {\n called: true,\n loading: false,\n data,\n error,\n client,\n };\n\n if (ref.current.isMounted && !equal(ref.current.result, result)) {\n setResult(ref.current.result = result);\n }\n }\n\n const onCompleted = executeOptions.onCompleted || ref.current.options?.onCompleted\n onCompleted?.(response.data!, clientOptions);\n\n return response;\n }).catch((error) => {\n if (\n mutationId === ref.current.mutationId &&\n ref.current.isMounted\n ) {\n const result = {\n loading: false,\n error,\n data: void 0,\n called: true,\n client,\n };\n\n if (!equal(ref.current.result, result)) {\n setResult(ref.current.result = result);\n }\n }\n\n const onError = executeOptions.onError || ref.current.options?.onError\n\n if (onError) {\n onError(error, clientOptions);\n\n // TODO(brian): why are we returning this here???\n return { data: void 0, errors: error };\n }\n\n throw error;\n });\n }, []);\n\n const reset = useCallback(() => {\n if (ref.current.isMounted) {\n setResult({ called: false, loading: false, client });\n }\n }, []);\n\n useEffect(() => {\n ref.current.isMounted = true;\n\n return () => {\n ref.current.isMounted = false;\n };\n }, []);\n\n return [execute, { reset, ...result }];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OperationVariables, WatchQueryFetchPolicy } from '../../core';
|
|
2
|
-
import { ApolloClient, ApolloQueryResult, DocumentNode, TypedDocumentNode } from '../../core';
|
|
3
|
-
import { QueryHookOptions, QueryResult, NoInfer } from '../types/types';
|
|
1
|
+
import type { OperationVariables, WatchQueryFetchPolicy } from '../../core';
|
|
2
|
+
import type { ApolloClient, ApolloQueryResult, DocumentNode, TypedDocumentNode } from '../../core';
|
|
3
|
+
import type { QueryHookOptions, QueryResult, NoInfer } from '../types/types';
|
|
4
4
|
import { useApolloClient } from './useApolloClient';
|
|
5
5
|
export declare function useQuery<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: QueryHookOptions<NoInfer<TData>, NoInfer<TVariables>>): QueryResult<TData, TVariables>;
|
|
6
6
|
export declare function useInternalState<TData, TVariables extends OperationVariables>(client: ApolloClient<any>, query: DocumentNode | TypedDocumentNode<TData, TVariables>): InternalState<TData, TVariables>;
|
|
@@ -9,9 +9,9 @@ declare class InternalState<TData, TVariables extends OperationVariables> {
|
|
|
9
9
|
readonly query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
10
10
|
constructor(client: ReturnType<typeof useApolloClient>, query: DocumentNode | TypedDocumentNode<TData, TVariables>, previous?: InternalState<TData, TVariables>);
|
|
11
11
|
forceUpdate(): void;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
executeQuery(options: QueryHookOptions<TData, TVariables> & {
|
|
13
|
+
query?: DocumentNode;
|
|
14
|
+
}): Promise<QueryResult<TData, TVariables>>;
|
|
15
15
|
useQuery(options: QueryHookOptions<TData, TVariables>): QueryResult<TData, TVariables>;
|
|
16
16
|
private renderPromises;
|
|
17
17
|
private queryHookOptions;
|