@apollo/client 4.0.0-alpha.15 → 4.0.0-alpha.17
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/CHANGELOG.md +106 -0
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +2 -2
- package/__cjs/cache/core/types/DataProxy.d.cts +1 -2
- package/__cjs/cache/core/types/common.cjs.map +1 -1
- package/__cjs/cache/core/types/common.d.cts +1 -2
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +1 -2
- package/__cjs/core/ObservableQuery.cjs +104 -48
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +19 -2
- package/__cjs/core/QueryManager.cjs +21 -6
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +1 -1
- package/__cjs/core/types.d.cts +25 -3
- package/__cjs/core/watchQueryOptions.d.cts +2 -1
- package/__cjs/errors/ServerError.cjs +3 -4
- package/__cjs/errors/ServerError.cjs.map +1 -1
- package/__cjs/errors/ServerError.d.cts +8 -8
- package/__cjs/link/batch-http/batchHttpLink.cjs +0 -35
- package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
- package/__cjs/link/http/createHttpLink.cjs +1 -1
- package/__cjs/link/http/createHttpLink.cjs.map +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +20 -55
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.d.cts +0 -2
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs +1 -1
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.cjs +12 -10
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +51 -14
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +2 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +1 -0
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +28 -53
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +7 -8
- package/__cjs/react/hooks/useQuery.cjs +3 -2
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +10 -48
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +2 -2
- package/__cjs/react/hooks/useReadQuery.cjs +1 -0
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.d.cts +4 -11
- package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -0
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +13 -24
- package/__cjs/react/index.cjs.map +1 -1
- package/__cjs/react/index.d.cts +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +7 -1
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +25 -65
- package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/SuspenseCache.d.cts +3 -3
- package/__cjs/react/internal/index.cjs.map +1 -1
- package/__cjs/react/internal/index.d.cts +1 -1
- package/__cjs/react/internal/types.d.cts +2 -2
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +5 -5
- package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -1
- package/__cjs/react/ssr/useSSRQuery.cjs +1 -0
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
- package/__cjs/react/types/types.documentation.d.cts +12 -0
- package/__cjs/utilities/DeepPartial.cjs.map +1 -0
- package/__cjs/utilities/{internal/types/DeepPartial.d.cts → DeepPartial.d.cts} +3 -5
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/index.d.cts +1 -0
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +0 -1
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -1
- package/__cjs/utilities/subscriptions/relay/index.cjs +1 -1
- package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.d.ts +2 -2
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +1 -2
- package/cache/core/types/common.d.ts +1 -2
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +1 -2
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/core/ObservableQuery.d.ts +19 -2
- package/core/ObservableQuery.js +105 -49
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +20 -5
- package/core/QueryManager.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js.map +1 -1
- package/core/types.d.ts +25 -3
- package/core/watchQueryOptions.d.ts +2 -1
- package/errors/ServerError.d.ts +8 -8
- package/errors/ServerError.js +3 -4
- package/errors/ServerError.js.map +1 -1
- package/link/batch-http/batchHttpLink.js +0 -35
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/http/createHttpLink.js +2 -2
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +0 -2
- package/link/http/parseAndCheckHttpResponse.js +20 -54
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +1 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/persisted-queries/index.js +12 -10
- package/link/persisted-queries/index.js.map +1 -1
- package/package.json +5 -7
- package/react/hooks/useBackgroundQuery.d.ts +51 -14
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +2 -1
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +28 -53
- package/react/hooks/useLazyQuery.js +1 -0
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +7 -8
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useQuery.d.ts +10 -48
- package/react/hooks/useQuery.js +3 -2
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +2 -2
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +4 -11
- package/react/hooks/useReadQuery.js +1 -0
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +13 -24
- package/react/hooks/useSuspenseQuery.js +2 -0
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +25 -65
- package/react/internal/cache/QueryReference.js +7 -1
- 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/index.d.ts +1 -1
- package/react/internal/index.js.map +1 -1
- package/react/internal/types.d.ts +2 -2
- package/react/query-preloader/createQueryPreloader.d.ts +5 -5
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/prerenderStatic.js.map +1 -1
- package/react/ssr/useSSRQuery.js +1 -0
- package/react/ssr/useSSRQuery.js.map +1 -1
- package/react/types/types.documentation.d.ts +12 -0
- package/utilities/{internal/types/DeepPartial.d.ts → DeepPartial.d.ts} +3 -5
- package/utilities/DeepPartial.js.map +1 -0
- package/utilities/index.d.ts +1 -0
- package/utilities/index.js.map +1 -1
- package/utilities/internal/index.d.ts +0 -1
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/toQueryResult.js.map +1 -1
- package/utilities/subscriptions/relay/index.js +2 -2
- package/utilities/subscriptions/relay/index.js.map +1 -1
- package/version.js +1 -1
- package/.changeset/README.md +0 -8
- package/.changeset/afraid-grapes-call.md +0 -5
- package/.changeset/afraid-moons-arrive.md +0 -5
- package/.changeset/beige-mirrors-talk.md +0 -15
- package/.changeset/beige-spiders-hope.md +0 -5
- package/.changeset/brave-moons-juggle.md +0 -5
- package/.changeset/brave-radios-wait.md +0 -5
- package/.changeset/bright-ads-share.md +0 -5
- package/.changeset/calm-frogs-remain.md +0 -7
- package/.changeset/calm-seals-relate.md +0 -5
- package/.changeset/chatty-planes-grin.md +0 -5
- package/.changeset/clean-sheep-hide.md +0 -6
- package/.changeset/clever-zebras-mate.md +0 -5
- package/.changeset/config.json +0 -14
- package/.changeset/cool-bikes-shake.md +0 -12
- package/.changeset/cool-kiwis-hunt.md +0 -15
- package/.changeset/cuddly-spiders-tie.md +0 -5
- package/.changeset/curvy-flies-accept.md +0 -5
- package/.changeset/curvy-pianos-count.md +0 -5
- package/.changeset/dirty-cobras-change.md +0 -7
- package/.changeset/dirty-eagles-poke.md +0 -5
- package/.changeset/dirty-trees-pump.md +0 -5
- package/.changeset/early-eggs-develop.md +0 -22
- package/.changeset/eighty-squids-fix.md +0 -15
- package/.changeset/eleven-kangaroos-jump.md +0 -5
- package/.changeset/empty-rabbits-move.md +0 -5
- package/.changeset/few-crabs-move.md +0 -6
- package/.changeset/fluffy-shoes-applaud.md +0 -5
- package/.changeset/forty-hairs-occur.md +0 -5
- package/.changeset/forty-shrimps-fry.md +0 -5
- package/.changeset/forty-tomatoes-punch.md +0 -5
- package/.changeset/four-countries-clean.md +0 -24
- package/.changeset/four-ghosts-watch.md +0 -5
- package/.changeset/fresh-moose-hope.md +0 -5
- package/.changeset/friendly-olives-refuse.md +0 -5
- package/.changeset/funny-boats-wink.md +0 -35
- package/.changeset/funny-jeans-invent.md +0 -16
- package/.changeset/funny-terms-deny.md +0 -5
- package/.changeset/fuzzy-seahorses-hunt.md +0 -5
- package/.changeset/fuzzy-tips-sit.md +0 -5
- package/.changeset/gentle-badgers-train.md +0 -5
- package/.changeset/gentle-waves-cough.md +0 -5
- package/.changeset/giant-apes-thank.md +0 -5
- package/.changeset/giant-bags-share.md +0 -5
- package/.changeset/gold-oranges-double.md +0 -5
- package/.changeset/good-dolphins-peel.md +0 -113
- package/.changeset/gorgeous-chefs-tap.md +0 -5
- package/.changeset/great-roses-jog.md +0 -15
- package/.changeset/grumpy-vans-type.md +0 -5
- package/.changeset/healthy-apes-sneeze.md +0 -5
- package/.changeset/hip-vans-act.md +0 -5
- package/.changeset/hot-cycles-notice.md +0 -5
- package/.changeset/hungry-bikes-cough.md +0 -5
- package/.changeset/itchy-chefs-run.md +0 -23
- package/.changeset/itchy-drinks-refuse.md +0 -5
- package/.changeset/itchy-roses-accept.md +0 -5
- package/.changeset/khaki-keys-deliver.md +0 -5
- package/.changeset/khaki-spies-work.md +0 -11
- package/.changeset/kind-fishes-develop.md +0 -17
- package/.changeset/large-plants-know.md +0 -5
- package/.changeset/late-trainers-peel.md +0 -7
- package/.changeset/light-apes-rescue.md +0 -5
- package/.changeset/light-dolphins-taste.md +0 -5
- package/.changeset/light-sloths-end.md +0 -16
- package/.changeset/little-parrots-bow.md +0 -14
- package/.changeset/little-spoons-kick.md +0 -7
- package/.changeset/loud-cows-raise.md +0 -7
- package/.changeset/lucky-hats-push.md +0 -7
- package/.changeset/lucky-sheep-explain.md +0 -34
- package/.changeset/many-buses-allow.md +0 -5
- package/.changeset/many-papayas-hide.md +0 -5
- package/.changeset/mean-lizards-think.md +0 -5
- package/.changeset/metal-needles-search.md +0 -5
- package/.changeset/mighty-penguins-wink.md +0 -16
- package/.changeset/modern-feet-do.md +0 -5
- package/.changeset/moody-lobsters-listen.md +0 -7
- package/.changeset/nervous-fireants-bow.md +0 -5
- package/.changeset/nervous-goats-allow.md +0 -5
- package/.changeset/nice-donkeys-reflect.md +0 -5
- package/.changeset/nice-dots-matter.md +0 -5
- package/.changeset/nice-waves-work.md +0 -7
- package/.changeset/ninety-bags-bake.md +0 -17
- package/.changeset/odd-chicken-hide.md +0 -17
- package/.changeset/odd-lemons-relax.md +0 -5
- package/.changeset/olive-cougars-ring.md +0 -9
- package/.changeset/orange-suits-laugh.md +0 -5
- package/.changeset/perfect-ducks-reflect.md +0 -12
- package/.changeset/perfect-vans-give.md +0 -7
- package/.changeset/polite-bees-care.md +0 -26
- package/.changeset/poor-eels-punch.md +0 -5
- package/.changeset/poor-spiders-hunt.md +0 -23
- package/.changeset/popular-games-sleep.md +0 -5
- package/.changeset/pre.json +0 -168
- package/.changeset/purple-bears-flash.md +0 -5
- package/.changeset/purple-lions-cough.md +0 -5
- package/.changeset/rare-houses-prove.md +0 -5
- package/.changeset/real-gorillas-move.md +0 -21
- package/.changeset/real-teachers-peel.md +0 -5
- package/.changeset/rich-eagles-cross.md +0 -5
- package/.changeset/rich-kids-carry.md +0 -9
- package/.changeset/rude-fans-study.md +0 -5
- package/.changeset/selfish-spoons-approve.md +0 -44
- package/.changeset/serious-items-develop.md +0 -17
- package/.changeset/serious-moons-juggle.md +0 -5
- package/.changeset/seven-dragons-repair.md +0 -14
- package/.changeset/seven-foxes-melt.md +0 -5
- package/.changeset/seven-schools-carry.md +0 -5
- package/.changeset/shaggy-pugs-add.md +0 -52
- package/.changeset/shiny-carrots-invent.md +0 -5
- package/.changeset/short-jokes-jam.md +0 -27
- package/.changeset/short-months-complain.md +0 -5
- package/.changeset/short-tomatoes-attend.md +0 -5
- package/.changeset/silly-knives-exist.md +0 -5
- package/.changeset/silly-seas-confess.md +0 -5
- package/.changeset/sixty-bats-cry.md +0 -6
- package/.changeset/slimy-ants-bake.md +0 -5
- package/.changeset/slimy-chicken-melt.md +0 -5
- package/.changeset/slimy-maps-press.md +0 -5
- package/.changeset/slow-ravens-explain.md +0 -19
- package/.changeset/small-buttons-rhyme.md +0 -5
- package/.changeset/small-cycles-rescue.md +0 -5
- package/.changeset/small-kids-film.md +0 -14
- package/.changeset/small-poems-rest.md +0 -5
- package/.changeset/smart-rats-explode.md +0 -5
- package/.changeset/smooth-coins-collect.md +0 -5
- package/.changeset/smooth-pens-reply.md +0 -7
- package/.changeset/soft-mails-clean.md +0 -5
- package/.changeset/sour-colts-tell.md +0 -5
- package/.changeset/sour-guests-poke.md +0 -5
- package/.changeset/sour-kids-deliver.md +0 -5
- package/.changeset/sour-pillows-guess.md +0 -7
- package/.changeset/spotty-mugs-poke.md +0 -5
- package/.changeset/strange-seahorses-impress.md +0 -17
- package/.changeset/strange-walls-march.md +0 -5
- package/.changeset/strong-rivers-fry.md +0 -34
- package/.changeset/stupid-pumpkins-travel.md +0 -13
- package/.changeset/swift-rivers-share.md +0 -13
- package/.changeset/tall-bikes-develop.md +0 -5
- package/.changeset/tall-cups-suffer.md +0 -13
- package/.changeset/tame-doors-shop.md +0 -14
- package/.changeset/tame-points-work.md +0 -11
- package/.changeset/tender-swans-flash.md +0 -16
- package/.changeset/thick-books-grin.md +0 -5
- package/.changeset/thin-peas-hear.md +0 -16
- package/.changeset/thirty-pens-jump.md +0 -5
- package/.changeset/tidy-pandas-punch.md +0 -5
- package/.changeset/tidy-squids-poke.md +0 -12
- package/.changeset/tough-rockets-allow.md +0 -5
- package/.changeset/tough-taxis-smoke.md +0 -7
- package/.changeset/tough-tips-drop.md +0 -15
- package/.changeset/tricky-tables-shave.md +0 -5
- package/.changeset/twenty-snakes-sort.md +0 -7
- package/.changeset/unlucky-kiwis-sell.md +0 -5
- package/.changeset/unlucky-sheep-change.md +0 -5
- package/.changeset/warm-ties-sit.md +0 -7
- package/.changeset/wicked-forks-double.md +0 -33
- package/.changeset/wicked-kiwis-buy.md +0 -5
- package/.changeset/witty-paws-marry.md +0 -26
- package/.changeset/yellow-cats-judge.md +0 -13
- package/.changeset/young-phones-fold.md +0 -5
- package/.changeset/young-snails-grin.md +0 -5
- package/.changeset/young-turtles-explode.md +0 -5
- package/__cjs/masking/__benches__/types.bench.cjs +0 -223
- package/__cjs/masking/__benches__/types.bench.cjs.map +0 -1
- package/__cjs/masking/__benches__/types.bench.d.cts +0 -2
- package/__cjs/testing/internal/ObservableStream.cjs +0 -110
- package/__cjs/testing/internal/ObservableStream.cjs.map +0 -1
- package/__cjs/testing/internal/ObservableStream.d.cts +0 -39
- package/__cjs/testing/internal/disposables/enableFakeTimers.cjs +0 -19
- package/__cjs/testing/internal/disposables/enableFakeTimers.cjs.map +0 -1
- package/__cjs/testing/internal/disposables/enableFakeTimers.d.cts +0 -7
- package/__cjs/testing/internal/disposables/index.cjs +0 -12
- package/__cjs/testing/internal/disposables/index.cjs.map +0 -1
- package/__cjs/testing/internal/disposables/index.d.cts +0 -5
- package/__cjs/testing/internal/disposables/spyOnConsole.cjs +0 -24
- package/__cjs/testing/internal/disposables/spyOnConsole.cjs.map +0 -1
- package/__cjs/testing/internal/disposables/spyOnConsole.d.cts +0 -8
- package/__cjs/testing/internal/disposables/withCleanup.cjs +0 -22
- package/__cjs/testing/internal/disposables/withCleanup.cjs.map +0 -1
- package/__cjs/testing/internal/disposables/withCleanup.d.cts +0 -7
- package/__cjs/testing/internal/disposables/withProdMode.cjs +0 -17
- package/__cjs/testing/internal/disposables/withProdMode.cjs.map +0 -1
- package/__cjs/testing/internal/disposables/withProdMode.d.cts +0 -4
- package/__cjs/testing/internal/incremental.cjs +0 -124
- package/__cjs/testing/internal/incremental.cjs.map +0 -1
- package/__cjs/testing/internal/incremental.d.cts +0 -16
- package/__cjs/testing/internal/index.cjs +0 -36
- package/__cjs/testing/internal/index.cjs.map +0 -1
- package/__cjs/testing/internal/index.d.cts +0 -13
- package/__cjs/testing/internal/link.cjs +0 -22
- package/__cjs/testing/internal/link.cjs.map +0 -1
- package/__cjs/testing/internal/link.d.cts +0 -6
- package/__cjs/testing/internal/messageChannelPolyfill.cjs +0 -18
- package/__cjs/testing/internal/messageChannelPolyfill.cjs.map +0 -1
- package/__cjs/testing/internal/messageChannelPolyfill.d.cts +0 -2
- package/__cjs/testing/internal/renderHelpers.cjs +0 -21
- package/__cjs/testing/internal/renderHelpers.cjs.map +0 -1
- package/__cjs/testing/internal/renderHelpers.d.cts +0 -14
- package/__cjs/testing/internal/resetApolloContext.cjs +0 -24
- package/__cjs/testing/internal/resetApolloContext.cjs.map +0 -1
- package/__cjs/testing/internal/resetApolloContext.d.cts +0 -10
- package/__cjs/testing/internal/rtl/actAsync.cjs +0 -18
- package/__cjs/testing/internal/rtl/actAsync.cjs.map +0 -1
- package/__cjs/testing/internal/rtl/actAsync.d.cts +0 -2
- package/__cjs/testing/internal/rtl/renderAsync.cjs +0 -15
- package/__cjs/testing/internal/rtl/renderAsync.cjs.map +0 -1
- package/__cjs/testing/internal/rtl/renderAsync.d.cts +0 -9
- package/__cjs/testing/internal/rtl/renderHookAsync.cjs +0 -37
- package/__cjs/testing/internal/rtl/renderHookAsync.cjs.map +0 -1
- package/__cjs/testing/internal/rtl/renderHookAsync.d.cts +0 -8
- package/__cjs/testing/internal/scenarios/index.cjs +0 -104
- package/__cjs/testing/internal/scenarios/index.cjs.map +0 -1
- package/__cjs/testing/internal/scenarios/index.d.cts +0 -83
- package/__cjs/testing/internal/wait.cjs +0 -7
- package/__cjs/testing/internal/wait.cjs.map +0 -1
- package/__cjs/testing/internal/wait.d.cts +0 -2
- package/__cjs/testing/matchers/arrayWithLength.cjs +0 -15
- package/__cjs/testing/matchers/arrayWithLength.cjs.map +0 -1
- package/__cjs/testing/matchers/arrayWithLength.d.cts +0 -3
- package/__cjs/testing/matchers/index.cjs +0 -31
- package/__cjs/testing/matchers/index.cjs.map +0 -1
- package/__cjs/testing/matchers/index.d.cts +0 -2
- package/__cjs/testing/matchers/isSameClient.cjs +0 -19
- package/__cjs/testing/matchers/isSameClient.cjs.map +0 -1
- package/__cjs/testing/matchers/isSameClient.d.cts +0 -3
- package/__cjs/testing/matchers/isSameObservableQuery.cjs +0 -19
- package/__cjs/testing/matchers/isSameObservableQuery.cjs.map +0 -1
- package/__cjs/testing/matchers/isSameObservableQuery.d.cts +0 -3
- package/__cjs/testing/matchers/toBeDisposed.cjs +0 -20
- package/__cjs/testing/matchers/toBeDisposed.cjs.map +0 -1
- package/__cjs/testing/matchers/toBeDisposed.d.cts +0 -3
- package/__cjs/testing/matchers/toBeGarbageCollected.cjs +0 -43
- package/__cjs/testing/matchers/toBeGarbageCollected.cjs.map +0 -1
- package/__cjs/testing/matchers/toBeGarbageCollected.d.cts +0 -8
- package/__cjs/testing/matchers/toComplete.cjs +0 -30
- package/__cjs/testing/matchers/toComplete.cjs.map +0 -1
- package/__cjs/testing/matchers/toComplete.d.cts +0 -4
- package/__cjs/testing/matchers/toEmitAnything.cjs +0 -33
- package/__cjs/testing/matchers/toEmitAnything.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitAnything.d.cts +0 -4
- package/__cjs/testing/matchers/toEmitError.cjs +0 -46
- package/__cjs/testing/matchers/toEmitError.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitError.d.cts +0 -7
- package/__cjs/testing/matchers/toEmitNext.cjs +0 -30
- package/__cjs/testing/matchers/toEmitNext.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitNext.d.cts +0 -4
- package/__cjs/testing/matchers/toEmitTypedValue.cjs +0 -42
- package/__cjs/testing/matchers/toEmitTypedValue.cjs.map +0 -1
- package/__cjs/testing/matchers/toEmitTypedValue.d.cts +0 -12
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs +0 -26
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs.map +0 -1
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.d.cts +0 -11
- package/__cjs/testing/matchers/toMatchDocument.cjs +0 -37
- package/__cjs/testing/matchers/toMatchDocument.cjs.map +0 -1
- package/__cjs/testing/matchers/toMatchDocument.d.cts +0 -4
- package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.cjs +0 -65
- package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.cjs.map +0 -1
- package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.d.cts +0 -20
- package/__cjs/testing/matchers/toStrictEqualTyped.cjs +0 -32
- package/__cjs/testing/matchers/toStrictEqualTyped.cjs.map +0 -1
- package/__cjs/testing/matchers/toStrictEqualTyped.d.cts +0 -12
- package/__cjs/testing/matchers/utils/getSerializableProperties.cjs +0 -36
- package/__cjs/testing/matchers/utils/getSerializableProperties.cjs.map +0 -1
- package/__cjs/testing/matchers/utils/getSerializableProperties.d.cts +0 -4
- package/__cjs/utilities/internal/types/DeepPartial.cjs.map +0 -1
- package/legacyEntryPoints/testing/internal/index.d.ts +0 -1
- package/legacyEntryPoints/testing/internal/index.js +0 -1
- package/legacyEntryPoints/testing/internal/internal.cjs +0 -1
- package/legacyEntryPoints/testing/internal/internal.d.cts +0 -1
- package/masking/__benches__/types.bench.d.ts +0 -2
- package/masking/__benches__/types.bench.js +0 -221
- package/masking/__benches__/types.bench.js.map +0 -1
- package/testing/internal/ObservableStream.d.ts +0 -39
- package/testing/internal/ObservableStream.js +0 -105
- package/testing/internal/ObservableStream.js.map +0 -1
- package/testing/internal/disposables/enableFakeTimers.d.ts +0 -7
- package/testing/internal/disposables/enableFakeTimers.js +0 -16
- package/testing/internal/disposables/enableFakeTimers.js.map +0 -1
- package/testing/internal/disposables/index.d.ts +0 -5
- package/testing/internal/disposables/index.js +0 -5
- package/testing/internal/disposables/index.js.map +0 -1
- package/testing/internal/disposables/spyOnConsole.d.ts +0 -8
- package/testing/internal/disposables/spyOnConsole.js +0 -21
- package/testing/internal/disposables/spyOnConsole.js.map +0 -1
- package/testing/internal/disposables/withCleanup.d.ts +0 -7
- package/testing/internal/disposables/withCleanup.js +0 -19
- package/testing/internal/disposables/withCleanup.js.map +0 -1
- package/testing/internal/disposables/withProdMode.d.ts +0 -4
- package/testing/internal/disposables/withProdMode.js +0 -13
- package/testing/internal/disposables/withProdMode.js.map +0 -1
- package/testing/internal/incremental.d.ts +0 -16
- package/testing/internal/incremental.js +0 -120
- package/testing/internal/incremental.js.map +0 -1
- package/testing/internal/index.d.ts +0 -13
- package/testing/internal/index.js +0 -12
- package/testing/internal/index.js.map +0 -1
- package/testing/internal/link.d.ts +0 -6
- package/testing/internal/link.js +0 -18
- package/testing/internal/link.js.map +0 -1
- package/testing/internal/messageChannelPolyfill.d.ts +0 -2
- package/testing/internal/messageChannelPolyfill.js +0 -16
- package/testing/internal/messageChannelPolyfill.js.map +0 -1
- package/testing/internal/renderHelpers.d.ts +0 -14
- package/testing/internal/renderHelpers.js +0 -16
- package/testing/internal/renderHelpers.js.map +0 -1
- package/testing/internal/resetApolloContext.d.ts +0 -10
- package/testing/internal/resetApolloContext.js +0 -20
- package/testing/internal/resetApolloContext.js.map +0 -1
- package/testing/internal/rtl/actAsync.d.ts +0 -2
- package/testing/internal/rtl/actAsync.js +0 -14
- package/testing/internal/rtl/actAsync.js.map +0 -1
- package/testing/internal/rtl/renderAsync.d.ts +0 -9
- package/testing/internal/rtl/renderAsync.js +0 -12
- package/testing/internal/rtl/renderAsync.js.map +0 -1
- package/testing/internal/rtl/renderHookAsync.d.ts +0 -8
- package/testing/internal/rtl/renderHookAsync.js +0 -33
- package/testing/internal/rtl/renderHookAsync.js.map +0 -1
- package/testing/internal/scenarios/index.d.ts +0 -83
- package/testing/internal/scenarios/index.js +0 -97
- package/testing/internal/scenarios/index.js.map +0 -1
- package/testing/internal/wait.d.ts +0 -2
- package/testing/internal/wait.js +0 -4
- package/testing/internal/wait.js.map +0 -1
- package/testing/matchers/arrayWithLength.d.ts +0 -3
- package/testing/matchers/arrayWithLength.js +0 -11
- package/testing/matchers/arrayWithLength.js.map +0 -1
- package/testing/matchers/index.d.ts +0 -2
- package/testing/matchers/index.js +0 -29
- package/testing/matchers/index.js.map +0 -1
- package/testing/matchers/isSameClient.d.ts +0 -3
- package/testing/matchers/isSameClient.js +0 -15
- package/testing/matchers/isSameClient.js.map +0 -1
- package/testing/matchers/isSameObservableQuery.d.ts +0 -3
- package/testing/matchers/isSameObservableQuery.js +0 -15
- package/testing/matchers/isSameObservableQuery.js.map +0 -1
- package/testing/matchers/toBeDisposed.d.ts +0 -3
- package/testing/matchers/toBeDisposed.js +0 -16
- package/testing/matchers/toBeDisposed.js.map +0 -1
- package/testing/matchers/toBeGarbageCollected.d.ts +0 -8
- package/testing/matchers/toBeGarbageCollected.js +0 -39
- package/testing/matchers/toBeGarbageCollected.js.map +0 -1
- package/testing/matchers/toComplete.d.ts +0 -4
- package/testing/matchers/toComplete.js +0 -26
- package/testing/matchers/toComplete.js.map +0 -1
- package/testing/matchers/toEmitAnything.d.ts +0 -4
- package/testing/matchers/toEmitAnything.js +0 -29
- package/testing/matchers/toEmitAnything.js.map +0 -1
- package/testing/matchers/toEmitError.d.ts +0 -7
- package/testing/matchers/toEmitError.js +0 -42
- package/testing/matchers/toEmitError.js.map +0 -1
- package/testing/matchers/toEmitNext.d.ts +0 -4
- package/testing/matchers/toEmitNext.js +0 -26
- package/testing/matchers/toEmitNext.js.map +0 -1
- package/testing/matchers/toEmitTypedValue.d.ts +0 -12
- package/testing/matchers/toEmitTypedValue.js +0 -38
- package/testing/matchers/toEmitTypedValue.js.map +0 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +0 -11
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +0 -22
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +0 -1
- package/testing/matchers/toMatchDocument.d.ts +0 -4
- package/testing/matchers/toMatchDocument.js +0 -33
- package/testing/matchers/toMatchDocument.js.map +0 -1
- package/testing/matchers/toRerenderWithSimilarSnapshot.d.ts +0 -20
- package/testing/matchers/toRerenderWithSimilarSnapshot.js +0 -62
- package/testing/matchers/toRerenderWithSimilarSnapshot.js.map +0 -1
- package/testing/matchers/toStrictEqualTyped.d.ts +0 -12
- package/testing/matchers/toStrictEqualTyped.js +0 -28
- package/testing/matchers/toStrictEqualTyped.js.map +0 -1
- package/testing/matchers/utils/getSerializableProperties.d.ts +0 -4
- package/testing/matchers/utils/getSerializableProperties.js +0 -33
- package/testing/matchers/utils/getSerializableProperties.js.map +0 -1
- package/utilities/internal/types/DeepPartial.js.map +0 -1
- /package/__cjs/utilities/{internal/types/DeepPartial.cjs → DeepPartial.cjs} +0 -0
- /package/utilities/{internal/types/DeepPartial.js → DeepPartial.js} +0 -0
|
@@ -15,17 +15,18 @@ const invariant_1 = require("@apollo/client/utilities/invariant");
|
|
|
15
15
|
const equalByQuery_js_1 = require("./equalByQuery.cjs");
|
|
16
16
|
const networkStatus_js_1 = require("./networkStatus.cjs");
|
|
17
17
|
const { assign, hasOwnProperty } = Object;
|
|
18
|
-
const newNetworkStatusSymbol = Symbol();
|
|
19
18
|
const uninitialized = {
|
|
20
19
|
loading: true,
|
|
21
20
|
networkStatus: networkStatus_js_1.NetworkStatus.loading,
|
|
22
21
|
data: undefined,
|
|
22
|
+
dataState: "empty",
|
|
23
23
|
partial: true,
|
|
24
24
|
};
|
|
25
25
|
const empty = {
|
|
26
26
|
loading: false,
|
|
27
27
|
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
28
28
|
data: undefined,
|
|
29
|
+
dataState: "empty",
|
|
29
30
|
partial: true,
|
|
30
31
|
};
|
|
31
32
|
class ObservableQuery {
|
|
@@ -208,19 +209,23 @@ class ObservableQuery {
|
|
|
208
209
|
: initialFetchPolicy || this.options.fetchPolicy;
|
|
209
210
|
const defaultResult = {
|
|
210
211
|
data: undefined,
|
|
212
|
+
dataState: "empty",
|
|
211
213
|
loading: true,
|
|
212
214
|
networkStatus: networkStatus_js_1.NetworkStatus.loading,
|
|
213
215
|
partial: true,
|
|
214
216
|
};
|
|
215
217
|
const cacheResult = () => {
|
|
216
218
|
const diff = this.getCacheDiff();
|
|
219
|
+
// TODO: queryInfo.getDiff should handle this since cache.diff returns a
|
|
220
|
+
// null when returnPartialData is false
|
|
221
|
+
const data = this.options.returnPartialData || diff.complete ?
|
|
222
|
+
diff.result ?? undefined
|
|
223
|
+
: undefined;
|
|
217
224
|
return this.maskResult({
|
|
218
|
-
data
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
diff.result ?? undefined
|
|
223
|
-
: undefined,
|
|
225
|
+
data,
|
|
226
|
+
dataState: diff.complete ? "complete"
|
|
227
|
+
: data === undefined ? "empty"
|
|
228
|
+
: "partial",
|
|
224
229
|
loading: !diff.complete,
|
|
225
230
|
networkStatus: diff.complete ? networkStatus_js_1.NetworkStatus.ready : networkStatus_js_1.NetworkStatus.loading,
|
|
226
231
|
partial: !diff.complete,
|
|
@@ -373,9 +378,8 @@ class ObservableQuery {
|
|
|
373
378
|
this.getVariablesWithDefaults({ ...this.variables, ...variables });
|
|
374
379
|
}
|
|
375
380
|
this.queryInfo.resetLastWrite();
|
|
376
|
-
return this.
|
|
377
|
-
|
|
378
|
-
[newNetworkStatusSymbol]: networkStatus_js_1.NetworkStatus.refetch,
|
|
381
|
+
return this._reobserve(reobserveOptions, {
|
|
382
|
+
newNetworkStatus: networkStatus_js_1.NetworkStatus.refetch,
|
|
379
383
|
});
|
|
380
384
|
}
|
|
381
385
|
/**
|
|
@@ -501,6 +505,7 @@ class ObservableQuery {
|
|
|
501
505
|
// will be overwritten anyways, just here for types sake
|
|
502
506
|
loading: false,
|
|
503
507
|
data: data,
|
|
508
|
+
dataState: lastResult.dataState === "streaming" ? "streaming" : "complete",
|
|
504
509
|
},
|
|
505
510
|
source: "network",
|
|
506
511
|
});
|
|
@@ -607,12 +612,11 @@ class ObservableQuery {
|
|
|
607
612
|
if (!this.hasObservers()) {
|
|
608
613
|
return (0, internal_1.toQueryResult)(this.getCurrentResult());
|
|
609
614
|
}
|
|
610
|
-
return this.
|
|
615
|
+
return this._reobserve({
|
|
611
616
|
// Reset options.fetchPolicy to its original value.
|
|
612
617
|
fetchPolicy: this.options.initialFetchPolicy,
|
|
613
618
|
variables,
|
|
614
|
-
|
|
615
|
-
});
|
|
619
|
+
}, { newNetworkStatus: networkStatus_js_1.NetworkStatus.setVariables });
|
|
616
620
|
}
|
|
617
621
|
/**
|
|
618
622
|
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
|
|
@@ -684,7 +688,7 @@ class ObservableQuery {
|
|
|
684
688
|
}
|
|
685
689
|
return options.fetchPolicy;
|
|
686
690
|
}
|
|
687
|
-
fetch(options, networkStatus, fetchQuery) {
|
|
691
|
+
fetch(options, networkStatus, fetchQuery, operator) {
|
|
688
692
|
// TODO Make sure we update the networkStatus (and infer fetchVariables)
|
|
689
693
|
// before actually committing to the fetch.
|
|
690
694
|
const initialFetchPolicy = this.options.fetchPolicy;
|
|
@@ -735,7 +739,7 @@ class ObservableQuery {
|
|
|
735
739
|
}
|
|
736
740
|
}
|
|
737
741
|
});
|
|
738
|
-
|
|
742
|
+
let { observable, fromLink } = this.queryManager.fetchObservableWithInfo(queryInfo, options, { networkStatus, query: fetchQuery, onCacheHit, fetchQueryOperator });
|
|
739
743
|
// track query and variables from the start of the operation
|
|
740
744
|
const { query, variables } = this;
|
|
741
745
|
const operation = {
|
|
@@ -746,6 +750,7 @@ class ObservableQuery {
|
|
|
746
750
|
this.activeOperations.add(operation);
|
|
747
751
|
let forceFirstValueEmit = networkStatus == networkStatus_js_1.NetworkStatus.refetch ||
|
|
748
752
|
networkStatus == networkStatus_js_1.NetworkStatus.setVariables;
|
|
753
|
+
observable = observable.pipe(operator, (0, rxjs_1.share)());
|
|
749
754
|
const subscription = observable
|
|
750
755
|
.pipe((0, rxjs_1.tap)({
|
|
751
756
|
next: (notification) => {
|
|
@@ -795,7 +800,7 @@ class ObservableQuery {
|
|
|
795
800
|
if (this.pollingInfo) {
|
|
796
801
|
if (!(0, networkStatus_js_1.isNetworkRequestInFlight)(this.networkStatus) &&
|
|
797
802
|
!this.options.skipPollAttempt?.()) {
|
|
798
|
-
this.
|
|
803
|
+
this._reobserve({
|
|
799
804
|
// Most fetchPolicy options don't make sense to use in a polling context, as
|
|
800
805
|
// users wouldn't want to be polling the cache directly. However, network-only and
|
|
801
806
|
// no-cache are both useful for when the user wants to control whether or not the
|
|
@@ -803,7 +808,8 @@ class ObservableQuery {
|
|
|
803
808
|
fetchPolicy: this.options.initialFetchPolicy === "no-cache" ?
|
|
804
809
|
"no-cache"
|
|
805
810
|
: "network-only",
|
|
806
|
-
|
|
811
|
+
}, {
|
|
812
|
+
newNetworkStatus: networkStatus_js_1.NetworkStatus.poll,
|
|
807
813
|
}).then(poll, poll);
|
|
808
814
|
}
|
|
809
815
|
else {
|
|
@@ -832,13 +838,11 @@ class ObservableQuery {
|
|
|
832
838
|
* merged with the current options when given.
|
|
833
839
|
*/
|
|
834
840
|
reobserve(newOptions) {
|
|
841
|
+
return this._reobserve(newOptions);
|
|
842
|
+
}
|
|
843
|
+
_reobserve(newOptions, internalOptions) {
|
|
835
844
|
this.isTornDown = false;
|
|
836
|
-
let newNetworkStatus;
|
|
837
|
-
if (newOptions) {
|
|
838
|
-
newNetworkStatus = newOptions[newNetworkStatusSymbol];
|
|
839
|
-
// Avoid setting the symbol option in this.options
|
|
840
|
-
delete newOptions[newNetworkStatusSymbol];
|
|
841
|
-
}
|
|
845
|
+
let { newNetworkStatus } = internalOptions || {};
|
|
842
846
|
const useDisposableObservable =
|
|
843
847
|
// Refetching uses a disposable Observable to allow refetches using different
|
|
844
848
|
// options, without permanently altering the options of the
|
|
@@ -913,32 +917,38 @@ class ObservableQuery {
|
|
|
913
917
|
this.cancelPolling();
|
|
914
918
|
}
|
|
915
919
|
this.resubscribeCache();
|
|
916
|
-
const {
|
|
917
|
-
if (!useDisposableObservable && (fromLink || !this.linkSubscription)) {
|
|
918
|
-
if (this.linkSubscription) {
|
|
919
|
-
this.linkSubscription.unsubscribe();
|
|
920
|
-
}
|
|
921
|
-
this.linkSubscription = subscription;
|
|
922
|
-
}
|
|
923
|
-
return (0, internal_1.preventUnhandledRejection)(
|
|
924
|
-
// Note: lastValueFrom will create a separate subscription to the
|
|
925
|
-
// observable which means that terminating this ObservableQuery will not
|
|
926
|
-
// cancel the request from the link chain.
|
|
927
|
-
(0, rxjs_1.lastValueFrom)(observable.pipe((0, internal_1.filterMap)((value) => {
|
|
920
|
+
const { promise, operator: promiseOperator } = getTrackingOperatorPromise((value) => {
|
|
928
921
|
switch (value.kind) {
|
|
929
922
|
case "E":
|
|
930
923
|
throw value.error;
|
|
931
924
|
case "N":
|
|
932
|
-
if (value.source !== "newNetworkStatus")
|
|
925
|
+
if (value.source !== "newNetworkStatus" && !value.value.loading)
|
|
933
926
|
return value.value;
|
|
934
927
|
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
928
|
+
},
|
|
929
|
+
// This default value should only be used when using a `fetchPolicy` of
|
|
930
|
+
// `standby` since that fetch policy completes without emitting a
|
|
931
|
+
// result. Since we are converting this to a QueryResult type, we
|
|
932
|
+
// omit the extra fields from ApolloQueryResult in the default value.
|
|
933
|
+
options.fetchPolicy === "standby" ?
|
|
934
|
+
{ data: undefined }
|
|
935
|
+
: undefined);
|
|
936
|
+
const { subscription, observable, fromLink } = this.fetch(options, newNetworkStatus, query, promiseOperator);
|
|
937
|
+
if (!useDisposableObservable && (fromLink || !this.linkSubscription)) {
|
|
938
|
+
if (this.linkSubscription) {
|
|
939
|
+
this.linkSubscription.unsubscribe();
|
|
940
|
+
}
|
|
941
|
+
this.linkSubscription = subscription;
|
|
942
|
+
}
|
|
943
|
+
const ret = Object.assign((0, internal_1.preventUnhandledRejection)(promise.then((result) => (0, internal_1.toQueryResult)(this.maskResult(result)))), {
|
|
944
|
+
retain: () => {
|
|
945
|
+
const subscription = observable.subscribe({});
|
|
946
|
+
const unsubscribe = () => subscription.unsubscribe();
|
|
947
|
+
promise.then(unsubscribe, unsubscribe);
|
|
948
|
+
return ret;
|
|
949
|
+
},
|
|
950
|
+
});
|
|
951
|
+
return ret;
|
|
942
952
|
}
|
|
943
953
|
hasObservers() {
|
|
944
954
|
return this.subject.observed;
|
|
@@ -1051,6 +1061,9 @@ class ObservableQuery {
|
|
|
1051
1061
|
kind: "N",
|
|
1052
1062
|
value: {
|
|
1053
1063
|
data: diff.result,
|
|
1064
|
+
dataState: diff.complete ? "complete"
|
|
1065
|
+
: diff.result ? "partial"
|
|
1066
|
+
: "empty",
|
|
1054
1067
|
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
1055
1068
|
loading: false,
|
|
1056
1069
|
error: undefined,
|
|
@@ -1167,14 +1180,17 @@ class ObservableQuery {
|
|
|
1167
1180
|
result =
|
|
1168
1181
|
notification.kind === "E" ?
|
|
1169
1182
|
{
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1183
|
+
...(isEqualQuery(previous, notification) ?
|
|
1184
|
+
previous.result
|
|
1185
|
+
: { data: undefined, dataState: "empty", partial: true }),
|
|
1173
1186
|
error: notification.error,
|
|
1174
1187
|
networkStatus: networkStatus_js_1.NetworkStatus.error,
|
|
1175
1188
|
loading: false,
|
|
1176
1189
|
}
|
|
1177
1190
|
: notification.value;
|
|
1191
|
+
if (result.error && result.dataState === "streaming") {
|
|
1192
|
+
result.dataState = "complete";
|
|
1193
|
+
}
|
|
1178
1194
|
if (result.error) {
|
|
1179
1195
|
meta.shouldEmit = 1 /* EmitBehavior.force */;
|
|
1180
1196
|
}
|
|
@@ -1213,7 +1229,7 @@ class ObservableQuery {
|
|
|
1213
1229
|
reobserveCacheFirst() {
|
|
1214
1230
|
const { fetchPolicy, nextFetchPolicy } = this.options;
|
|
1215
1231
|
if (fetchPolicy === "cache-and-network" || fetchPolicy === "network-only") {
|
|
1216
|
-
|
|
1232
|
+
this.reobserve({
|
|
1217
1233
|
fetchPolicy: "cache-first",
|
|
1218
1234
|
// Use a temporary nextFetchPolicy function that replaces itself with the
|
|
1219
1235
|
// previous nextFetchPolicy value and returns the original fetchPolicy.
|
|
@@ -1231,7 +1247,9 @@ class ObservableQuery {
|
|
|
1231
1247
|
},
|
|
1232
1248
|
});
|
|
1233
1249
|
}
|
|
1234
|
-
|
|
1250
|
+
else {
|
|
1251
|
+
this.reobserve();
|
|
1252
|
+
}
|
|
1235
1253
|
}
|
|
1236
1254
|
getVariablesWithDefaults(variables) {
|
|
1237
1255
|
return this.queryManager.getVariables(this.query, variables);
|
|
@@ -1246,4 +1264,42 @@ function logMissingFieldErrors(missing) {
|
|
|
1246
1264
|
function isEqualQuery(a, b) {
|
|
1247
1265
|
return !!(a && b && a.query === b.query && (0, equality_1.equal)(a.variables, b.variables));
|
|
1248
1266
|
}
|
|
1267
|
+
function getTrackingOperatorPromise(filterMapCb, defaultValue) {
|
|
1268
|
+
let lastValue = defaultValue, resolve, reject;
|
|
1269
|
+
const promise = new Promise((res, rej) => {
|
|
1270
|
+
resolve = res;
|
|
1271
|
+
reject = rej;
|
|
1272
|
+
});
|
|
1273
|
+
const operator = (0, rxjs_1.tap)({
|
|
1274
|
+
next(value) {
|
|
1275
|
+
try {
|
|
1276
|
+
const newValue = filterMapCb(value);
|
|
1277
|
+
if (newValue !== undefined) {
|
|
1278
|
+
lastValue = newValue;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
catch (error) {
|
|
1282
|
+
reject(error);
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
finalize: () => {
|
|
1286
|
+
if (lastValue) {
|
|
1287
|
+
resolve(lastValue);
|
|
1288
|
+
}
|
|
1289
|
+
else {
|
|
1290
|
+
const message = "The operation was aborted.";
|
|
1291
|
+
const name = "AbortError";
|
|
1292
|
+
reject(typeof DOMException !== "undefined" ?
|
|
1293
|
+
new DOMException(message, name)
|
|
1294
|
+
// some environments do not have `DOMException`, e.g. node
|
|
1295
|
+
// uses a normal `Error` with a `name` property instead: https://github.com/phryneas/node/blob/d0579b64f0f6b722f8e49bf8a471dd0d0604a21e/lib/internal/errors.js#L964
|
|
1296
|
+
// error.code is a legacy property that is not used anymore,
|
|
1297
|
+
// and also inconsistent across environments (in supporting
|
|
1298
|
+
// browsers it is `20`, in node `'ABORT_ERR'`) so we omit that.
|
|
1299
|
+
: Object.assign(new Error(message), { name }));
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
});
|
|
1303
|
+
return { promise, operator };
|
|
1304
|
+
}
|
|
1249
1305
|
//# sourceMappingURL=ObservableQuery.cjs.map
|