@apollo/client 4.0.0-alpha.0 → 4.0.0-alpha.10
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/.changeset/afraid-moons-arrive.md +5 -0
- package/.changeset/beige-mirrors-talk.md +15 -0
- package/.changeset/clean-sheep-hide.md +6 -0
- package/.changeset/cool-bikes-shake.md +12 -0
- package/.changeset/cool-kiwis-hunt.md +15 -0
- package/.changeset/cuddly-spiders-tie.md +5 -0
- package/.changeset/dirty-eagles-poke.md +5 -0
- package/.changeset/early-eggs-develop.md +22 -0
- package/.changeset/eighty-squids-fix.md +15 -0
- package/.changeset/eleven-kangaroos-jump.md +5 -0
- package/.changeset/forty-shrimps-fry.md +5 -0
- package/.changeset/forty-tomatoes-punch.md +5 -0
- package/.changeset/four-countries-clean.md +24 -0
- package/.changeset/four-ghosts-watch.md +5 -0
- package/.changeset/funny-jeans-invent.md +16 -0
- package/.changeset/funny-terms-deny.md +5 -0
- package/.changeset/fuzzy-tips-sit.md +5 -0
- package/.changeset/gentle-badgers-train.md +5 -0
- package/.changeset/giant-apes-thank.md +5 -0
- package/.changeset/giant-bags-share.md +5 -0
- package/.changeset/gorgeous-chefs-tap.md +5 -0
- package/.changeset/great-roses-jog.md +15 -0
- package/.changeset/grumpy-vans-type.md +5 -0
- package/.changeset/hip-vans-act.md +5 -0
- package/.changeset/hungry-bikes-cough.md +5 -0
- package/.changeset/itchy-chefs-run.md +23 -0
- package/.changeset/khaki-keys-deliver.md +5 -0
- package/.changeset/khaki-spies-work.md +11 -0
- package/.changeset/large-plants-know.md +5 -0
- package/.changeset/light-apes-rescue.md +5 -0
- package/.changeset/little-spoons-kick.md +7 -0
- package/.changeset/loud-cows-raise.md +7 -0
- package/.changeset/many-buses-allow.md +5 -0
- package/.changeset/mean-lizards-think.md +5 -0
- package/.changeset/nervous-fireants-bow.md +5 -0
- package/.changeset/nervous-goats-allow.md +5 -0
- package/.changeset/nice-dots-matter.md +5 -0
- package/.changeset/ninety-bags-bake.md +17 -0
- package/.changeset/odd-chicken-hide.md +17 -0
- package/.changeset/odd-lemons-relax.md +5 -0
- package/.changeset/perfect-vans-give.md +7 -0
- package/.changeset/poor-eels-punch.md +5 -0
- package/.changeset/pre.json +67 -0
- package/.changeset/purple-bears-flash.md +5 -0
- package/.changeset/rare-houses-prove.md +5 -0
- package/.changeset/real-teachers-peel.md +5 -0
- package/.changeset/serious-moons-juggle.md +5 -0
- package/.changeset/seven-dragons-repair.md +14 -0
- package/.changeset/shaggy-pugs-add.md +52 -0
- package/.changeset/short-months-complain.md +5 -0
- package/.changeset/slimy-chicken-melt.md +5 -0
- package/.changeset/slimy-maps-press.md +5 -0
- package/.changeset/small-buttons-rhyme.md +5 -0
- package/.changeset/swift-rivers-share.md +13 -0
- package/.changeset/tall-bikes-develop.md +5 -0
- package/.changeset/tame-doors-shop.md +14 -0
- package/.changeset/tame-points-work.md +11 -0
- package/.changeset/tender-swans-flash.md +16 -0
- package/.changeset/thick-books-grin.md +5 -0
- package/.changeset/thin-peas-hear.md +16 -0
- package/.changeset/tidy-pandas-punch.md +5 -0
- package/.changeset/tough-rockets-allow.md +5 -0
- package/.changeset/tricky-tables-shave.md +5 -0
- package/.changeset/unlucky-kiwis-sell.md +5 -0
- package/.changeset/warm-ties-sit.md +7 -0
- package/.changeset/wicked-forks-double.md +33 -0
- package/.changeset/young-phones-fold.md +5 -0
- package/.changeset/young-snails-grin.md +5 -0
- package/CHANGELOG.md +507 -0
- package/__cjs/cache/core/cache.cjs +3 -3
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +19 -19
- package/__cjs/cache/core/types/Cache.cjs.map +1 -1
- package/__cjs/cache/core/types/Cache.d.cts +9 -16
- package/__cjs/cache/core/types/DataProxy.d.cts +8 -23
- package/__cjs/cache/core/types/common.cjs +1 -0
- package/__cjs/cache/core/types/common.cjs.map +1 -1
- package/__cjs/cache/index.cjs +4 -4
- package/__cjs/cache/index.cjs.map +1 -1
- package/__cjs/cache/index.d.cts +3 -3
- package/__cjs/cache/inmemory/entityStore.cjs +6 -5
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.d.cts +3 -2
- package/__cjs/cache/inmemory/fragmentRegistry.cjs +3 -3
- package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
- package/__cjs/cache/inmemory/helpers.cjs +0 -8
- package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
- package/__cjs/cache/inmemory/helpers.d.cts +3 -4
- package/__cjs/cache/inmemory/inMemoryCache.cjs +6 -18
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +9 -11
- package/__cjs/cache/inmemory/policies.cjs +5 -5
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.d.cts +1 -1
- package/__cjs/cache/inmemory/reactiveVars.cjs.map +1 -1
- package/__cjs/cache/inmemory/reactiveVars.d.cts +7 -7
- package/__cjs/cache/inmemory/readFromStore.cjs +12 -54
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.d.cts +1 -6
- package/__cjs/cache/inmemory/types.d.cts +3 -17
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/writeToStore.d.cts +2 -2
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs +6 -4
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/areCombinedProtocolErrorsEqual.cjs +3 -3
- package/__cjs/config/jest/areCombinedProtocolErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/areMissingFieldErrorsEqual.cjs +2 -3
- package/__cjs/config/jest/areMissingFieldErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/areServerErrorsEqual.cjs +22 -0
- package/__cjs/config/jest/areServerErrorsEqual.cjs.map +1 -0
- package/__cjs/config/jest/areServerErrorsEqual.d.cts +3 -0
- package/__cjs/config/jest/resolver.cjs +11 -0
- package/__cjs/config/jest/resolver.cjs.map +1 -1
- package/__cjs/config/jest/setup.cjs +18 -1
- package/__cjs/config/jest/setup.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs +36 -19
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +36 -26
- package/__cjs/core/LocalState.cjs +2 -2
- package/__cjs/core/LocalState.cjs.map +1 -1
- package/__cjs/core/LocalState.d.cts +8 -8
- package/__cjs/core/ObservableQuery.cjs +268 -104
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +156 -17
- package/__cjs/core/QueryInfo.cjs +12 -86
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +2 -11
- package/__cjs/core/QueryManager.cjs +148 -104
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +45 -24
- package/__cjs/core/index.cjs +42 -21
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +12 -11
- package/__cjs/core/types.d.cts +60 -7
- package/__cjs/core/watchQueryOptions.d.cts +32 -119
- package/__cjs/errors/CombinedGraphQLErrors.cjs +30 -11
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedGraphQLErrors.d.cts +21 -2
- package/__cjs/errors/CombinedProtocolErrors.cjs +13 -6
- package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedProtocolErrors.d.cts +9 -0
- package/__cjs/errors/LinkError.cjs +20 -0
- package/__cjs/errors/LinkError.cjs.map +1 -0
- package/__cjs/errors/LinkError.d.cts +14 -0
- package/__cjs/errors/ServerError.cjs +6 -0
- package/__cjs/errors/ServerError.cjs.map +1 -1
- package/__cjs/errors/ServerError.d.cts +2 -0
- package/__cjs/errors/ServerParseError.cjs +6 -0
- package/__cjs/errors/ServerParseError.cjs.map +1 -1
- package/__cjs/errors/ServerParseError.d.cts +2 -0
- package/__cjs/errors/UnconventionalError.cjs +6 -0
- package/__cjs/errors/UnconventionalError.cjs.map +1 -1
- package/__cjs/errors/UnconventionalError.d.cts +2 -0
- package/__cjs/errors/index.cjs +19 -4
- package/__cjs/errors/index.cjs.map +1 -1
- package/__cjs/errors/index.d.cts +2 -3
- package/__cjs/errors/isErrorLike.cjs +12 -0
- package/__cjs/errors/isErrorLike.cjs.map +1 -0
- package/__cjs/errors/isErrorLike.d.cts +3 -0
- package/__cjs/errors/utils.cjs +18 -0
- package/__cjs/errors/utils.cjs.map +1 -0
- package/__cjs/errors/utils.d.cts +3 -0
- package/__cjs/invariantErrorCodes.cjs +121 -122
- package/__cjs/link/batch/batching.cjs.map +1 -1
- package/__cjs/link/batch/index.cjs +4 -2
- package/__cjs/link/batch/index.cjs.map +1 -1
- package/__cjs/link/batch/index.d.cts +2 -1
- package/__cjs/link/batch-http/index.cjs +3 -2
- package/__cjs/link/batch-http/index.cjs.map +1 -1
- package/__cjs/link/batch-http/index.d.cts +1 -1
- package/__cjs/link/context/index.cjs.map +1 -1
- package/__cjs/link/context/index.d.cts +1 -1
- package/__cjs/link/core/ApolloLink.cjs +2 -20
- package/__cjs/link/core/ApolloLink.cjs.map +1 -1
- package/__cjs/link/core/ApolloLink.d.cts +1 -3
- package/__cjs/link/core/index.cjs.map +1 -1
- package/__cjs/link/core/index.d.cts +1 -1
- package/__cjs/link/core/types.d.cts +1 -1
- package/__cjs/link/error/index.cjs +13 -28
- package/__cjs/link/error/index.cjs.map +1 -1
- package/__cjs/link/error/index.d.cts +4 -15
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/createHttpLink.cjs +1 -1
- package/__cjs/link/http/createHttpLink.d.cts +2 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +4 -3
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +3 -3
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.d.cts +14 -3
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +10 -1
- package/__cjs/link/retry/index.cjs +3 -2
- package/__cjs/link/retry/index.cjs.map +1 -1
- package/__cjs/link/retry/index.d.cts +1 -1
- package/__cjs/link/subscriptions/index.cjs +3 -1
- package/__cjs/link/subscriptions/index.cjs.map +1 -1
- package/__cjs/link/utils/validateOperation.cjs +1 -1
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskDefinition.cjs.map +1 -1
- package/__cjs/masking/maskDefinition.d.cts +1 -1
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs.map +1 -1
- package/__cjs/masking/maskFragment.d.cts +2 -2
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/maskOperation.cjs.map +1 -1
- package/__cjs/masking/maskOperation.d.cts +2 -2
- package/__cjs/masking/utils.cjs +1 -1
- package/__cjs/react/context/ApolloConsumer.cjs +2 -2
- package/__cjs/react/context/ApolloConsumer.cjs.map +1 -1
- package/__cjs/react/context/ApolloConsumer.d.cts +7 -4
- package/__cjs/react/context/ApolloContext.cjs +2 -2
- package/__cjs/react/context/ApolloContext.cjs.map +1 -1
- package/__cjs/react/context/ApolloContext.d.cts +4 -4
- package/__cjs/react/context/ApolloProvider.cjs +2 -2
- package/__cjs/react/context/ApolloProvider.cjs.map +1 -1
- package/__cjs/react/context/ApolloProvider.d.cts +7 -5
- package/__cjs/react/hooks/internal/__use.cjs +1 -1
- package/__cjs/react/hooks/internal/__use.cjs.map +1 -1
- package/__cjs/react/hooks/internal/__use.d.cts +3 -1
- package/__cjs/react/hooks/internal/useDeepMemo.cjs +3 -1
- package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs +1 -1
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs.map +1 -1
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.d.cts +2 -2
- package/__cjs/react/hooks/internal/useRenderGuard.cjs +1 -1
- package/__cjs/react/hooks/internal/useRenderGuard.cjs.map +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +28 -0
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs.map +1 -0
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.d.cts +3 -0
- package/__cjs/react/hooks/internal/wrapHook.cjs +26 -5
- package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
- package/__cjs/react/hooks/internal/wrapHook.d.cts +7 -5
- package/__cjs/react/hooks/useApolloClient.cjs +3 -3
- package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
- package/__cjs/react/hooks/useApolloClient.d.cts +2 -2
- package/__cjs/react/hooks/useBackgroundQuery.cjs +3 -3
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +143 -46
- package/__cjs/react/hooks/useFragment.cjs +1 -1
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +51 -26
- package/__cjs/react/hooks/useLazyQuery.cjs +33 -32
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +278 -276
- package/__cjs/react/hooks/useLoadableQuery.cjs +22 -3
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +106 -34
- package/__cjs/react/hooks/useMutation.cjs +15 -23
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +198 -4
- package/__cjs/react/hooks/useQuery.cjs +88 -207
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +274 -4
- package/__cjs/react/hooks/useQueryRefHandlers.cjs +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +23 -22
- package/__cjs/react/hooks/useReactiveVar.cjs +1 -1
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
- package/__cjs/react/hooks/useReactiveVar.d.cts +1 -1
- package/__cjs/react/hooks/useReadQuery.cjs +1 -1
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.d.cts +27 -25
- package/__cjs/react/hooks/useSubscription.cjs +10 -60
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +94 -3
- package/__cjs/react/hooks/useSuspenseFragment.cjs +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.d.cts +40 -38
- package/__cjs/react/hooks/useSuspenseQuery.cjs +8 -33
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +199 -38
- package/__cjs/react/hooks/useSyncExternalStore.cjs +2 -2
- package/__cjs/react/hooks/useSyncExternalStore.cjs.map +1 -1
- package/__cjs/react/index.cjs +35 -11
- package/__cjs/react/index.cjs.map +1 -1
- package/__cjs/react/index.d.cts +21 -6
- package/__cjs/react/index.react-server.cjs +48 -0
- package/__cjs/react/index.react-server.cjs.map +1 -0
- package/__cjs/react/index.react-server.d.cts +19 -0
- package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/FragmentReference.d.cts +3 -3
- package/__cjs/react/internal/cache/QueryReference.cjs +3 -14
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +7 -7
- package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/SuspenseCache.d.cts +3 -3
- package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/getSuspenseCache.d.cts +4 -4
- package/__cjs/react/internal/index.cjs +3 -1
- package/__cjs/react/internal/index.cjs.map +1 -1
- package/__cjs/react/internal/index.d.cts +2 -0
- package/__cjs/react/internal/types.d.cts +9 -0
- package/__cjs/react/query-preloader/createQueryPreloader.cjs +1 -0
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +6 -45
- package/__cjs/react/ssr/getDataFromTree.cjs +24 -30
- package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
- package/__cjs/react/ssr/getDataFromTree.d.cts +12 -1
- package/__cjs/react/ssr/index.cjs +3 -3
- package/__cjs/react/ssr/index.cjs.map +1 -1
- package/__cjs/react/ssr/index.d.cts +1 -1
- package/__cjs/react/ssr/prerenderStatic.cjs +151 -0
- package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -0
- package/__cjs/react/ssr/prerenderStatic.d.cts +122 -0
- package/__cjs/react/ssr/renderToStringWithData.cjs +11 -5
- package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -1
- package/__cjs/react/ssr/renderToStringWithData.d.cts +5 -0
- package/__cjs/react/ssr/useSSRQuery.cjs +60 -0
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -0
- package/__cjs/react/ssr/useSSRQuery.d.cts +5 -0
- package/__cjs/{utilities/types/TODO.cjs → react/types/deprecated.cjs} +1 -1
- package/__cjs/react/types/deprecated.cjs.map +1 -0
- package/__cjs/react/types/deprecated.d.cts +75 -0
- package/__cjs/react/types/types.documentation.d.cts +6 -34
- package/__cjs/testing/core/index.cjs +6 -3
- package/__cjs/testing/core/index.cjs.map +1 -1
- package/__cjs/testing/core/index.d.cts +3 -3
- package/__cjs/testing/core/mocking/mockClient.cjs +3 -4
- package/__cjs/testing/core/mocking/mockClient.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockClient.d.cts +2 -3
- package/__cjs/testing/core/mocking/mockLink.cjs +118 -112
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockLink.d.cts +26 -7
- package/__cjs/testing/experimental/createSchemaFetch.cjs +4 -4
- package/__cjs/testing/experimental/createSchemaFetch.cjs.map +1 -1
- package/__cjs/testing/experimental/createTestSchema.cjs.map +1 -1
- package/__cjs/testing/experimental/createTestSchema.d.cts +1 -1
- package/__cjs/testing/index.cjs +13 -2
- package/__cjs/testing/index.cjs.map +1 -1
- package/__cjs/testing/index.d.cts +2 -1
- package/__cjs/testing/internal/disposables/spyOnConsole.cjs +0 -1
- package/__cjs/testing/internal/disposables/spyOnConsole.cjs.map +1 -1
- package/__cjs/testing/internal/disposables/spyOnConsole.d.cts +0 -1
- package/__cjs/testing/internal/disposables/withProdMode.d.cts +1 -1
- package/__cjs/testing/internal/incremental.cjs.map +1 -1
- package/__cjs/testing/internal/incremental.d.cts +4 -3
- package/__cjs/testing/internal/index.cjs +14 -8
- package/__cjs/testing/internal/index.cjs.map +1 -1
- package/__cjs/testing/internal/index.d.cts +4 -3
- package/__cjs/testing/internal/renderHelpers.cjs.map +1 -1
- package/__cjs/testing/internal/renderHelpers.d.cts +3 -3
- package/__cjs/testing/internal/resetApolloContext.cjs +24 -0
- package/__cjs/testing/internal/resetApolloContext.cjs.map +1 -0
- package/__cjs/testing/internal/resetApolloContext.d.cts +10 -0
- package/__cjs/testing/internal/scenarios/index.cjs +9 -7
- package/__cjs/testing/internal/scenarios/index.cjs.map +1 -1
- package/__cjs/testing/internal/scenarios/index.d.cts +14 -5
- package/__cjs/testing/matchers/arrayWithLength.cjs +15 -0
- package/__cjs/testing/matchers/arrayWithLength.cjs.map +1 -0
- package/__cjs/testing/matchers/arrayWithLength.d.cts +3 -0
- package/__cjs/testing/matchers/index.cjs +6 -18
- package/__cjs/testing/matchers/index.cjs.map +1 -1
- package/__cjs/testing/matchers/toComplete.cjs.map +1 -1
- package/__cjs/testing/matchers/toEmitAnything.cjs.map +1 -1
- package/__cjs/testing/matchers/toEmitError.cjs.map +1 -1
- package/__cjs/testing/matchers/toEmitNext.cjs.map +1 -1
- package/__cjs/testing/matchers/{toEmitFetchResult.cjs → toEmitTypedValue.cjs} +9 -7
- package/__cjs/testing/matchers/toEmitTypedValue.cjs.map +1 -0
- package/__cjs/testing/matchers/{toEmitValueStrict.d.cts → toEmitTypedValue.d.cts} +2 -2
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs +2 -2
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs.map +1 -1
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.d.cts +1 -1
- package/__cjs/testing/matchers/toMatchDocument.cjs.map +1 -1
- package/__cjs/testing/matchers/toMatchDocument.d.cts +1 -1
- package/__cjs/testing/matchers/toStrictEqualTyped.cjs +26 -0
- package/__cjs/testing/matchers/toStrictEqualTyped.cjs.map +1 -0
- package/__cjs/testing/matchers/toStrictEqualTyped.d.cts +3 -0
- package/__cjs/testing/matchers/utils/getSerializableProperties.cjs +23 -0
- package/__cjs/testing/matchers/utils/getSerializableProperties.cjs.map +1 -0
- package/__cjs/testing/matchers/utils/getSerializableProperties.d.cts +2 -0
- package/__cjs/testing/react/MockedProvider.cjs +11 -7
- package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
- package/__cjs/testing/react/MockedProvider.d.cts +8 -6
- package/__cjs/utilities/caching/sizes.cjs +2 -2
- package/__cjs/utilities/caching/sizes.cjs.map +1 -1
- package/__cjs/utilities/caching/sizes.d.cts +2 -20
- package/__cjs/utilities/common/canonicalStringify.cjs +2 -2
- package/__cjs/utilities/common/canonicalStringify.cjs.map +1 -1
- package/__cjs/utilities/common/errorHandling.d.cts +1 -1
- package/__cjs/utilities/common/maybeDeepFreeze.cjs +1 -0
- package/__cjs/utilities/common/maybeDeepFreeze.cjs.map +1 -1
- package/__cjs/utilities/common/maybeDeepFreeze.d.cts +1 -0
- package/__cjs/utilities/common/mergeOptions.cjs.map +1 -1
- package/__cjs/utilities/common/mergeOptions.d.cts +1 -1
- package/__cjs/utilities/graphql/getFromAST.cjs +15 -6
- package/__cjs/utilities/graphql/getFromAST.cjs.map +1 -1
- package/__cjs/utilities/graphql/getFromAST.d.cts +2 -2
- package/__cjs/utilities/graphql/operations.cjs.map +1 -1
- package/__cjs/utilities/graphql/operations.d.cts +1 -1
- package/__cjs/utilities/graphql/print.cjs +2 -2
- package/__cjs/utilities/graphql/print.cjs.map +1 -1
- package/__cjs/utilities/graphql/storeUtils.cjs +1 -1
- package/__cjs/utilities/graphql/transform.cjs +2 -2
- package/__cjs/utilities/index.cjs +39 -19
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/index.d.cts +16 -15
- package/__cjs/utilities/{caching → internal}/getMemoryInternals.cjs +1 -3
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -0
- package/__cjs/utilities/{caching → internal}/getMemoryInternals.d.cts +1 -2
- package/__cjs/utilities/internal/index.cjs +8 -1
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +2 -0
- package/__cjs/utilities/internal/index.production.cjs +11 -0
- package/__cjs/utilities/internal/index.production.cjs.map +1 -0
- package/__cjs/utilities/internal/index.production.d.cts +3 -0
- package/__cjs/utilities/internal/toQueryResult.cjs +13 -0
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -0
- package/__cjs/utilities/internal/toQueryResult.d.cts +3 -0
- package/__cjs/utilities/invariant/index.development.cjs +1 -0
- package/__cjs/utilities/invariant/index.development.cjs.map +1 -1
- package/__cjs/utilities/subscriptions/relay/index.cjs +2 -2
- package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
- package/__cjs/utilities/subscriptions/relay/index.d.cts +1 -1
- package/__cjs/utilities/types/NoInfer.d.cts +1 -1
- package/__cjs/utilities/types/{OnlyRequiredProperties.cjs → VariablesOption.cjs} +1 -1
- package/__cjs/utilities/types/VariablesOption.cjs.map +1 -0
- package/__cjs/utilities/types/VariablesOption.d.cts +25 -0
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/__cjs/version.d.cts +1 -1
- package/cache/core/cache.d.ts +19 -19
- package/cache/core/cache.js +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +9 -16
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +8 -23
- package/cache/core/types/common.js +1 -0
- package/cache/core/types/common.js.map +1 -1
- package/cache/index.d.ts +3 -3
- package/cache/index.js +1 -1
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +3 -2
- package/cache/inmemory/entityStore.js +6 -5
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.js +1 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +0 -1
- package/cache/inmemory/helpers.js +0 -7
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +9 -11
- package/cache/inmemory/inMemoryCache.js +5 -17
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/policies.d.ts +1 -1
- package/cache/inmemory/policies.js +5 -5
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +7 -7
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +1 -6
- package/cache/inmemory/readFromStore.js +12 -54
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +3 -17
- package/cache/inmemory/writeToStore.d.ts +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/config/jest/areCombinedGraphQLErrorsEqual.js +6 -4
- package/config/jest/areCombinedGraphQLErrorsEqual.js.map +1 -1
- package/config/jest/areCombinedProtocolErrorsEqual.js +3 -3
- package/config/jest/areCombinedProtocolErrorsEqual.js.map +1 -1
- package/config/jest/areMissingFieldErrorsEqual.js +2 -3
- package/config/jest/areMissingFieldErrorsEqual.js.map +1 -1
- package/config/jest/areServerErrorsEqual.d.ts +3 -0
- package/config/jest/areServerErrorsEqual.js +18 -0
- package/config/jest/areServerErrorsEqual.js.map +1 -0
- package/config/jest/resolver.js +12 -1
- package/config/jest/resolver.js.map +1 -1
- package/config/jest/setup.js +19 -2
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +36 -26
- package/core/ApolloClient.js +36 -19
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts +6 -6
- package/core/LocalState.js +2 -2
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +156 -17
- package/core/ObservableQuery.js +267 -102
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +2 -11
- package/core/QueryInfo.js +12 -86
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +32 -21
- package/core/QueryManager.js +151 -107
- package/core/QueryManager.js.map +1 -1
- package/core/index.d.ts +12 -11
- package/core/index.js +9 -6
- package/core/index.js.map +1 -1
- package/core/types.d.ts +60 -7
- package/core/watchQueryOptions.d.ts +32 -119
- package/errors/CombinedGraphQLErrors.d.ts +21 -2
- package/errors/CombinedGraphQLErrors.js +30 -11
- package/errors/CombinedGraphQLErrors.js.map +1 -1
- package/errors/CombinedProtocolErrors.d.ts +9 -0
- package/errors/CombinedProtocolErrors.js +13 -6
- package/errors/CombinedProtocolErrors.js.map +1 -1
- package/errors/LinkError.d.ts +14 -0
- package/errors/LinkError.js +16 -0
- package/errors/LinkError.js.map +1 -0
- package/errors/ServerError.d.ts +2 -0
- package/errors/ServerError.js +6 -0
- package/errors/ServerError.js.map +1 -1
- package/errors/ServerParseError.d.ts +2 -0
- package/errors/ServerParseError.js +6 -0
- package/errors/ServerParseError.js.map +1 -1
- package/errors/UnconventionalError.d.ts +2 -0
- package/errors/UnconventionalError.js +6 -0
- package/errors/UnconventionalError.js.map +1 -1
- package/errors/index.d.ts +2 -3
- package/errors/index.js +13 -1
- package/errors/index.js.map +1 -1
- package/errors/isErrorLike.d.ts +3 -0
- package/errors/isErrorLike.js +9 -0
- package/errors/isErrorLike.js.map +1 -0
- package/errors/utils.d.ts +3 -0
- package/errors/utils.js +14 -0
- package/errors/utils.js.map +1 -0
- package/invariantErrorCodes.js +121 -122
- package/legacyEntryPoints/testing/internal/index.d.ts +1 -0
- package/legacyEntryPoints/testing/internal/index.js +1 -0
- package/legacyEntryPoints/testing/internal/internal.cjs +1 -0
- package/legacyEntryPoints/testing/internal/internal.d.cts +1 -0
- package/link/batch/batching.js +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch/index.d.ts +2 -1
- package/link/batch/index.js +1 -1
- package/link/batch/index.js.map +1 -1
- package/link/batch-http/index.d.ts +1 -1
- package/link/batch-http/index.js +1 -1
- package/link/batch-http/index.js.map +1 -1
- package/link/context/index.d.ts +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.d.ts +1 -3
- package/link/core/ApolloLink.js +2 -20
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/index.d.ts +1 -1
- package/link/core/index.js.map +1 -1
- package/link/core/types.d.ts +1 -1
- package/link/error/index.d.ts +4 -15
- package/link/error/index.js +14 -29
- package/link/error/index.js.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +4 -3
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.d.ts +2 -2
- package/link/persisted-queries/index.js +3 -3
- package/link/persisted-queries/index.js.map +1 -1
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/link/retry/index.d.ts +1 -1
- package/link/retry/index.js +1 -1
- package/link/retry/index.js.map +1 -1
- package/link/subscriptions/index.js +3 -1
- package/link/subscriptions/index.js.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/masking/maskDefinition.d.ts +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskDefinition.js.map +1 -1
- package/masking/maskFragment.d.ts +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskFragment.js.map +1 -1
- package/masking/maskOperation.d.ts +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/maskOperation.js.map +1 -1
- package/masking/utils.js +1 -1
- package/package.json +58 -56
- package/react/context/ApolloConsumer.d.ts +7 -4
- package/react/context/ApolloConsumer.js +2 -2
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +4 -4
- package/react/context/ApolloContext.js +2 -2
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +7 -5
- package/react/context/ApolloProvider.js +2 -2
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/hooks/internal/__use.js +1 -1
- package/react/hooks/internal/__use.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.js +3 -1
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/internal/useRenderGuard.js +1 -1
- package/react/hooks/internal/useRenderGuard.js.map +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.d.ts +3 -0
- package/react/hooks/internal/validateSuspenseHookOptions.js +22 -0
- package/react/hooks/internal/validateSuspenseHookOptions.js.map +1 -0
- package/react/hooks/internal/wrapHook.d.ts +7 -5
- package/react/hooks/internal/wrapHook.js +24 -5
- package/react/hooks/internal/wrapHook.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts +2 -2
- package/react/hooks/useApolloClient.js +2 -2
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +143 -46
- package/react/hooks/useBackgroundQuery.js +3 -3
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +51 -26
- package/react/hooks/useFragment.js +1 -1
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +278 -276
- package/react/hooks/useLazyQuery.js +32 -31
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +106 -34
- package/react/hooks/useLoadableQuery.js +22 -3
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +198 -4
- package/react/hooks/useMutation.js +15 -23
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +274 -4
- package/react/hooks/useQuery.js +87 -206
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +23 -22
- package/react/hooks/useQueryRefHandlers.js +1 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -1
- package/react/hooks/useReactiveVar.js +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +27 -25
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +94 -9
- package/react/hooks/useSubscription.js +9 -56
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +40 -38
- package/react/hooks/useSuspenseFragment.js +1 -1
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +199 -38
- package/react/hooks/useSuspenseQuery.js +6 -27
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +2 -2
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/index.d.ts +21 -6
- package/react/index.js +17 -3
- package/react/index.js.map +1 -1
- package/react/index.react-server.d.ts +19 -0
- package/react/index.react-server.js +45 -0
- package/react/index.react-server.js.map +1 -0
- package/react/internal/cache/FragmentReference.d.ts +3 -3
- package/react/internal/cache/FragmentReference.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +5 -5
- package/react/internal/cache/QueryReference.js +3 -14
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/cache/SuspenseCache.d.ts +3 -3
- package/react/internal/cache/SuspenseCache.js.map +1 -1
- package/react/internal/cache/getSuspenseCache.d.ts +3 -3
- package/react/internal/cache/getSuspenseCache.js.map +1 -1
- package/react/internal/index.d.ts +2 -0
- package/react/internal/index.js +2 -1
- package/react/internal/index.js.map +1 -1
- package/react/internal/types.d.ts +9 -0
- package/react/query-preloader/createQueryPreloader.d.ts +6 -45
- package/react/query-preloader/createQueryPreloader.js +1 -0
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/getDataFromTree.d.ts +12 -1
- package/react/ssr/getDataFromTree.js +24 -29
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/index.d.ts +1 -1
- package/react/ssr/index.js +1 -1
- package/react/ssr/index.js.map +1 -1
- package/react/ssr/prerenderStatic.d.ts +122 -0
- package/react/ssr/prerenderStatic.js +147 -0
- package/react/ssr/prerenderStatic.js.map +1 -0
- package/react/ssr/renderToStringWithData.d.ts +5 -0
- package/react/ssr/renderToStringWithData.js +11 -5
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/ssr/useSSRQuery.d.ts +5 -0
- package/react/ssr/useSSRQuery.js +56 -0
- package/react/ssr/useSSRQuery.js.map +1 -0
- package/react/types/deprecated.d.ts +75 -0
- package/react/types/deprecated.js +2 -0
- package/react/types/deprecated.js.map +1 -0
- package/react/types/types.documentation.d.ts +6 -34
- package/testing/core/index.d.ts +3 -3
- package/testing/core/index.js +2 -2
- package/testing/core/index.js.map +1 -1
- package/testing/core/mocking/mockClient.d.ts +2 -3
- package/testing/core/mocking/mockClient.js +2 -3
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +26 -7
- package/testing/core/mocking/mockLink.js +117 -113
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/experimental/createSchemaFetch.js +2 -2
- package/testing/experimental/createSchemaFetch.js.map +1 -1
- package/testing/experimental/createTestSchema.d.ts +1 -1
- package/testing/experimental/createTestSchema.js.map +1 -1
- package/testing/index.d.ts +2 -1
- package/testing/index.js +1 -1
- package/testing/index.js.map +1 -1
- package/testing/internal/disposables/spyOnConsole.d.ts +0 -1
- package/testing/internal/disposables/spyOnConsole.js +0 -1
- package/testing/internal/disposables/spyOnConsole.js.map +1 -1
- package/testing/internal/incremental.d.ts +1 -1
- package/testing/internal/incremental.js.map +1 -1
- package/testing/internal/index.d.ts +4 -3
- package/testing/internal/index.js +4 -3
- package/testing/internal/index.js.map +1 -1
- package/testing/internal/renderHelpers.d.ts +3 -3
- package/testing/internal/renderHelpers.js.map +1 -1
- package/testing/internal/resetApolloContext.d.ts +10 -0
- package/testing/internal/resetApolloContext.js +20 -0
- package/testing/internal/resetApolloContext.js.map +1 -0
- package/testing/internal/scenarios/index.d.ts +6 -8
- package/testing/internal/scenarios/index.js +4 -2
- package/testing/internal/scenarios/index.js.map +1 -1
- package/testing/matchers/arrayWithLength.d.ts +3 -0
- package/testing/matchers/arrayWithLength.js +11 -0
- package/testing/matchers/arrayWithLength.js.map +1 -0
- package/testing/matchers/index.js +6 -18
- package/testing/matchers/index.js.map +1 -1
- package/testing/matchers/toComplete.js.map +1 -1
- package/testing/matchers/toEmitAnything.js.map +1 -1
- package/testing/matchers/toEmitError.js.map +1 -1
- package/testing/matchers/toEmitNext.js.map +1 -1
- package/testing/matchers/{toEmitValueStrict.d.ts → toEmitTypedValue.d.ts} +2 -2
- package/testing/matchers/{toEmitFetchResult.js → toEmitTypedValue.js} +7 -5
- package/testing/matchers/toEmitTypedValue.js.map +1 -0
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +1 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +1 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
- package/testing/matchers/toMatchDocument.d.ts +1 -1
- package/testing/matchers/toMatchDocument.js.map +1 -1
- package/testing/matchers/toStrictEqualTyped.d.ts +3 -0
- package/testing/matchers/toStrictEqualTyped.js +22 -0
- package/testing/matchers/toStrictEqualTyped.js.map +1 -0
- package/testing/matchers/utils/getSerializableProperties.d.ts +2 -0
- package/testing/matchers/utils/getSerializableProperties.js +20 -0
- package/testing/matchers/utils/getSerializableProperties.js.map +1 -0
- package/testing/react/MockedProvider.d.ts +8 -6
- package/testing/react/MockedProvider.js +8 -4
- package/testing/react/MockedProvider.js.map +1 -1
- package/utilities/caching/sizes.d.ts +2 -20
- package/utilities/caching/sizes.js +2 -2
- package/utilities/caching/sizes.js.map +1 -1
- package/utilities/common/canonicalStringify.js +1 -1
- package/utilities/common/canonicalStringify.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts +1 -0
- package/utilities/common/maybeDeepFreeze.js +1 -0
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeOptions.d.ts +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts +2 -2
- package/utilities/graphql/getFromAST.js +15 -6
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/operations.d.ts +1 -1
- package/utilities/graphql/operations.js.map +1 -1
- package/utilities/graphql/print.js +1 -1
- package/utilities/graphql/print.js.map +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/index.d.ts +16 -15
- package/utilities/index.js +12 -12
- package/utilities/index.js.map +1 -1
- package/utilities/{caching → internal}/getMemoryInternals.d.ts +0 -1
- package/utilities/{caching → internal}/getMemoryInternals.js +1 -3
- package/utilities/internal/getMemoryInternals.js.map +1 -0
- package/utilities/internal/index.d.ts +2 -0
- package/utilities/internal/index.js +2 -0
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/index.production.d.ts +3 -0
- package/utilities/internal/index.production.js +7 -0
- package/utilities/internal/index.production.js.map +1 -0
- package/utilities/internal/toQueryResult.d.ts +3 -0
- package/utilities/internal/toQueryResult.js +10 -0
- package/utilities/internal/toQueryResult.js.map +1 -0
- package/utilities/invariant/index.development.js +1 -0
- package/utilities/invariant/index.development.js.map +1 -1
- package/utilities/subscriptions/relay/index.d.ts +1 -1
- package/utilities/subscriptions/relay/index.js +1 -1
- package/utilities/subscriptions/relay/index.js.map +1 -1
- package/utilities/types/NoInfer.d.ts +1 -1
- package/utilities/types/VariablesOption.d.ts +25 -0
- package/utilities/types/VariablesOption.js +2 -0
- package/utilities/types/VariablesOption.js.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/__cjs/cache/inmemory/fixPolyfills.cjs +0 -10
- package/__cjs/cache/inmemory/fixPolyfills.cjs.map +0 -1
- package/__cjs/cache/inmemory/fixPolyfills.d.cts +0 -2
- package/__cjs/cache/inmemory/fixPolyfills.native.cjs +0 -53
- package/__cjs/cache/inmemory/fixPolyfills.native.cjs.map +0 -1
- package/__cjs/cache/inmemory/fixPolyfills.native.d.cts +0 -2
- package/__cjs/cache/inmemory/object-canon.cjs +0 -180
- package/__cjs/cache/inmemory/object-canon.cjs.map +0 -1
- package/__cjs/cache/inmemory/object-canon.d.cts +0 -12
- package/__cjs/index.cjs +0 -8
- package/__cjs/index.cjs.map +0 -1
- package/__cjs/index.d.cts +0 -3
- package/__cjs/link/http/iterators/async.cjs +0 -19
- package/__cjs/link/http/iterators/async.cjs.map +0 -1
- package/__cjs/link/http/iterators/async.d.cts +0 -6
- package/__cjs/link/http/iterators/nodeStream.cjs +0 -75
- package/__cjs/link/http/iterators/nodeStream.cjs.map +0 -1
- package/__cjs/link/http/iterators/nodeStream.d.cts +0 -7
- package/__cjs/link/http/iterators/promise.cjs +0 -32
- package/__cjs/link/http/iterators/promise.cjs.map +0 -1
- package/__cjs/link/http/iterators/promise.d.cts +0 -6
- package/__cjs/link/http/iterators/reader.cjs +0 -19
- package/__cjs/link/http/iterators/reader.cjs.map +0 -1
- package/__cjs/link/http/iterators/reader.d.cts +0 -6
- package/__cjs/link/http/responseIterator.cjs +0 -50
- package/__cjs/link/http/responseIterator.cjs.map +0 -1
- package/__cjs/link/http/responseIterator.d.cts +0 -7
- package/__cjs/react/context/index.cjs +0 -10
- package/__cjs/react/context/index.cjs.map +0 -1
- package/__cjs/react/context/index.d.cts +0 -7
- package/__cjs/react/hooks/index.cjs +0 -27
- package/__cjs/react/hooks/index.cjs.map +0 -1
- package/__cjs/react/hooks/index.d.cts +0 -22
- package/__cjs/react/parser/index.cjs +0 -115
- package/__cjs/react/parser/index.cjs.map +0 -1
- package/__cjs/react/parser/index.d.cts +0 -18
- package/__cjs/react/ssr/RenderPromises.cjs +0 -104
- package/__cjs/react/ssr/RenderPromises.cjs.map +0 -1
- package/__cjs/react/ssr/RenderPromises.d.cts +0 -22
- package/__cjs/react/types/types.d.cts +0 -689
- package/__cjs/testing/matchers/toEmitApolloQueryResult.cjs +0 -40
- package/__cjs/testing/matchers/toEmitApolloQueryResult.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitApolloQueryResult.d.cts +0 -8
- package/__cjs/testing/matchers/toEmitFetchResult.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitFetchResult.d.cts +0 -8
- package/__cjs/testing/matchers/toEmitMatchedValue.cjs +0 -40
- package/__cjs/testing/matchers/toEmitMatchedValue.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitMatchedValue.d.cts +0 -7
- package/__cjs/testing/matchers/toEmitValue.cjs +0 -41
- package/__cjs/testing/matchers/toEmitValue.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitValue.d.cts +0 -4
- package/__cjs/testing/matchers/toEmitValueStrict.cjs +0 -46
- package/__cjs/testing/matchers/toEmitValueStrict.cjs.map +0 -1
- package/__cjs/testing/matchers/toEqualApolloQueryResult.cjs +0 -24
- package/__cjs/testing/matchers/toEqualApolloQueryResult.cjs.map +0 -1
- package/__cjs/testing/matchers/toEqualApolloQueryResult.d.cts +0 -6
- package/__cjs/testing/matchers/toEqualFetchResult.cjs +0 -24
- package/__cjs/testing/matchers/toEqualFetchResult.cjs.map +0 -1
- package/__cjs/testing/matchers/toEqualFetchResult.d.cts +0 -4
- package/__cjs/testing/matchers/toEqualLazyQueryResult.cjs +0 -40
- package/__cjs/testing/matchers/toEqualLazyQueryResult.cjs.map +0 -1
- package/__cjs/testing/matchers/toEqualLazyQueryResult.d.cts +0 -10
- package/__cjs/testing/matchers/toEqualQueryResult.cjs +0 -40
- package/__cjs/testing/matchers/toEqualQueryResult.cjs.map +0 -1
- package/__cjs/testing/matchers/toEqualQueryResult.d.cts +0 -9
- package/__cjs/utilities/caching/getMemoryInternals.cjs.map +0 -1
- package/__cjs/utilities/types/OnlyRequiredProperties.cjs.map +0 -1
- package/__cjs/utilities/types/OnlyRequiredProperties.d.cts +0 -7
- package/__cjs/utilities/types/TODO.cjs.map +0 -1
- package/__cjs/utilities/types/TODO.d.cts +0 -3
- package/cache/inmemory/fixPolyfills.d.ts +0 -2
- package/cache/inmemory/fixPolyfills.js +0 -10
- package/cache/inmemory/fixPolyfills.js.map +0 -1
- package/cache/inmemory/fixPolyfills.native.d.ts +0 -2
- package/cache/inmemory/fixPolyfills.native.js +0 -53
- package/cache/inmemory/fixPolyfills.native.js.map +0 -1
- package/cache/inmemory/object-canon.d.ts +0 -12
- package/cache/inmemory/object-canon.js +0 -176
- package/cache/inmemory/object-canon.js.map +0 -1
- package/index.d.ts +0 -3
- package/index.js +0 -3
- package/index.js.map +0 -1
- package/legacyEntryPoints/react/context/context.cjs +0 -1
- package/legacyEntryPoints/react/context/context.d.cts +0 -1
- package/legacyEntryPoints/react/context/index.d.ts +0 -1
- package/legacyEntryPoints/react/context/index.js +0 -1
- package/legacyEntryPoints/react/hooks/hooks.cjs +0 -1
- package/legacyEntryPoints/react/hooks/hooks.d.cts +0 -1
- package/legacyEntryPoints/react/hooks/index.d.ts +0 -1
- package/legacyEntryPoints/react/hooks/index.js +0 -1
- package/legacyEntryPoints/react/parser/index.d.ts +0 -1
- package/legacyEntryPoints/react/parser/index.js +0 -1
- package/legacyEntryPoints/react/parser/parser.cjs +0 -1
- package/legacyEntryPoints/react/parser/parser.d.cts +0 -1
- package/link/http/iterators/async.d.ts +0 -6
- package/link/http/iterators/async.js +0 -16
- package/link/http/iterators/async.js.map +0 -1
- package/link/http/iterators/nodeStream.d.ts +0 -7
- package/link/http/iterators/nodeStream.js +0 -72
- package/link/http/iterators/nodeStream.js.map +0 -1
- package/link/http/iterators/promise.d.ts +0 -6
- package/link/http/iterators/promise.js +0 -29
- package/link/http/iterators/promise.js.map +0 -1
- package/link/http/iterators/reader.d.ts +0 -6
- package/link/http/iterators/reader.js +0 -16
- package/link/http/iterators/reader.js.map +0 -1
- package/link/http/responseIterator.d.ts +0 -7
- package/link/http/responseIterator.js +0 -46
- package/link/http/responseIterator.js.map +0 -1
- package/react/context/index.d.ts +0 -7
- package/react/context/index.js +0 -4
- package/react/context/index.js.map +0 -1
- package/react/hooks/index.d.ts +0 -22
- package/react/hooks/index.js +0 -15
- package/react/hooks/index.js.map +0 -1
- package/react/parser/index.d.ts +0 -18
- package/react/parser/index.js +0 -109
- package/react/parser/index.js.map +0 -1
- package/react/ssr/RenderPromises.d.ts +0 -22
- package/react/ssr/RenderPromises.js +0 -100
- package/react/ssr/RenderPromises.js.map +0 -1
- package/react/types/types.d.ts +0 -689
- package/testing/matchers/toEmitApolloQueryResult.d.ts +0 -8
- package/testing/matchers/toEmitApolloQueryResult.js +0 -36
- package/testing/matchers/toEmitApolloQueryResult.js.map +0 -1
- package/testing/matchers/toEmitFetchResult.d.ts +0 -8
- package/testing/matchers/toEmitFetchResult.js.map +0 -1
- package/testing/matchers/toEmitMatchedValue.d.ts +0 -7
- package/testing/matchers/toEmitMatchedValue.js +0 -36
- package/testing/matchers/toEmitMatchedValue.js.map +0 -1
- package/testing/matchers/toEmitValue.d.ts +0 -4
- package/testing/matchers/toEmitValue.js +0 -37
- package/testing/matchers/toEmitValue.js.map +0 -1
- package/testing/matchers/toEmitValueStrict.js +0 -42
- package/testing/matchers/toEmitValueStrict.js.map +0 -1
- package/testing/matchers/toEqualApolloQueryResult.d.ts +0 -6
- package/testing/matchers/toEqualApolloQueryResult.js +0 -20
- package/testing/matchers/toEqualApolloQueryResult.js.map +0 -1
- package/testing/matchers/toEqualFetchResult.d.ts +0 -4
- package/testing/matchers/toEqualFetchResult.js +0 -20
- package/testing/matchers/toEqualFetchResult.js.map +0 -1
- package/testing/matchers/toEqualLazyQueryResult.d.ts +0 -10
- package/testing/matchers/toEqualLazyQueryResult.js +0 -36
- package/testing/matchers/toEqualLazyQueryResult.js.map +0 -1
- package/testing/matchers/toEqualQueryResult.d.ts +0 -9
- package/testing/matchers/toEqualQueryResult.js +0 -36
- package/testing/matchers/toEqualQueryResult.js.map +0 -1
- package/utilities/caching/getMemoryInternals.js.map +0 -1
- package/utilities/types/OnlyRequiredProperties.d.ts +0 -7
- package/utilities/types/OnlyRequiredProperties.js +0 -2
- package/utilities/types/OnlyRequiredProperties.js.map +0 -1
- package/utilities/types/TODO.d.ts +0 -3
- package/utilities/types/TODO.js +0 -2
- package/utilities/types/TODO.js.map +0 -1
- /package/__cjs/react/{types → internal}/types.cjs +0 -0
- /package/__cjs/react/{types → internal}/types.cjs.map +0 -0
- /package/react/{types → internal}/types.js +0 -0
- /package/react/{types → internal}/types.js.map +0 -0
|
@@ -1,6 +1,270 @@
|
|
|
1
|
-
import type { OperationVariables } from "@apollo/client
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
1
|
+
import type { ApolloClient, ApolloQueryResult, DefaultContext, DocumentNode, ErrorLike, ErrorPolicy, FetchMoreQueryOptions, OperationVariables, QueryResult, RefetchWritePolicy, SubscribeToMoreFunction, TypedDocumentNode, UpdateQueryMapFn, WatchQueryFetchPolicy, WatchQueryOptions } from "@apollo/client";
|
|
2
|
+
import { NetworkStatus, ObservableQuery } from "@apollo/client";
|
|
3
|
+
import type { MaybeMasked, Unmasked } from "@apollo/client/masking";
|
|
4
|
+
import type { NoInfer, VariablesOption } from "@apollo/client/utilities";
|
|
5
|
+
import type { NextFetchPolicyContext } from "../../core/watchQueryOptions.js";
|
|
6
|
+
export declare namespace useQuery {
|
|
7
|
+
type Options<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
|
|
8
|
+
/**
|
|
9
|
+
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
|
|
10
|
+
*
|
|
11
|
+
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
|
|
12
|
+
*
|
|
13
|
+
* The default value is `cache-first`.
|
|
14
|
+
*
|
|
15
|
+
* @docGroup
|
|
16
|
+
*
|
|
17
|
+
* 3. Caching options
|
|
18
|
+
*/
|
|
19
|
+
fetchPolicy?: WatchQueryFetchPolicy;
|
|
20
|
+
/**
|
|
21
|
+
* Specifies the `FetchPolicy` to be used after this query has completed.
|
|
22
|
+
*
|
|
23
|
+
* @docGroup
|
|
24
|
+
*
|
|
25
|
+
* 3. Caching options
|
|
26
|
+
*/
|
|
27
|
+
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TVariables, TData>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
|
|
28
|
+
/**
|
|
29
|
+
* Defaults to the initial value of options.fetchPolicy, but can be explicitly configured to specify the WatchQueryFetchPolicy to revert back to whenever variables change (unless nextFetchPolicy intervenes).
|
|
30
|
+
*
|
|
31
|
+
* @docGroup
|
|
32
|
+
*
|
|
33
|
+
* 3. Caching options
|
|
34
|
+
*/
|
|
35
|
+
initialFetchPolicy?: WatchQueryFetchPolicy;
|
|
36
|
+
/**
|
|
37
|
+
* Specifies whether a `NetworkStatus.refetch` operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
|
|
38
|
+
*
|
|
39
|
+
* @docGroup
|
|
40
|
+
*
|
|
41
|
+
* 3. Caching options
|
|
42
|
+
*/
|
|
43
|
+
refetchWritePolicy?: RefetchWritePolicy;
|
|
44
|
+
/**
|
|
45
|
+
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
|
|
46
|
+
*
|
|
47
|
+
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
|
|
48
|
+
*
|
|
49
|
+
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
50
|
+
*
|
|
51
|
+
* @docGroup
|
|
52
|
+
*
|
|
53
|
+
* 1. Operation options
|
|
54
|
+
*/
|
|
55
|
+
errorPolicy?: ErrorPolicy;
|
|
56
|
+
/**
|
|
57
|
+
* Specifies the interval (in milliseconds) at which the query polls for updated results.
|
|
58
|
+
*
|
|
59
|
+
* The default value is `0` (no polling).
|
|
60
|
+
*
|
|
61
|
+
* @docGroup
|
|
62
|
+
*
|
|
63
|
+
* 2. Networking options
|
|
64
|
+
*/
|
|
65
|
+
pollInterval?: number;
|
|
66
|
+
/**
|
|
67
|
+
* If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.
|
|
68
|
+
*
|
|
69
|
+
* The default value is `true`.
|
|
70
|
+
*
|
|
71
|
+
* @docGroup
|
|
72
|
+
*
|
|
73
|
+
* 2. Networking options
|
|
74
|
+
*/
|
|
75
|
+
notifyOnNetworkStatusChange?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
|
|
78
|
+
*
|
|
79
|
+
* The default value is `false`.
|
|
80
|
+
*
|
|
81
|
+
* @docGroup
|
|
82
|
+
*
|
|
83
|
+
* 3. Caching options
|
|
84
|
+
*/
|
|
85
|
+
returnPartialData?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* A callback function that's called whenever a refetch attempt occurs while polling. If the function returns `true`, the refetch is skipped and not reattempted until the next poll interval.
|
|
88
|
+
*
|
|
89
|
+
* @docGroup
|
|
90
|
+
*
|
|
91
|
+
* 2. Networking options
|
|
92
|
+
*/
|
|
93
|
+
skipPollAttempt?: () => boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Pass `false` to skip executing the query during [server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering/).
|
|
96
|
+
*
|
|
97
|
+
* @docGroup
|
|
98
|
+
*
|
|
99
|
+
* 2. Networking options
|
|
100
|
+
*/
|
|
101
|
+
ssr?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* The instance of `ApolloClient` to use to execute the query.
|
|
104
|
+
*
|
|
105
|
+
* By default, the instance that's passed down via context is used, but you can provide a different instance here.
|
|
106
|
+
*
|
|
107
|
+
* @docGroup
|
|
108
|
+
*
|
|
109
|
+
* 1. Operation options
|
|
110
|
+
*/
|
|
111
|
+
client?: ApolloClient;
|
|
112
|
+
/**
|
|
113
|
+
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
|
|
114
|
+
*
|
|
115
|
+
* @docGroup
|
|
116
|
+
*
|
|
117
|
+
* 2. Networking options
|
|
118
|
+
*/
|
|
119
|
+
context?: DefaultContext;
|
|
120
|
+
/**
|
|
121
|
+
* If true, the query is not executed.
|
|
122
|
+
*
|
|
123
|
+
* The default value is `false`.
|
|
124
|
+
*
|
|
125
|
+
* @docGroup
|
|
126
|
+
*
|
|
127
|
+
* 1. Operation options
|
|
128
|
+
*/
|
|
129
|
+
skip?: boolean;
|
|
130
|
+
} & VariablesOption<TVariables>;
|
|
131
|
+
interface Result<TData = unknown, TVariables extends OperationVariables = OperationVariables> {
|
|
132
|
+
/**
|
|
133
|
+
* The instance of Apollo Client that executed the query. Can be useful for manually executing followup queries or writing data to the cache.
|
|
134
|
+
*
|
|
135
|
+
* @docGroup
|
|
136
|
+
*
|
|
137
|
+
* 2. Network info
|
|
138
|
+
*/
|
|
139
|
+
client: ApolloClient;
|
|
140
|
+
/**
|
|
141
|
+
* A reference to the internal `ObservableQuery` used by the hook.
|
|
142
|
+
*/
|
|
143
|
+
observable: ObservableQuery<TData, TVariables>;
|
|
144
|
+
/**
|
|
145
|
+
* An object containing the result of your GraphQL query after it completes.
|
|
146
|
+
*
|
|
147
|
+
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
148
|
+
*
|
|
149
|
+
* @docGroup
|
|
150
|
+
*
|
|
151
|
+
* 1. Operation data
|
|
152
|
+
*/
|
|
153
|
+
data: MaybeMasked<TData> | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* An object containing the result from the most recent _previous_ execution of this query.
|
|
156
|
+
*
|
|
157
|
+
* This value is `undefined` if this is the query's first execution.
|
|
158
|
+
*
|
|
159
|
+
* @docGroup
|
|
160
|
+
*
|
|
161
|
+
* 1. Operation data
|
|
162
|
+
*/
|
|
163
|
+
previousData?: MaybeMasked<TData>;
|
|
164
|
+
/**
|
|
165
|
+
* If the query produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
|
|
166
|
+
*
|
|
167
|
+
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
168
|
+
*
|
|
169
|
+
* @docGroup
|
|
170
|
+
*
|
|
171
|
+
* 1. Operation data
|
|
172
|
+
*/
|
|
173
|
+
error?: ErrorLike;
|
|
174
|
+
/**
|
|
175
|
+
* If `true`, the query is still in flight and results have not yet been returned.
|
|
176
|
+
*
|
|
177
|
+
* @docGroup
|
|
178
|
+
*
|
|
179
|
+
* 2. Network info
|
|
180
|
+
*/
|
|
181
|
+
loading: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)
|
|
184
|
+
*
|
|
185
|
+
* Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
|
|
186
|
+
*
|
|
187
|
+
* @docGroup
|
|
188
|
+
*
|
|
189
|
+
* 2. Network info
|
|
190
|
+
*/
|
|
191
|
+
networkStatus: NetworkStatus;
|
|
192
|
+
/**
|
|
193
|
+
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
|
|
194
|
+
*
|
|
195
|
+
*
|
|
196
|
+
* @docGroup
|
|
197
|
+
*
|
|
198
|
+
* 3. Helper functions
|
|
199
|
+
*/
|
|
200
|
+
startPolling: (pollInterval: number) => void;
|
|
201
|
+
/**
|
|
202
|
+
* A function that instructs the query to stop polling after a previous call to `startPolling`.
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
* @docGroup
|
|
206
|
+
*
|
|
207
|
+
* 3. Helper functions
|
|
208
|
+
*/
|
|
209
|
+
stopPolling: () => void;
|
|
210
|
+
/**
|
|
211
|
+
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
|
|
212
|
+
*
|
|
213
|
+
* This function returns _another_ function that you can call to terminate the subscription.
|
|
214
|
+
*
|
|
215
|
+
*
|
|
216
|
+
* @docGroup
|
|
217
|
+
*
|
|
218
|
+
* 3. Helper functions
|
|
219
|
+
*/
|
|
220
|
+
subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
|
|
221
|
+
/**
|
|
222
|
+
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
|
|
223
|
+
*
|
|
224
|
+
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
|
|
225
|
+
*
|
|
226
|
+
*
|
|
227
|
+
* @docGroup
|
|
228
|
+
*
|
|
229
|
+
* 3. Helper functions
|
|
230
|
+
*/
|
|
231
|
+
updateQuery: (mapFn: UpdateQueryMapFn<TData, TVariables>) => void;
|
|
232
|
+
/**
|
|
233
|
+
* A function that enables you to re-execute the query, optionally passing in new `variables`.
|
|
234
|
+
*
|
|
235
|
+
* To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).
|
|
236
|
+
*
|
|
237
|
+
* See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).
|
|
238
|
+
*
|
|
239
|
+
* @docGroup
|
|
240
|
+
*
|
|
241
|
+
* 3. Helper functions
|
|
242
|
+
*/
|
|
243
|
+
refetch: (variables?: Partial<TVariables>) => Promise<QueryResult<MaybeMasked<TData>>>;
|
|
244
|
+
/**
|
|
245
|
+
* An object containing the variables that were provided for the query.
|
|
246
|
+
*
|
|
247
|
+
* @docGroup
|
|
248
|
+
*
|
|
249
|
+
* 1. Operation data
|
|
250
|
+
*/
|
|
251
|
+
variables: TVariables;
|
|
252
|
+
/**
|
|
253
|
+
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
|
|
254
|
+
*
|
|
255
|
+
*
|
|
256
|
+
* @docGroup
|
|
257
|
+
*
|
|
258
|
+
* 3. Helper functions
|
|
259
|
+
*/
|
|
260
|
+
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
|
|
261
|
+
updateQuery?: (previousQueryResult: Unmasked<TData>, options: {
|
|
262
|
+
fetchMoreResult: Unmasked<TFetchData>;
|
|
263
|
+
variables: TFetchVars;
|
|
264
|
+
}) => Unmasked<TData>;
|
|
265
|
+
}) => Promise<QueryResult<MaybeMasked<TFetchData>>>;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
4
268
|
/**
|
|
5
269
|
* A hook for executing queries in an Apollo application.
|
|
6
270
|
*
|
|
@@ -35,5 +299,11 @@ import type { NoInfer, QueryHookOptions, QueryResult } from "@apollo/client/reac
|
|
|
35
299
|
* @param options - Options to control how the query is executed.
|
|
36
300
|
* @returns Query result object
|
|
37
301
|
*/
|
|
38
|
-
export declare function useQuery<TData =
|
|
302
|
+
export declare function useQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: {} extends TVariables ? [
|
|
303
|
+
options?: useQuery.Options<NoInfer<TData>, NoInfer<TVariables>>
|
|
304
|
+
] : [options: useQuery.Options<NoInfer<TData>, NoInfer<TVariables>>]): useQuery.Result<TData, TVariables>;
|
|
305
|
+
export declare namespace useQuery {
|
|
306
|
+
var ssrDisabledResult: ApolloQueryResult<any>;
|
|
307
|
+
var skipStandbyResult: ApolloQueryResult<any>;
|
|
308
|
+
}
|
|
39
309
|
//# sourceMappingURL=useQuery.d.ts.map
|
package/react/hooks/useQuery.js
CHANGED
|
@@ -9,20 +9,13 @@
|
|
|
9
9
|
* options
|
|
10
10
|
* watchQueryOptions
|
|
11
11
|
* makeWatchQueryOptions
|
|
12
|
-
* isSSRAllowed
|
|
13
|
-
* disableNetworkFetches
|
|
14
|
-
* renderPromises
|
|
15
|
-
* isSyncSSR
|
|
16
12
|
*/
|
|
17
13
|
/** */
|
|
18
14
|
import { equal } from "@wry/equality";
|
|
19
|
-
import * as React from "
|
|
15
|
+
import * as React from "react";
|
|
20
16
|
import { asapScheduler, observeOn } from "rxjs";
|
|
21
|
-
import { NetworkStatus } from "@apollo/client
|
|
22
|
-
import {
|
|
23
|
-
import { DocumentType, verifyDocumentType } from "@apollo/client/react/parser";
|
|
24
|
-
import { compact, maybeDeepFreeze } from "@apollo/client/utilities";
|
|
25
|
-
import { mergeOptions } from "@apollo/client/utilities";
|
|
17
|
+
import { NetworkStatus, ObservableQuery } from "@apollo/client";
|
|
18
|
+
import { maybeDeepFreeze, mergeOptions } from "@apollo/client/utilities";
|
|
26
19
|
import { wrapHook } from "./internal/index.js";
|
|
27
20
|
import { useApolloClient } from "./useApolloClient.js";
|
|
28
21
|
import { useSyncExternalStore } from "./useSyncExternalStore.js";
|
|
@@ -61,97 +54,99 @@ const lastWatchOptions = Symbol();
|
|
|
61
54
|
* @param options - Options to control how the query is executed.
|
|
62
55
|
* @returns Query result object
|
|
63
56
|
*/
|
|
64
|
-
export function useQuery(query, options
|
|
57
|
+
export function useQuery(query, ...[options]) {
|
|
58
|
+
"use no memo";
|
|
65
59
|
return wrapHook("useQuery",
|
|
66
60
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
67
61
|
useQuery_, useApolloClient(options && options.client))(query, options);
|
|
68
62
|
}
|
|
69
|
-
function useQuery_(query, options) {
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
function useQuery_(query, options = {}) {
|
|
64
|
+
const client = useApolloClient(options.client);
|
|
65
|
+
const { skip, ssr, ...opts } = options;
|
|
66
|
+
const watchQueryOptions = mergeOptions(client.defaultOptions.watchQuery, { ...opts, query });
|
|
67
|
+
if (skip) {
|
|
68
|
+
// When skipping, we set watchQueryOptions.fetchPolicy initially to
|
|
69
|
+
// "standby", but we also need/want to preserve the initial non-standby
|
|
70
|
+
// fetchPolicy that would have been used if not skipping.
|
|
71
|
+
watchQueryOptions.initialFetchPolicy =
|
|
72
|
+
options.initialFetchPolicy || options.fetchPolicy;
|
|
73
|
+
watchQueryOptions.fetchPolicy = "standby";
|
|
74
|
+
}
|
|
75
|
+
function createState(previous) {
|
|
76
|
+
const observable = ObservableQuery["inactiveOnCreation"].withValue(true, () => client.watchQuery(watchQueryOptions));
|
|
77
|
+
return {
|
|
78
78
|
client,
|
|
79
79
|
query,
|
|
80
|
-
observable
|
|
81
|
-
// See if there is an existing observable that was used to fetch the same
|
|
82
|
-
// data and if so, use it instead since it will contain the proper queryId
|
|
83
|
-
// to fetch the result set. This is used during SSR.
|
|
84
|
-
(renderPromises &&
|
|
85
|
-
renderPromises.getSSRObservable(makeWatchQueryOptions())) ||
|
|
86
|
-
client.watchQuery(getObsQueryOptions(void 0, client, options, makeWatchQueryOptions())),
|
|
80
|
+
observable,
|
|
87
81
|
resultData: {
|
|
82
|
+
current: observable.getCurrentResult(),
|
|
88
83
|
// Reuse previousData from previous InternalState (if any) to provide
|
|
89
84
|
// continuity of previousData even if/when the query or client changes.
|
|
90
|
-
previousData: previous?.resultData.current
|
|
85
|
+
previousData: previous?.resultData.current.data,
|
|
91
86
|
},
|
|
92
87
|
};
|
|
93
|
-
return internalState;
|
|
94
88
|
}
|
|
95
|
-
let [
|
|
96
|
-
if (client !==
|
|
89
|
+
let [state, setState] = React.useState(createState);
|
|
90
|
+
if (client !== state.client || query !== state.query) {
|
|
97
91
|
// If the client or query have changed, we need to create a new InternalState.
|
|
98
92
|
// This will trigger a re-render with the new state, but it will also continue
|
|
99
93
|
// to run the current render function to completion.
|
|
100
94
|
// Since we sometimes trigger some side-effects in the render function, we
|
|
101
95
|
// re-assign `state` to the new state to ensure that those side-effects are
|
|
102
96
|
// triggered with the new state.
|
|
103
|
-
|
|
104
|
-
updateInternalState(newInternalState);
|
|
105
|
-
return newInternalState;
|
|
97
|
+
setState((state = createState(state)));
|
|
106
98
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
function useQueryInternals(query, options) {
|
|
110
|
-
const client = useApolloClient(options.client);
|
|
111
|
-
const renderPromises = React.useContext(getApolloContext()).renderPromises;
|
|
112
|
-
const isSyncSSR = !!renderPromises;
|
|
113
|
-
const disableNetworkFetches = client.disableNetworkFetches;
|
|
114
|
-
const ssrAllowed = options.ssr !== false && !options.skip;
|
|
115
|
-
const makeWatchQueryOptions = createMakeWatchQueryOptions(client, query, options, isSyncSSR);
|
|
116
|
-
const { observable, resultData } = useInternalState(client, query, options, renderPromises, makeWatchQueryOptions);
|
|
117
|
-
const watchQueryOptions = makeWatchQueryOptions(observable);
|
|
99
|
+
const { observable, resultData } = state;
|
|
100
|
+
useInitialFetchPolicyIfNecessary(watchQueryOptions, observable);
|
|
118
101
|
useResubscribeIfNecessary(resultData, // might get mutated during render
|
|
119
102
|
observable, // might get mutated during render
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
: void 0;
|
|
103
|
+
watchQueryOptions);
|
|
104
|
+
const ssrDisabledOverride = useSyncExternalStore(() => () => { }, () => void 0, () => (ssr === false ? useQuery.ssrDisabledResult : void 0));
|
|
105
|
+
const resultOverride = skip || watchQueryOptions.fetchPolicy === "standby" ?
|
|
106
|
+
// When skipping a query (ie. we're not querying for data but still want to
|
|
107
|
+
// render children), make sure the `data` is cleared out and `loading` is
|
|
108
|
+
// set to `false` (since we aren't loading anything).
|
|
109
|
+
//
|
|
110
|
+
// NOTE: We no longer think this is the correct behavior. Skipping should
|
|
111
|
+
// not automatically set `data` to `undefined`, but instead leave the
|
|
112
|
+
// previous data in place. In other words, skipping should not mandate that
|
|
113
|
+
// previously received data is all of a sudden removed. Unfortunately,
|
|
114
|
+
// changing this is breaking, so we'll have to wait until Apollo Client 4.0
|
|
115
|
+
// to address this.
|
|
116
|
+
useQuery.skipStandbyResult
|
|
117
|
+
: ssrDisabledOverride;
|
|
118
|
+
const result = useResultSubscription(observable, resultData, resultOverride);
|
|
119
|
+
const obsQueryFields = React.useMemo(() => ({
|
|
120
|
+
refetch: observable.refetch.bind(observable),
|
|
121
|
+
fetchMore: observable.fetchMore.bind(observable),
|
|
122
|
+
updateQuery: observable.updateQuery.bind(observable),
|
|
123
|
+
startPolling: observable.startPolling.bind(observable),
|
|
124
|
+
stopPolling: observable.stopPolling.bind(observable),
|
|
125
|
+
subscribeToMore: observable.subscribeToMore.bind(observable),
|
|
126
|
+
}), [observable]);
|
|
145
127
|
const previousData = resultData.previousData;
|
|
146
|
-
|
|
147
|
-
|
|
128
|
+
return React.useMemo(() => {
|
|
129
|
+
const { data, partial, ...rest } = result;
|
|
130
|
+
return {
|
|
131
|
+
data, // Ensure always defined, even if result.data is missing.
|
|
132
|
+
...rest,
|
|
133
|
+
client: client,
|
|
134
|
+
observable: observable,
|
|
135
|
+
variables: observable.variables,
|
|
136
|
+
previousData,
|
|
137
|
+
...obsQueryFields,
|
|
138
|
+
};
|
|
139
|
+
}, [result, client, observable, previousData, obsQueryFields]);
|
|
140
|
+
}
|
|
141
|
+
function useInitialFetchPolicyIfNecessary(watchQueryOptions, observable) {
|
|
142
|
+
"use no memo";
|
|
143
|
+
if (!watchQueryOptions.fetchPolicy) {
|
|
144
|
+
watchQueryOptions.fetchPolicy = observable.options.initialFetchPolicy;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function useResultSubscription(observable, resultData, resultOverride) {
|
|
148
|
+
"use no memo";
|
|
148
149
|
return useSyncExternalStore(React.useCallback((handleStoreChange) => {
|
|
149
|
-
// reference `disableNetworkFetches` here to ensure that the rules of hooks
|
|
150
|
-
// keep it as a dependency of this effect, even though it's not used
|
|
151
|
-
disableNetworkFetches;
|
|
152
|
-
if (isSyncSSR) {
|
|
153
|
-
return () => { };
|
|
154
|
-
}
|
|
155
150
|
const subscription = observable
|
|
156
151
|
// We use the asapScheduler here to prevent issues with trying to
|
|
157
152
|
// update in the middle of a render. `reobserve` is kicked off in the
|
|
@@ -172,7 +167,12 @@ function useObservableSubscriptionResult(resultData, observable, client, options
|
|
|
172
167
|
equal(previousResult.error, result.error)) {
|
|
173
168
|
return;
|
|
174
169
|
}
|
|
175
|
-
|
|
170
|
+
if (previousResult && previousResult.data) {
|
|
171
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
172
|
+
resultData.previousData = previousResult.data;
|
|
173
|
+
}
|
|
174
|
+
resultData.current = result;
|
|
175
|
+
handleStoreChange();
|
|
176
176
|
});
|
|
177
177
|
// Do the "unsubscribe" with a short delay.
|
|
178
178
|
// This way, an existing subscription can be reused without an additional
|
|
@@ -181,16 +181,7 @@ function useObservableSubscriptionResult(resultData, observable, client, options
|
|
|
181
181
|
return () => {
|
|
182
182
|
setTimeout(() => subscription.unsubscribe());
|
|
183
183
|
};
|
|
184
|
-
}, [
|
|
185
|
-
}
|
|
186
|
-
function useRegisterSSRObservable(observable, renderPromises, ssrAllowed) {
|
|
187
|
-
if (renderPromises && ssrAllowed) {
|
|
188
|
-
renderPromises.registerSSRObservable(observable);
|
|
189
|
-
if (observable.getCurrentResult().loading) {
|
|
190
|
-
// TODO: This is a legacy API which could probably be cleaned up
|
|
191
|
-
renderPromises.addObservableQueryPromise(observable);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
184
|
+
}, [observable, resultData]), () => resultOverride || resultData.current, () => resultOverride || resultData.current);
|
|
194
185
|
}
|
|
195
186
|
// this hook is not compatible with any rules of React, and there's no good way to rewrite it.
|
|
196
187
|
// it should stay a separate hook that will not be optimized by the compiler
|
|
@@ -198,7 +189,8 @@ function useResubscribeIfNecessary(
|
|
|
198
189
|
/** this hook will mutate properties on `resultData` */
|
|
199
190
|
resultData,
|
|
200
191
|
/** this hook will mutate properties on `observable` */
|
|
201
|
-
observable,
|
|
192
|
+
observable, watchQueryOptions) {
|
|
193
|
+
"use no memo";
|
|
202
194
|
if (observable[lastWatchOptions] &&
|
|
203
195
|
!equal(observable[lastWatchOptions], watchQueryOptions)) {
|
|
204
196
|
// Though it might be tempting to postpone this reobserve call to the
|
|
@@ -209,139 +201,28 @@ observable, client, options, watchQueryOptions) {
|
|
|
209
201
|
// subscriptions, though it does feel less than ideal that reobserve
|
|
210
202
|
// (potentially) kicks off a network request (for example, when the
|
|
211
203
|
// variables have changed), which is technically a side-effect.
|
|
212
|
-
observable.reobserve(
|
|
204
|
+
observable.reobserve(watchQueryOptions);
|
|
213
205
|
// Make sure getCurrentResult returns a fresh ApolloQueryResult<TData>,
|
|
214
206
|
// but save the current data as this.previousData, just like setResult
|
|
215
207
|
// usually does.
|
|
216
208
|
resultData.previousData =
|
|
217
|
-
resultData.current
|
|
218
|
-
resultData.current =
|
|
209
|
+
resultData.current.data || resultData.previousData;
|
|
210
|
+
resultData.current = observable.getCurrentResult();
|
|
219
211
|
}
|
|
220
212
|
observable[lastWatchOptions] = watchQueryOptions;
|
|
221
213
|
}
|
|
222
|
-
|
|
223
|
-
* A function to massage options before passing them to ObservableQuery.
|
|
224
|
-
* This is two-step curried because we want to reuse the `make` function,
|
|
225
|
-
* but the `observable` might differ between calls to `make`.
|
|
226
|
-
*/
|
|
227
|
-
function createMakeWatchQueryOptions(client, query, { skip, ssr, defaultOptions,
|
|
228
|
-
// The above options are useQuery-specific, so this ...otherOptions spread
|
|
229
|
-
// makes otherOptions almost a WatchQueryOptions object, except for the
|
|
230
|
-
// query property that we add below.
|
|
231
|
-
...otherOptions } = {}, isSyncSSR) {
|
|
232
|
-
return (observable) => {
|
|
233
|
-
// This Object.assign is safe because otherOptions is a fresh ...rest object
|
|
234
|
-
// that did not exist until just now, so modifications are still allowed.
|
|
235
|
-
const watchQueryOptions = Object.assign(otherOptions, { query });
|
|
236
|
-
if (isSyncSSR &&
|
|
237
|
-
(watchQueryOptions.fetchPolicy === "network-only" ||
|
|
238
|
-
watchQueryOptions.fetchPolicy === "cache-and-network")) {
|
|
239
|
-
// this behavior was added to react-apollo without explanation in this PR
|
|
240
|
-
// https://github.com/apollographql/react-apollo/pull/1579
|
|
241
|
-
watchQueryOptions.fetchPolicy = "cache-first";
|
|
242
|
-
}
|
|
243
|
-
if (!watchQueryOptions.variables) {
|
|
244
|
-
watchQueryOptions.variables = {};
|
|
245
|
-
}
|
|
246
|
-
if (skip) {
|
|
247
|
-
// When skipping, we set watchQueryOptions.fetchPolicy initially to
|
|
248
|
-
// "standby", but we also need/want to preserve the initial non-standby
|
|
249
|
-
// fetchPolicy that would have been used if not skipping.
|
|
250
|
-
watchQueryOptions.initialFetchPolicy =
|
|
251
|
-
watchQueryOptions.initialFetchPolicy ||
|
|
252
|
-
watchQueryOptions.fetchPolicy ||
|
|
253
|
-
getDefaultFetchPolicy(defaultOptions, client.defaultOptions);
|
|
254
|
-
watchQueryOptions.fetchPolicy = "standby";
|
|
255
|
-
}
|
|
256
|
-
else if (!watchQueryOptions.fetchPolicy) {
|
|
257
|
-
watchQueryOptions.fetchPolicy =
|
|
258
|
-
observable?.options.initialFetchPolicy ||
|
|
259
|
-
getDefaultFetchPolicy(defaultOptions, client.defaultOptions);
|
|
260
|
-
}
|
|
261
|
-
return watchQueryOptions;
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
function getObsQueryOptions(observable, client, queryHookOptions, watchQueryOptions) {
|
|
265
|
-
const toMerge = [];
|
|
266
|
-
const globalDefaults = client.defaultOptions.watchQuery;
|
|
267
|
-
if (globalDefaults)
|
|
268
|
-
toMerge.push(globalDefaults);
|
|
269
|
-
if (queryHookOptions.defaultOptions) {
|
|
270
|
-
toMerge.push(queryHookOptions.defaultOptions);
|
|
271
|
-
}
|
|
272
|
-
// We use compact rather than mergeOptions for this part of the merge,
|
|
273
|
-
// because we want watchQueryOptions.variables (if defined) to replace
|
|
274
|
-
// this.observable.options.variables whole. This replacement allows
|
|
275
|
-
// removing variables by removing them from the variables input to
|
|
276
|
-
// useQuery. If the variables were always merged together (rather than
|
|
277
|
-
// replaced), there would be no way to remove existing variables.
|
|
278
|
-
// However, the variables from options.defaultOptions and globalDefaults
|
|
279
|
-
// (if provided) should be merged, to ensure individual defaulted
|
|
280
|
-
// variables always have values, if not otherwise defined in
|
|
281
|
-
// observable.options or watchQueryOptions.
|
|
282
|
-
toMerge.push(compact(observable && observable.options, watchQueryOptions));
|
|
283
|
-
return toMerge.reduce(mergeOptions);
|
|
284
|
-
}
|
|
285
|
-
function setResult(nextResult, resultData, observable, client, forceUpdate) {
|
|
286
|
-
const previousResult = resultData.current;
|
|
287
|
-
if (previousResult && previousResult.data) {
|
|
288
|
-
resultData.previousData = previousResult.data;
|
|
289
|
-
}
|
|
290
|
-
resultData.current = toQueryResult(nextResult, resultData.previousData, observable, client);
|
|
291
|
-
// Calling state.setResult always triggers an update, though some call sites
|
|
292
|
-
// perform additional equality checks before committing to an update.
|
|
293
|
-
forceUpdate();
|
|
294
|
-
}
|
|
295
|
-
function getCurrentResult(resultData, observable, client) {
|
|
296
|
-
// Using this.result as a cache ensures getCurrentResult continues returning
|
|
297
|
-
// the same (===) result object, unless state.setResult has been called, or
|
|
298
|
-
// we're doing server rendering and therefore override the result below.
|
|
299
|
-
if (!resultData.current) {
|
|
300
|
-
setResult(observable.getCurrentResult(), resultData, observable, client, () => { });
|
|
301
|
-
}
|
|
302
|
-
return resultData.current;
|
|
303
|
-
}
|
|
304
|
-
function getDefaultFetchPolicy(queryHookDefaultOptions, clientDefaultOptions) {
|
|
305
|
-
return (queryHookDefaultOptions?.fetchPolicy ||
|
|
306
|
-
clientDefaultOptions?.watchQuery?.fetchPolicy ||
|
|
307
|
-
"cache-first");
|
|
308
|
-
}
|
|
309
|
-
function toQueryResult(result, previousData, observable, client) {
|
|
310
|
-
const { data, partial, ...resultWithoutPartial } = result;
|
|
311
|
-
const queryResult = {
|
|
312
|
-
data, // Ensure always defined, even if result.data is missing.
|
|
313
|
-
...resultWithoutPartial,
|
|
314
|
-
client: client,
|
|
315
|
-
observable: observable,
|
|
316
|
-
variables: observable.variables,
|
|
317
|
-
called: result !== ssrDisabledResult && result !== skipStandbyResult,
|
|
318
|
-
previousData,
|
|
319
|
-
};
|
|
320
|
-
return queryResult;
|
|
321
|
-
}
|
|
322
|
-
const ssrDisabledResult = maybeDeepFreeze({
|
|
214
|
+
useQuery.ssrDisabledResult = maybeDeepFreeze({
|
|
323
215
|
loading: true,
|
|
324
216
|
data: void 0,
|
|
325
217
|
error: void 0,
|
|
326
218
|
networkStatus: NetworkStatus.loading,
|
|
327
219
|
partial: true,
|
|
328
220
|
});
|
|
329
|
-
|
|
221
|
+
useQuery.skipStandbyResult = maybeDeepFreeze({
|
|
330
222
|
loading: false,
|
|
331
223
|
data: void 0,
|
|
332
224
|
error: void 0,
|
|
333
225
|
networkStatus: NetworkStatus.ready,
|
|
334
226
|
partial: true,
|
|
335
227
|
});
|
|
336
|
-
function bindObservableMethods(observable) {
|
|
337
|
-
return {
|
|
338
|
-
refetch: observable.refetch.bind(observable),
|
|
339
|
-
reobserve: observable.reobserve.bind(observable),
|
|
340
|
-
fetchMore: observable.fetchMore.bind(observable),
|
|
341
|
-
updateQuery: observable.updateQuery.bind(observable),
|
|
342
|
-
startPolling: observable.startPolling.bind(observable),
|
|
343
|
-
stopPolling: observable.stopPolling.bind(observable),
|
|
344
|
-
subscribeToMore: observable.subscribeToMore.bind(observable),
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
228
|
//# sourceMappingURL=useQuery.js.map
|