@apollo/client 3.8.0-alpha.9 → 3.8.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apollo-client.cjs +1030 -673
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +35 -31
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +35 -31
- package/cache/core/cache.d.ts +5 -4
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js +1 -0
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +2 -2
- package/cache/core/types/Cache.d.ts.map +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +4 -4
- package/cache/core/types/DataProxy.d.ts.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.d.ts +3 -3
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +5 -5
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +2 -2
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts.map +1 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +6 -5
- package/cache/inmemory/helpers.d.ts.map +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +9 -7
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +14 -15
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.d.ts +1 -1
- package/cache/inmemory/key-extractor.d.ts.map +1 -1
- package/cache/inmemory/key-extractor.js +2 -2
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/policies.d.ts +7 -6
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +6 -6
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.d.ts.map +1 -1
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +6 -6
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +10 -5
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +6 -6
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +6 -6
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +7 -8
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/config/jest/setup.d.ts +1 -0
- package/config/jest/setup.d.ts.map +1 -1
- package/config/jest/setup.js +3 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +13 -10
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +18 -16
- package/core/ApolloClient.js.map +1 -1
- package/core/DocumentTransform.d.ts +24 -0
- package/core/DocumentTransform.d.ts.map +1 -0
- package/core/DocumentTransform.js +68 -0
- package/core/DocumentTransform.js.map +1 -0
- package/core/LocalState.d.ts +7 -9
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +6 -10
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +11 -8
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +48 -28
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +9 -9
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +15 -11
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +115 -108
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +332 -172
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +332 -172
- package/core/equalByQuery.d.ts +4 -0
- package/core/equalByQuery.d.ts.map +1 -0
- package/{react/hooks/compareResults.js → core/equalByQuery.js} +14 -10
- package/core/equalByQuery.js.map +1 -0
- package/core/index.d.ts +2 -1
- package/core/index.d.ts.map +1 -1
- package/core/index.js +2 -1
- package/core/index.js.map +1 -1
- package/core/networkStatus.d.ts +1 -0
- package/core/networkStatus.d.ts.map +1 -1
- package/core/networkStatus.js +3 -0
- package/core/networkStatus.js.map +1 -1
- package/core/types.d.ts +14 -14
- package/core/types.d.ts.map +1 -1
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +6 -7
- package/core/watchQueryOptions.d.ts.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +642 -0
- package/dev/dev.cjs.map +1 -0
- package/dev/dev.cjs.native.js +642 -0
- package/dev/index.d.ts +4 -0
- package/dev/index.d.ts.map +1 -0
- package/dev/index.js +4 -0
- package/dev/index.js.map +1 -0
- package/dev/loadDevMessages.d.ts +2 -0
- package/dev/loadDevMessages.d.ts.map +1 -0
- package/dev/loadDevMessages.js +6 -0
- package/dev/loadDevMessages.js.map +1 -0
- package/dev/loadErrorMessageHandler.d.ts +3 -0
- package/dev/loadErrorMessageHandler.d.ts.map +1 -0
- package/dev/loadErrorMessageHandler.js +26 -0
- package/dev/loadErrorMessageHandler.js.map +1 -0
- package/dev/loadErrorMessages.d.ts +2 -0
- package/dev/loadErrorMessages.d.ts.map +1 -0
- package/dev/loadErrorMessages.js +6 -0
- package/dev/loadErrorMessages.js.map +1 -0
- package/dev/package.json +8 -0
- package/errors/errors.cjs +17 -17
- package/errors/errors.cjs.map +1 -1
- package/errors/errors.cjs.native.js +17 -17
- package/errors/index.d.ts +26 -10
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +17 -19
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.d.ts +13 -0
- package/invariantErrorCodes.d.ts.map +1 -0
- package/invariantErrorCodes.js +331 -144
- package/invariantErrorCodes.js.map +1 -0
- package/link/batch/batchLink.d.ts +4 -3
- package/link/batch/batchLink.d.ts.map +1 -1
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.d.ts +1 -1
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch-http/batch-http.cjs +23 -2
- package/link/batch-http/batch-http.cjs.map +1 -1
- package/link/batch-http/batch-http.cjs.native.js +23 -2
- package/link/batch-http/batchHttpLink.d.ts +3 -2
- package/link/batch-http/batchHttpLink.d.ts.map +1 -1
- package/link/batch-http/batchHttpLink.js +7 -2
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/context/index.d.ts +3 -2
- package/link/context/index.d.ts.map +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.d.ts +3 -2
- package/link/core/ApolloLink.d.ts.map +1 -1
- package/link/core/ApolloLink.js +3 -13
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs +2 -12
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -12
- package/link/core/types.d.ts +8 -3
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +4 -3
- package/link/error/index.d.ts.map +1 -1
- package/link/error/index.js.map +1 -1
- package/link/http/HttpLink.d.ts +3 -2
- package/link/http/HttpLink.d.ts.map +1 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.js +2 -2
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.d.ts +1 -1
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +21 -20
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +73 -43
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +73 -43
- package/link/http/iterators/nodeStream.d.ts +1 -1
- package/link/http/iterators/nodeStream.d.ts.map +1 -1
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js +47 -26
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/responseIterator.d.ts +1 -1
- package/link/http/responseIterator.d.ts.map +1 -1
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/rewriteURIForGET.d.ts +1 -1
- package/link/http/rewriteURIForGET.d.ts.map +1 -1
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +3 -2
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.d.ts +1 -1
- package/link/http/selectURI.d.ts.map +1 -1
- package/link/http/selectURI.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.d.ts.map +1 -1
- package/link/http/serializeFetchParameter.js +2 -2
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.d.ts +4 -3
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +16 -20
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs +15 -19
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +15 -19
- package/link/remove-typename/index.d.ts +2 -0
- package/link/remove-typename/index.d.ts.map +1 -0
- package/link/remove-typename/index.js +2 -0
- package/link/remove-typename/index.js.map +1 -0
- package/link/remove-typename/package.json +8 -0
- package/link/remove-typename/remove-typename.cjs +82 -0
- package/link/remove-typename/remove-typename.cjs.map +1 -0
- package/link/remove-typename/remove-typename.cjs.native.js +82 -0
- package/link/remove-typename/removeTypenameFromVariables.d.ts +11 -0
- package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -0
- package/link/remove-typename/removeTypenameFromVariables.js +74 -0
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -0
- package/link/retry/delayFunction.d.ts +1 -1
- package/link/retry/delayFunction.d.ts.map +1 -1
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/retryFunction.d.ts +1 -1
- package/link/retry/retryFunction.d.ts.map +1 -1
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.d.ts +4 -3
- package/link/retry/retryLink.d.ts.map +1 -1
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +3 -2
- package/link/schema/index.d.ts.map +1 -1
- package/link/schema/index.js.map +1 -1
- package/link/subscriptions/index.d.ts +2 -1
- package/link/subscriptions/index.d.ts.map +1 -1
- package/link/subscriptions/index.js +8 -3
- package/link/subscriptions/index.js.map +1 -1
- package/link/subscriptions/subscriptions.cjs +8 -3
- package/link/subscriptions/subscriptions.cjs.map +1 -1
- package/link/subscriptions/subscriptions.cjs.native.js +8 -3
- package/link/utils/createOperation.d.ts +1 -1
- package/link/utils/createOperation.d.ts.map +1 -1
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/filterOperationVariables.d.ts +5 -0
- package/link/utils/filterOperationVariables.d.ts.map +1 -0
- package/link/utils/filterOperationVariables.js +18 -0
- package/link/utils/filterOperationVariables.js.map +1 -0
- package/link/utils/index.d.ts +1 -0
- package/link/utils/index.d.ts.map +1 -1
- package/link/utils/index.js +1 -0
- package/link/utils/index.js.map +1 -1
- package/link/utils/throwServerError.d.ts +1 -1
- package/link/utils/throwServerError.d.ts.map +1 -1
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.d.ts +1 -1
- package/link/utils/toPromise.d.ts.map +1 -1
- package/link/utils/toPromise.js +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/transformOperation.d.ts +1 -1
- package/link/utils/transformOperation.d.ts.map +1 -1
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/utils.cjs +20 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +20 -2
- package/link/utils/validateOperation.d.ts +1 -1
- package/link/utils/validateOperation.d.ts.map +1 -1
- package/link/utils/validateOperation.js +2 -2
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.d.ts +5 -3
- package/link/ws/index.d.ts.map +1 -1
- package/link/ws/index.js.map +1 -1
- package/package.json +36 -32
- package/react/cache/QueryReference.d.ts +34 -0
- package/react/cache/QueryReference.d.ts.map +1 -0
- package/react/cache/QueryReference.js +107 -0
- package/react/cache/QueryReference.js.map +1 -0
- package/react/cache/SuspenseCache.d.ts +10 -13
- package/react/cache/SuspenseCache.d.ts.map +1 -1
- package/react/cache/SuspenseCache.js +18 -41
- package/react/cache/SuspenseCache.js.map +1 -1
- package/react/cache/types.d.ts +2 -0
- package/react/cache/types.d.ts.map +1 -0
- package/react/cache/types.js +2 -0
- package/react/cache/types.js.map +1 -0
- package/react/components/Mutation.d.ts +2 -2
- package/react/components/Mutation.d.ts.map +1 -1
- package/react/components/Mutation.js.map +1 -1
- package/react/components/Query.d.ts +2 -2
- package/react/components/Query.d.ts.map +1 -1
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.d.ts +2 -2
- package/react/components/Subscription.d.ts.map +1 -1
- package/react/components/Subscription.js.map +1 -1
- package/react/components/types.d.ts +4 -4
- package/react/components/types.d.ts.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.d.ts +1 -1
- package/react/context/ApolloConsumer.d.ts.map +1 -1
- package/react/context/ApolloConsumer.js +2 -3
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +10 -3
- package/react/context/ApolloContext.d.ts.map +1 -1
- package/react/context/ApolloContext.js +10 -8
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +2 -2
- package/react/context/ApolloProvider.d.ts.map +1 -1
- package/react/context/ApolloProvider.js +8 -13
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/context.cjs +18 -22
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +18 -22
- package/react/context/index.d.ts +1 -1
- package/react/context/index.d.ts.map +1 -1
- package/react/context/index.js +1 -1
- package/react/context/index.js.map +1 -1
- package/react/hoc/graphql.d.ts +3 -3
- package/react/hoc/graphql.d.ts.map +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +2 -2
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +2 -3
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/hoc.cjs +2 -4
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -4
- package/react/hoc/mutation-hoc.d.ts +4 -4
- package/react/hoc/mutation-hoc.d.ts.map +1 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.d.ts +2 -2
- package/react/hoc/query-hoc.d.ts.map +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.d.ts +2 -2
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/types.d.ts +4 -4
- package/react/hoc/types.d.ts.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.d.ts +1 -1
- package/react/hoc/withApollo.d.ts.map +1 -1
- package/react/hoc/withApollo.js +2 -3
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs +223 -219
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +223 -219
- package/react/hooks/index.d.ts +2 -1
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js +2 -1
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/internal/__use.d.ts +4 -0
- package/react/hooks/internal/__use.d.ts.map +1 -0
- package/react/hooks/internal/__use.js +17 -0
- package/react/hooks/internal/__use.js.map +1 -0
- package/react/hooks/internal/index.d.ts +2 -0
- package/react/hooks/internal/index.d.ts.map +1 -1
- package/react/hooks/internal/index.js +2 -0
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts.map +1 -1
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +2 -2
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +2 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +1 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +11 -0
- package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +1 -0
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.d.ts.map +1 -1
- package/react/hooks/useApolloClient.js +2 -4
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +18 -0
- package/react/hooks/useBackgroundQuery.d.ts.map +1 -0
- package/react/hooks/useBackgroundQuery.js +69 -0
- package/react/hooks/useBackgroundQuery.js.map +1 -0
- package/react/hooks/useFragment.d.ts +14 -9
- package/react/hooks/useFragment.d.ts.map +1 -1
- package/react/hooks/useFragment.js +2 -2
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +4 -4
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js +13 -22
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +4 -4
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +6 -6
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +29 -28
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -1
- package/react/hooks/useReactiveVar.d.ts.map +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +4 -4
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +27 -19
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseCache.d.ts +1 -1
- package/react/hooks/useSuspenseCache.d.ts.map +1 -1
- package/react/hooks/useSuspenseCache.js +2 -4
- package/react/hooks/useSuspenseCache.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +39 -7
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +68 -149
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.d.ts.map +1 -1
- package/react/index.js +1 -1
- package/react/index.js.map +1 -1
- package/react/parser/index.d.ts +1 -1
- package/react/parser/index.d.ts.map +1 -1
- package/react/parser/index.js +20 -17
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +19 -16
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +19 -16
- package/react/react.cjs +116 -35
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +116 -35
- package/react/ssr/RenderPromises.d.ts +2 -2
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/renderToStringWithData.d.ts +1 -1
- package/react/ssr/renderToStringWithData.d.ts.map +1 -1
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/types/types.d.ts +10 -13
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +1 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +1 -1
- package/testing/core/mocking/mockClient.d.ts +2 -2
- package/testing/core/mocking/mockClient.d.ts.map +1 -1
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +2 -1
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +3 -3
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -2
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
- package/testing/core/mocking/mockWatchQuery.js.map +1 -1
- package/testing/core/observableToPromise.d.ts +2 -2
- package/testing/core/observableToPromise.d.ts.map +1 -1
- package/testing/core/observableToPromise.js.map +1 -1
- package/testing/core/subscribeAndCount.d.ts +1 -1
- package/testing/core/subscribeAndCount.d.ts.map +1 -1
- package/testing/core/subscribeAndCount.js.map +1 -1
- package/testing/matchers/index.d.ts +2 -0
- package/testing/matchers/index.d.ts.map +1 -0
- package/testing/matchers/index.js +6 -0
- package/testing/matchers/index.js.map +1 -0
- package/testing/matchers/toMatchDocument.d.ts +4 -0
- package/testing/matchers/toMatchDocument.d.ts.map +1 -0
- package/testing/matchers/toMatchDocument.js +34 -0
- package/testing/matchers/toMatchDocument.js.map +1 -0
- package/testing/react/MockedProvider.d.ts +8 -7
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +7 -6
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +7 -51
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +7 -51
- package/utilities/common/compact.d.ts +1 -1
- package/utilities/common/compact.d.ts.map +1 -1
- package/utilities/common/compact.js.map +1 -1
- package/utilities/common/errorHandling.d.ts +1 -1
- package/utilities/common/errorHandling.d.ts.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/incrementalResult.d.ts +2 -1
- package/utilities/common/incrementalResult.d.ts.map +1 -1
- package/utilities/common/incrementalResult.js +4 -0
- package/utilities/common/incrementalResult.js.map +1 -1
- package/utilities/common/mergeOptions.d.ts +1 -1
- package/utilities/common/mergeOptions.d.ts.map +1 -1
- package/utilities/common/mergeOptions.js +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/common/objects.d.ts +1 -0
- package/utilities/common/objects.d.ts.map +1 -1
- package/utilities/common/objects.js +6 -0
- package/utilities/common/objects.js.map +1 -1
- package/utilities/common/omitDeep.d.ts +3 -0
- package/utilities/common/omitDeep.d.ts.map +1 -0
- package/utilities/common/omitDeep.js +41 -0
- package/utilities/common/omitDeep.js.map +1 -0
- package/utilities/common/responseIterator.d.ts +2 -2
- package/utilities/common/responseIterator.d.ts.map +1 -1
- package/utilities/common/responseIterator.js.map +1 -1
- package/utilities/common/stringifyForDisplay.d.ts +1 -1
- package/utilities/common/stringifyForDisplay.d.ts.map +1 -1
- package/utilities/common/stringifyForDisplay.js +3 -2
- package/utilities/common/stringifyForDisplay.js.map +1 -1
- package/utilities/common/stripTypename.d.ts +2 -0
- package/utilities/common/stripTypename.d.ts.map +1 -0
- package/utilities/common/stripTypename.js +5 -0
- package/utilities/common/stripTypename.js.map +1 -0
- package/utilities/globals/global.d.ts +6 -3
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/globals.cjs +67 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +67 -1
- package/utilities/globals/index.d.ts +2 -2
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +2 -2
- package/utilities/globals/index.js.map +1 -1
- package/utilities/globals/invariantWrappers.d.ts +24 -0
- package/utilities/globals/invariantWrappers.d.ts.map +1 -0
- package/utilities/globals/invariantWrappers.js +53 -0
- package/utilities/globals/invariantWrappers.js.map +1 -0
- package/utilities/graphql/directives.d.ts +1 -1
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +6 -7
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts +1 -1
- package/utilities/graphql/fragments.d.ts.map +1 -1
- package/utilities/graphql/fragments.js +8 -5
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts +1 -1
- package/utilities/graphql/getFromAST.d.ts.map +1 -1
- package/utilities/graphql/getFromAST.js +9 -9
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/operations.d.ts +5 -0
- package/utilities/graphql/operations.d.ts.map +1 -0
- package/utilities/graphql/operations.js +16 -0
- package/utilities/graphql/operations.js.map +1 -0
- package/utilities/graphql/storeUtils.d.ts +2 -2
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +16 -7
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts +1 -1
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +30 -21
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +6 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +4 -0
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.d.ts +2 -1
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/Observable.d.ts +2 -1
- package/utilities/observables/Observable.d.ts.map +1 -1
- package/utilities/observables/Observable.js +1 -1
- package/utilities/observables/Observable.js.map +1 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.d.ts +1 -1
- package/utilities/observables/iteration.d.ts.map +1 -1
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/policies/pagination.d.ts +1 -1
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/promises/decoration.d.ts +17 -0
- package/utilities/promises/decoration.d.ts.map +1 -0
- package/utilities/promises/decoration.js +37 -0
- package/utilities/promises/decoration.js.map +1 -0
- package/utilities/types/DeepOmit.d.ts +10 -0
- package/utilities/types/DeepOmit.d.ts.map +1 -0
- package/utilities/types/DeepOmit.js +2 -0
- package/utilities/types/DeepOmit.js.map +1 -0
- package/utilities/types/DeepPartial.d.ts +12 -0
- package/utilities/types/DeepPartial.d.ts.map +1 -0
- package/utilities/types/DeepPartial.js +2 -0
- package/utilities/types/DeepPartial.js.map +1 -0
- package/utilities/types/Primitive.d.ts +2 -0
- package/utilities/types/Primitive.d.ts.map +1 -0
- package/utilities/types/Primitive.js +2 -0
- package/utilities/types/Primitive.js.map +1 -0
- package/utilities/utilities.cjs +181 -45
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +181 -45
- package/version.js +1 -1
- package/cache/inmemory/__mocks__/optimism.d.ts +0 -2
- package/cache/inmemory/__mocks__/optimism.d.ts.map +0 -1
- package/cache/inmemory/__mocks__/optimism.js +0 -14
- package/cache/inmemory/__mocks__/optimism.js.map +0 -1
- package/react/hooks/compareResults.d.ts +0 -3
- package/react/hooks/compareResults.d.ts.map +0 -1
- package/react/hooks/compareResults.js.map +0 -1
|
@@ -31,9 +31,7 @@ function parser(document) {
|
|
|
31
31
|
if (cached)
|
|
32
32
|
return cached;
|
|
33
33
|
var variables, type, name;
|
|
34
|
-
globals.
|
|
35
|
-
"DocumentNode. You may need to use 'graphql-tag' or another method " +
|
|
36
|
-
"to convert your operation into a document") : globals.invariant(!!document && !!document.kind, 35);
|
|
34
|
+
globals.invariant(!!document && !!document.kind, 60, document);
|
|
37
35
|
var fragments = [];
|
|
38
36
|
var queries = [];
|
|
39
37
|
var mutations = [];
|
|
@@ -58,14 +56,16 @@ function parser(document) {
|
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
|
-
globals.
|
|
62
|
-
(queries.length || mutations.length || subscriptions.length),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
globals.invariant(!fragments.length ||
|
|
60
|
+
(queries.length || mutations.length || subscriptions.length), 61);
|
|
61
|
+
globals.invariant(
|
|
62
|
+
queries.length + mutations.length + subscriptions.length <= 1,
|
|
63
|
+
62,
|
|
64
|
+
document,
|
|
65
|
+
queries.length,
|
|
66
|
+
subscriptions.length,
|
|
67
|
+
mutations.length
|
|
68
|
+
);
|
|
69
69
|
type = queries.length ? exports.DocumentType.Query : exports.DocumentType.Mutation;
|
|
70
70
|
if (!queries.length && !mutations.length)
|
|
71
71
|
type = exports.DocumentType.Subscription;
|
|
@@ -74,9 +74,7 @@ function parser(document) {
|
|
|
74
74
|
: mutations.length
|
|
75
75
|
? mutations
|
|
76
76
|
: subscriptions;
|
|
77
|
-
globals.
|
|
78
|
-
"".concat(definitions.length, " definitions. ") +
|
|
79
|
-
"You can use 'compose' to join multiple operation types to a component") : globals.invariant(definitions.length === 1, 38);
|
|
77
|
+
globals.invariant(definitions.length === 1, 63, document, definitions.length);
|
|
80
78
|
var definition = definitions[0];
|
|
81
79
|
variables = definition.variableDefinitions || [];
|
|
82
80
|
if (definition.name && definition.name.kind === 'Name') {
|
|
@@ -93,8 +91,13 @@ function verifyDocumentType(document, type) {
|
|
|
93
91
|
var operation = parser(document);
|
|
94
92
|
var requiredOperationName = operationName(type);
|
|
95
93
|
var usedOperationName = operationName(operation.type);
|
|
96
|
-
globals.
|
|
97
|
-
|
|
94
|
+
globals.invariant(
|
|
95
|
+
operation.type === type,
|
|
96
|
+
64,
|
|
97
|
+
requiredOperationName,
|
|
98
|
+
requiredOperationName,
|
|
99
|
+
usedOperationName
|
|
100
|
+
);
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
exports.operationName = operationName;
|
package/react/react.cjs
CHANGED
|
@@ -6,51 +6,132 @@ require('../utilities/globals');
|
|
|
6
6
|
var context = require('./context');
|
|
7
7
|
var hooks = require('./hooks');
|
|
8
8
|
var parser = require('./parser');
|
|
9
|
-
var
|
|
9
|
+
var trie = require('@wry/trie');
|
|
10
|
+
var utilities = require('../utilities');
|
|
11
|
+
var tslib = require('tslib');
|
|
12
|
+
var core = require('../core');
|
|
10
13
|
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
+
var QueryReference = (function () {
|
|
15
|
+
function QueryReference(observable, options) {
|
|
16
|
+
var _this = this;
|
|
17
|
+
var _a;
|
|
18
|
+
this.listeners = new Set();
|
|
19
|
+
this.initialized = false;
|
|
20
|
+
this.refetching = false;
|
|
21
|
+
this.listen = this.listen.bind(this);
|
|
22
|
+
this.handleNext = this.handleNext.bind(this);
|
|
23
|
+
this.handleError = this.handleError.bind(this);
|
|
24
|
+
this.dispose = this.dispose.bind(this);
|
|
25
|
+
this.observable = observable;
|
|
26
|
+
this.result = observable.getCurrentResult(false);
|
|
27
|
+
this.key = options.key;
|
|
28
|
+
if (options.onDispose) {
|
|
29
|
+
this.onDispose = options.onDispose;
|
|
30
|
+
}
|
|
31
|
+
if (core.isNetworkRequestSettled(this.result.networkStatus) ||
|
|
32
|
+
(this.result.data &&
|
|
33
|
+
(!this.result.partial || this.observable.options.returnPartialData))) {
|
|
34
|
+
this.promise = utilities.createFulfilledPromise(this.result);
|
|
35
|
+
this.initialized = true;
|
|
36
|
+
this.refetching = false;
|
|
37
|
+
}
|
|
38
|
+
this.subscription = observable.subscribe({
|
|
39
|
+
next: this.handleNext,
|
|
40
|
+
error: this.handleError,
|
|
41
|
+
});
|
|
42
|
+
if (!this.promise) {
|
|
43
|
+
this.promise = new Promise(function (resolve, reject) {
|
|
44
|
+
_this.resolve = resolve;
|
|
45
|
+
_this.reject = reject;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
|
|
14
49
|
}
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
fulfilled: false,
|
|
22
|
-
promise: promise
|
|
23
|
-
.catch(function () {
|
|
24
|
-
})
|
|
25
|
-
.finally(function () {
|
|
26
|
-
entry.fulfilled = true;
|
|
27
|
-
}),
|
|
50
|
+
QueryReference.prototype.listen = function (listener) {
|
|
51
|
+
var _this = this;
|
|
52
|
+
clearTimeout(this.autoDisposeTimeoutId);
|
|
53
|
+
this.listeners.add(listener);
|
|
54
|
+
return function () {
|
|
55
|
+
_this.listeners.delete(listener);
|
|
28
56
|
};
|
|
29
|
-
map.set(variablesKey, entry);
|
|
30
|
-
this.queries.set(query, map);
|
|
31
|
-
return entry;
|
|
32
57
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
58
|
+
QueryReference.prototype.refetch = function (variables) {
|
|
59
|
+
this.refetching = true;
|
|
60
|
+
var promise = this.observable.refetch(variables);
|
|
61
|
+
this.promise = promise;
|
|
62
|
+
return promise;
|
|
63
|
+
};
|
|
64
|
+
QueryReference.prototype.fetchMore = function (options) {
|
|
65
|
+
var promise = this.observable.fetchMore(options);
|
|
66
|
+
this.promise = promise;
|
|
67
|
+
return promise;
|
|
68
|
+
};
|
|
69
|
+
QueryReference.prototype.dispose = function () {
|
|
70
|
+
this.subscription.unsubscribe();
|
|
71
|
+
this.onDispose();
|
|
72
|
+
};
|
|
73
|
+
QueryReference.prototype.onDispose = function () {
|
|
37
74
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
75
|
+
QueryReference.prototype.handleNext = function (result) {
|
|
76
|
+
if (!this.initialized || this.refetching) {
|
|
77
|
+
if (!core.isNetworkRequestSettled(result.networkStatus)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (this.result.data && result.data === void 0) {
|
|
81
|
+
result.data = this.result.data;
|
|
82
|
+
}
|
|
83
|
+
this.initialized = true;
|
|
84
|
+
this.refetching = false;
|
|
85
|
+
this.result = result;
|
|
86
|
+
this.resolve(result);
|
|
41
87
|
return;
|
|
42
88
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (entry && !entry.observable.hasObservers()) {
|
|
46
|
-
map.delete(key);
|
|
89
|
+
if (result.data === this.result.data) {
|
|
90
|
+
return;
|
|
47
91
|
}
|
|
48
|
-
|
|
49
|
-
|
|
92
|
+
this.result = result;
|
|
93
|
+
this.promise = utilities.createFulfilledPromise(result);
|
|
94
|
+
this.deliver(this.promise);
|
|
95
|
+
};
|
|
96
|
+
QueryReference.prototype.handleError = function (error) {
|
|
97
|
+
var result = tslib.__assign(tslib.__assign({}, this.result), { error: error, networkStatus: core.NetworkStatus.error });
|
|
98
|
+
this.result = result;
|
|
99
|
+
if (!this.initialized || this.refetching) {
|
|
100
|
+
this.initialized = true;
|
|
101
|
+
this.refetching = false;
|
|
102
|
+
this.reject(error);
|
|
103
|
+
return;
|
|
50
104
|
}
|
|
105
|
+
this.result = result;
|
|
106
|
+
this.promise = result.data
|
|
107
|
+
? utilities.createFulfilledPromise(result)
|
|
108
|
+
: utilities.createRejectedPromise(result);
|
|
109
|
+
this.deliver(this.promise);
|
|
51
110
|
};
|
|
52
|
-
|
|
53
|
-
|
|
111
|
+
QueryReference.prototype.deliver = function (promise) {
|
|
112
|
+
this.listeners.forEach(function (listener) { return listener(promise); });
|
|
113
|
+
};
|
|
114
|
+
return QueryReference;
|
|
115
|
+
}());
|
|
116
|
+
|
|
117
|
+
var SuspenseCache = (function () {
|
|
118
|
+
function SuspenseCache(options) {
|
|
119
|
+
if (options === void 0) { options = Object.create(null); }
|
|
120
|
+
this.cacheKeys = new trie.Trie(utilities.canUseWeakMap, function (cacheKey) { return cacheKey; });
|
|
121
|
+
this.queryRefs = new Map();
|
|
122
|
+
this.options = options;
|
|
123
|
+
}
|
|
124
|
+
SuspenseCache.prototype.getQueryRef = function (cacheKey, createObservable) {
|
|
125
|
+
var _this = this;
|
|
126
|
+
var stableCacheKey = this.cacheKeys.lookupArray(cacheKey);
|
|
127
|
+
if (!this.queryRefs.has(stableCacheKey)) {
|
|
128
|
+
this.queryRefs.set(stableCacheKey, new QueryReference(createObservable(), {
|
|
129
|
+
key: stableCacheKey,
|
|
130
|
+
autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,
|
|
131
|
+
onDispose: function () { return _this.queryRefs.delete(stableCacheKey); },
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
return this.queryRefs.get(stableCacheKey);
|
|
54
135
|
};
|
|
55
136
|
return SuspenseCache;
|
|
56
137
|
}());
|
package/react/react.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs","sources":["cache/SuspenseCache.js"],"sourcesContent":["import { canonicalStringify } from '../../cache';\nvar SuspenseCache = (function () {\n function SuspenseCache() {\n this.queries = new Map();\n }\n SuspenseCache.prototype.add = function (query, variables, _a) {\n var promise = _a.promise, observable = _a.observable;\n var variablesKey = this.getVariablesKey(variables);\n var map = this.queries.get(query) || new Map();\n var entry = {\n observable: observable,\n fulfilled: false,\n promise: promise\n .catch(function () {\n })\n .finally(function () {\n entry.fulfilled = true;\n }),\n };\n map.set(variablesKey, entry);\n this.queries.set(query, map);\n return entry;\n };\n SuspenseCache.prototype.lookup = function (query, variables) {\n var _a;\n return (_a = this.queries\n .get(query)) === null || _a === void 0 ? void 0 : _a.get(this.getVariablesKey(variables));\n };\n SuspenseCache.prototype.remove = function (query, variables) {\n var map = this.queries.get(query);\n if (!map) {\n return;\n }\n var key = this.getVariablesKey(variables);\n var entry = map.get(key);\n if (entry && !entry.observable.hasObservers()) {\n map.delete(key);\n }\n if (map.size === 0) {\n this.queries.delete(query);\n }\n };\n SuspenseCache.prototype.getVariablesKey = function (variables) {\n return canonicalStringify(variables || Object.create(null));\n };\n return SuspenseCache;\n}());\nexport { SuspenseCache };\n//# sourceMappingURL=SuspenseCache.js.map"],"names":["canonicalStringify"],"mappings":";;;;;;;;;;AACG,IAAC,aAAa,IAAI,YAAY;AACjC,IAAI,SAAS,aAAa,GAAG;AAC7B,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;AACjC,KAAK;AACL,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,GAAG,UAAU,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;AAClE,QAAQ,IAAI,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AAC7D,QAAQ,IAAI,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAC3D,QAAQ,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;AACvD,QAAQ,IAAI,KAAK,GAAG;AACpB,YAAY,UAAU,EAAE,UAAU;AAClC,YAAY,SAAS,EAAE,KAAK;AAC5B,YAAY,OAAO,EAAE,OAAO;AAC5B,iBAAiB,KAAK,CAAC,YAAY;AACnC,aAAa,CAAC;AACd,iBAAiB,OAAO,CAAC,YAAY;AACrC,gBAAgB,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;AACvC,aAAa,CAAC;AACd,SAAS,CAAC;AACV,QAAQ,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACrC,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACrC,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK,CAAC;AACN,IAAI,aAAa,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,KAAK,EAAE,SAAS,EAAE;AACjE,QAA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.js","cache/SuspenseCache.js"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { NetworkStatus, isNetworkRequestSettled } from '../../core';\nimport { createFulfilledPromise, createRejectedPromise } from '../../utilities';\nvar QueryReference = (function () {\n function QueryReference(observable, options) {\n var _this = this;\n var _a;\n this.listeners = new Set();\n this.initialized = false;\n this.refetching = false;\n this.listen = this.listen.bind(this);\n this.handleNext = this.handleNext.bind(this);\n this.handleError = this.handleError.bind(this);\n this.dispose = this.dispose.bind(this);\n this.observable = observable;\n this.result = observable.getCurrentResult(false);\n this.key = options.key;\n if (options.onDispose) {\n this.onDispose = options.onDispose;\n }\n if (isNetworkRequestSettled(this.result.networkStatus) ||\n (this.result.data &&\n (!this.result.partial || this.observable.options.returnPartialData))) {\n this.promise = createFulfilledPromise(this.result);\n this.initialized = true;\n this.refetching = false;\n }\n this.subscription = observable.subscribe({\n next: this.handleNext,\n error: this.handleError,\n });\n if (!this.promise) {\n this.promise = new Promise(function (resolve, reject) {\n _this.resolve = resolve;\n _this.reject = reject;\n });\n }\n this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);\n }\n QueryReference.prototype.listen = function (listener) {\n var _this = this;\n clearTimeout(this.autoDisposeTimeoutId);\n this.listeners.add(listener);\n return function () {\n _this.listeners.delete(listener);\n };\n };\n QueryReference.prototype.refetch = function (variables) {\n this.refetching = true;\n var promise = this.observable.refetch(variables);\n this.promise = promise;\n return promise;\n };\n QueryReference.prototype.fetchMore = function (options) {\n var promise = this.observable.fetchMore(options);\n this.promise = promise;\n return promise;\n };\n QueryReference.prototype.dispose = function () {\n this.subscription.unsubscribe();\n this.onDispose();\n };\n QueryReference.prototype.onDispose = function () {\n };\n QueryReference.prototype.handleNext = function (result) {\n if (!this.initialized || this.refetching) {\n if (!isNetworkRequestSettled(result.networkStatus)) {\n return;\n }\n if (this.result.data && result.data === void 0) {\n result.data = this.result.data;\n }\n this.initialized = true;\n this.refetching = false;\n this.result = result;\n this.resolve(result);\n return;\n }\n if (result.data === this.result.data) {\n return;\n }\n this.result = result;\n this.promise = createFulfilledPromise(result);\n this.deliver(this.promise);\n };\n QueryReference.prototype.handleError = function (error) {\n var result = __assign(__assign({}, this.result), { error: error, networkStatus: NetworkStatus.error });\n this.result = result;\n if (!this.initialized || this.refetching) {\n this.initialized = true;\n this.refetching = false;\n this.reject(error);\n return;\n }\n this.result = result;\n this.promise = result.data\n ? createFulfilledPromise(result)\n : createRejectedPromise(result);\n this.deliver(this.promise);\n };\n QueryReference.prototype.deliver = function (promise) {\n this.listeners.forEach(function (listener) { return listener(promise); });\n };\n return QueryReference;\n}());\nexport { QueryReference };\n//# sourceMappingURL=QueryReference.js.map","import { Trie } from '@wry/trie';\nimport { canUseWeakMap } from '../../utilities';\nimport { QueryReference } from './QueryReference';\nvar SuspenseCache = (function () {\n function SuspenseCache(options) {\n if (options === void 0) { options = Object.create(null); }\n this.cacheKeys = new Trie(canUseWeakMap, function (cacheKey) { return cacheKey; });\n this.queryRefs = new Map();\n this.options = options;\n }\n SuspenseCache.prototype.getQueryRef = function (cacheKey, createObservable) {\n var _this = this;\n var stableCacheKey = this.cacheKeys.lookupArray(cacheKey);\n if (!this.queryRefs.has(stableCacheKey)) {\n this.queryRefs.set(stableCacheKey, new QueryReference(createObservable(), {\n key: stableCacheKey,\n autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,\n onDispose: function () { return _this.queryRefs.delete(stableCacheKey); },\n }));\n }\n return this.queryRefs.get(stableCacheKey);\n };\n return SuspenseCache;\n}());\nexport { SuspenseCache };\n//# sourceMappingURL=SuspenseCache.js.map"],"names":["isNetworkRequestSettled","createFulfilledPromise","__assign","NetworkStatus","createRejectedPromise","Trie","canUseWeakMap"],"mappings":";;;;;;;;;;;;;AAGA,IAAI,cAAc,IAAI,YAAY;AAClC,IAAI,SAAS,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE;AACjD,QAAQ,IAAI,KAAK,GAA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CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE;AACzF,aAAa,CAAC,CAAC,CAAC;AAChB,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAClD,KAAK,CAAC;AACN,IAAI,OAAO,aAAa,CAAC;AACzB,CAAC,EAAE;;;;;;;;;;;;;;"}
|
|
@@ -6,51 +6,132 @@ require('../utilities/globals');
|
|
|
6
6
|
var context = require('./context');
|
|
7
7
|
var hooks = require('./hooks');
|
|
8
8
|
var parser = require('./parser');
|
|
9
|
-
var
|
|
9
|
+
var trie = require('@wry/trie');
|
|
10
|
+
var utilities = require('../utilities');
|
|
11
|
+
var tslib = require('tslib');
|
|
12
|
+
var core = require('../core');
|
|
10
13
|
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
+
var QueryReference = (function () {
|
|
15
|
+
function QueryReference(observable, options) {
|
|
16
|
+
var _this = this;
|
|
17
|
+
var _a;
|
|
18
|
+
this.listeners = new Set();
|
|
19
|
+
this.initialized = false;
|
|
20
|
+
this.refetching = false;
|
|
21
|
+
this.listen = this.listen.bind(this);
|
|
22
|
+
this.handleNext = this.handleNext.bind(this);
|
|
23
|
+
this.handleError = this.handleError.bind(this);
|
|
24
|
+
this.dispose = this.dispose.bind(this);
|
|
25
|
+
this.observable = observable;
|
|
26
|
+
this.result = observable.getCurrentResult(false);
|
|
27
|
+
this.key = options.key;
|
|
28
|
+
if (options.onDispose) {
|
|
29
|
+
this.onDispose = options.onDispose;
|
|
30
|
+
}
|
|
31
|
+
if (core.isNetworkRequestSettled(this.result.networkStatus) ||
|
|
32
|
+
(this.result.data &&
|
|
33
|
+
(!this.result.partial || this.observable.options.returnPartialData))) {
|
|
34
|
+
this.promise = utilities.createFulfilledPromise(this.result);
|
|
35
|
+
this.initialized = true;
|
|
36
|
+
this.refetching = false;
|
|
37
|
+
}
|
|
38
|
+
this.subscription = observable.subscribe({
|
|
39
|
+
next: this.handleNext,
|
|
40
|
+
error: this.handleError,
|
|
41
|
+
});
|
|
42
|
+
if (!this.promise) {
|
|
43
|
+
this.promise = new Promise(function (resolve, reject) {
|
|
44
|
+
_this.resolve = resolve;
|
|
45
|
+
_this.reject = reject;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
|
|
14
49
|
}
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
fulfilled: false,
|
|
22
|
-
promise: promise
|
|
23
|
-
.catch(function () {
|
|
24
|
-
})
|
|
25
|
-
.finally(function () {
|
|
26
|
-
entry.fulfilled = true;
|
|
27
|
-
}),
|
|
50
|
+
QueryReference.prototype.listen = function (listener) {
|
|
51
|
+
var _this = this;
|
|
52
|
+
clearTimeout(this.autoDisposeTimeoutId);
|
|
53
|
+
this.listeners.add(listener);
|
|
54
|
+
return function () {
|
|
55
|
+
_this.listeners.delete(listener);
|
|
28
56
|
};
|
|
29
|
-
map.set(variablesKey, entry);
|
|
30
|
-
this.queries.set(query, map);
|
|
31
|
-
return entry;
|
|
32
57
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
58
|
+
QueryReference.prototype.refetch = function (variables) {
|
|
59
|
+
this.refetching = true;
|
|
60
|
+
var promise = this.observable.refetch(variables);
|
|
61
|
+
this.promise = promise;
|
|
62
|
+
return promise;
|
|
63
|
+
};
|
|
64
|
+
QueryReference.prototype.fetchMore = function (options) {
|
|
65
|
+
var promise = this.observable.fetchMore(options);
|
|
66
|
+
this.promise = promise;
|
|
67
|
+
return promise;
|
|
68
|
+
};
|
|
69
|
+
QueryReference.prototype.dispose = function () {
|
|
70
|
+
this.subscription.unsubscribe();
|
|
71
|
+
this.onDispose();
|
|
72
|
+
};
|
|
73
|
+
QueryReference.prototype.onDispose = function () {
|
|
37
74
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
75
|
+
QueryReference.prototype.handleNext = function (result) {
|
|
76
|
+
if (!this.initialized || this.refetching) {
|
|
77
|
+
if (!core.isNetworkRequestSettled(result.networkStatus)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (this.result.data && result.data === void 0) {
|
|
81
|
+
result.data = this.result.data;
|
|
82
|
+
}
|
|
83
|
+
this.initialized = true;
|
|
84
|
+
this.refetching = false;
|
|
85
|
+
this.result = result;
|
|
86
|
+
this.resolve(result);
|
|
41
87
|
return;
|
|
42
88
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (entry && !entry.observable.hasObservers()) {
|
|
46
|
-
map.delete(key);
|
|
89
|
+
if (result.data === this.result.data) {
|
|
90
|
+
return;
|
|
47
91
|
}
|
|
48
|
-
|
|
49
|
-
|
|
92
|
+
this.result = result;
|
|
93
|
+
this.promise = utilities.createFulfilledPromise(result);
|
|
94
|
+
this.deliver(this.promise);
|
|
95
|
+
};
|
|
96
|
+
QueryReference.prototype.handleError = function (error) {
|
|
97
|
+
var result = tslib.__assign(tslib.__assign({}, this.result), { error: error, networkStatus: core.NetworkStatus.error });
|
|
98
|
+
this.result = result;
|
|
99
|
+
if (!this.initialized || this.refetching) {
|
|
100
|
+
this.initialized = true;
|
|
101
|
+
this.refetching = false;
|
|
102
|
+
this.reject(error);
|
|
103
|
+
return;
|
|
50
104
|
}
|
|
105
|
+
this.result = result;
|
|
106
|
+
this.promise = result.data
|
|
107
|
+
? utilities.createFulfilledPromise(result)
|
|
108
|
+
: utilities.createRejectedPromise(result);
|
|
109
|
+
this.deliver(this.promise);
|
|
51
110
|
};
|
|
52
|
-
|
|
53
|
-
|
|
111
|
+
QueryReference.prototype.deliver = function (promise) {
|
|
112
|
+
this.listeners.forEach(function (listener) { return listener(promise); });
|
|
113
|
+
};
|
|
114
|
+
return QueryReference;
|
|
115
|
+
}());
|
|
116
|
+
|
|
117
|
+
var SuspenseCache = (function () {
|
|
118
|
+
function SuspenseCache(options) {
|
|
119
|
+
if (options === void 0) { options = Object.create(null); }
|
|
120
|
+
this.cacheKeys = new trie.Trie(utilities.canUseWeakMap, function (cacheKey) { return cacheKey; });
|
|
121
|
+
this.queryRefs = new Map();
|
|
122
|
+
this.options = options;
|
|
123
|
+
}
|
|
124
|
+
SuspenseCache.prototype.getQueryRef = function (cacheKey, createObservable) {
|
|
125
|
+
var _this = this;
|
|
126
|
+
var stableCacheKey = this.cacheKeys.lookupArray(cacheKey);
|
|
127
|
+
if (!this.queryRefs.has(stableCacheKey)) {
|
|
128
|
+
this.queryRefs.set(stableCacheKey, new QueryReference(createObservable(), {
|
|
129
|
+
key: stableCacheKey,
|
|
130
|
+
autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,
|
|
131
|
+
onDispose: function () { return _this.queryRefs.delete(stableCacheKey); },
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
return this.queryRefs.get(stableCacheKey);
|
|
54
135
|
};
|
|
55
136
|
return SuspenseCache;
|
|
56
137
|
}());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ObservableQuery, OperationVariables } from '../../core';
|
|
3
|
-
import { QueryDataOptions } from '../types/types';
|
|
2
|
+
import type { ObservableQuery, OperationVariables } from '../../core';
|
|
3
|
+
import type { QueryDataOptions } from '../types/types';
|
|
4
4
|
interface QueryData {
|
|
5
5
|
getOptions(): any;
|
|
6
6
|
fetchData(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPromises.d.ts","sourceRoot":"","sources":["../../../src/react/ssr/RenderPromises.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"RenderPromises.d.ts","sourceRoot":"","sources":["../../../src/react/ssr/RenderPromises.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,UAAU,SAAS;IACjB,UAAU,IAAI,GAAG,CAAC;IAClB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAcD,qBAAa,cAAc;IAEzB,OAAO,CAAC,aAAa,CAAuD;IAM5E,OAAO,CAAC,aAAa,CAAmD;IAExE,OAAO,CAAC,OAAO,CAAS;IACjB,IAAI;IASJ,qBAAqB,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB,EACvE,UAAU,EAAE,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC;IAOvC,gBAAgB,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB,EAClE,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,GACzC,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,IAAI;IAInC,eAAe,CACpB,aAAa,EAAE,SAAS,EACxB,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,GAC7B,KAAK,CAAC,SAAS;IAkBX,yBAAyB,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB,EAC3E,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC;IA0BvC,WAAW;IAIX,uBAAuB;IAmB9B,OAAO,CAAC,eAAe;CAYxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPromises.js","sourceRoot":"","sources":["../../../src/react/ssr/RenderPromises.ts"],"names":[],"mappings":"AAiBA,SAAS,oBAAoB;IAC3B,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC;AAED;IAAA;QAEU,kBAAa,GAAG,IAAI,GAAG,EAA4C,CAAC;QAMpE,kBAA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E,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChE,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAClD,IAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,oBAAoB,EAAE,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IACH,qBAAC;AAAD,CAAC,AArHD,IAqHC","sourcesContent":["import { DocumentNode } from 'graphql';\n\nimport { ObservableQuery, OperationVariables } from '../../core';\nimport { QueryDataOptions } from '../types/types';\n\n// TODO: A vestigial interface from when hooks were implemented with utility\n// classes, which should be deleted in the future.\ninterface QueryData {\n getOptions(): any;\n fetchData(): Promise<void>;\n}\n\ntype QueryInfo = {\n seen: boolean;\n observable: ObservableQuery<any, any> | null;\n};\n\nfunction makeDefaultQueryInfo(): QueryInfo {\n return {\n seen: false,\n observable: null\n };\n}\n\nexport class RenderPromises {\n // Map from Query component instances to pending fetchData promises.\n private queryPromises = new Map<QueryDataOptions<any, any>, Promise<any>>();\n\n // Two-layered map from (query document, stringified variables) to QueryInfo\n // objects. These QueryInfo objects are intended to survive through the whole\n // getMarkupFromTree process, whereas specific Query instances do not survive\n // beyond a single call to renderToStaticMarkup.\n private queryInfoTrie = new Map<DocumentNode, Map<string, QueryInfo>>();\n\n private stopped = false;\n public stop() {\n if (!this.stopped) {\n this.queryPromises.clear();\n this.queryInfoTrie.clear();\n this.stopped = true;\n }\n }\n\n // Registers the server side rendered observable.\n public registerSSRObservable<TData, TVariables extends OperationVariables>(\n observable: ObservableQuery<any, TVariables>,\n ) {\n if (this.stopped) return;\n this.lookupQueryInfo(observable.options).observable = observable;\n }\n\n // Get's the cached observable that matches the SSR Query instances query and variables.\n public getSSRObservable<TData, TVariables extends OperationVariables>(\n props: QueryDataOptions<TData, TVariables>\n ): ObservableQuery<any, TVariables> | null {\n return this.lookupQueryInfo(props).observable;\n }\n\n public addQueryPromise(\n queryInstance: QueryData,\n finish?: () => React.ReactNode,\n ): React.ReactNode {\n if (!this.stopped) {\n const info = this.lookupQueryInfo(queryInstance.getOptions());\n if (!info.seen) {\n this.queryPromises.set(\n queryInstance.getOptions(),\n new Promise(resolve => {\n resolve(queryInstance.fetchData());\n })\n );\n // Render null to abandon this subtree for this rendering, so that we\n // can wait for the data to arrive.\n return null;\n }\n }\n return finish ? finish() : null;\n }\n\n public addObservableQueryPromise<TData, TVariables extends OperationVariables>(\n obsQuery: ObservableQuery<TData, TVariables>,\n ) {\n return this.addQueryPromise({\n // The only options which seem to actually be used by the\n // RenderPromises class are query and variables.\n getOptions: () => obsQuery.options,\n fetchData: () => new Promise<void>((resolve) => {\n const sub = obsQuery.subscribe({\n next(result) {\n if (!result.loading) {\n resolve()\n sub.unsubscribe();\n }\n },\n error() {\n resolve();\n sub.unsubscribe();\n },\n complete() {\n resolve();\n },\n });\n }),\n });\n }\n\n public hasPromises() {\n return this.queryPromises.size > 0;\n }\n\n public consumeAndAwaitPromises() {\n const promises: Promise<any>[] = [];\n this.queryPromises.forEach((promise, queryInstance) => {\n // Make sure we never try to call fetchData for this query document and\n // these variables again. Since the queryInstance objects change with\n // every rendering, deduplicating them by query and variables is the\n // best we can do. If a different Query component happens to have the\n // same query document and variables, it will be immediately rendered\n // by calling finish() in addQueryPromise, which could result in the\n // rendering of an unwanted loading state, but that's not nearly as bad\n // as getting stuck in an infinite rendering loop because we kept calling\n // queryInstance.fetchData for the same Query component indefinitely.\n this.lookupQueryInfo(queryInstance).seen = true;\n promises.push(promise);\n });\n this.queryPromises.clear();\n return Promise.all(promises);\n }\n\n private lookupQueryInfo<TData, TVariables extends OperationVariables>(\n props: QueryDataOptions<TData, TVariables>\n ): QueryInfo {\n const { queryInfoTrie } = this;\n const { query, variables } = props;\n const varMap = queryInfoTrie.get(query) || new Map<string, QueryInfo>();\n if (!queryInfoTrie.has(query)) queryInfoTrie.set(query, varMap);\n const variablesString = JSON.stringify(variables);\n const info = varMap.get(variablesString) || makeDefaultQueryInfo();\n if (!varMap.has(variablesString)) varMap.set(variablesString, info);\n return info;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RenderPromises.js","sourceRoot":"","sources":["../../../src/react/ssr/RenderPromises.ts"],"names":[],"mappings":"AAiBA,SAAS,oBAAoB;IAC3B,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC;AAED;IAAA;QAEU,kBAAa,GAAG,IAAI,GAAG,EAA4C,CAAC;QAMpE,kBAAa,GAAG,IAAI,GAAG,EAAwC,CAAC;QAEhE,YAAO,GAAG,KAAK,CAAC;IA2G1B,CAAC;IA1GQ,6BAAI,GAAX;QACE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;YAC3B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;SACrB;IACH,CAAC;IAGM,8CAAqB,GAA5B,UACE,UAA4C;QAE5C,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzB,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC;IACnE,CAAC;IAGM,yCAAgB,GAAvB,UACE,KAA0C;QAE1C,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAChD,CAAC;IAEM,wCAAe,GAAtB,UACE,aAAwB,EACxB,MAA8B;QAE9B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,a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;YAUhD,KAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;YAChD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAEO,wCAAe,GAAvB,UACE,KAA0C;QAElC,IAAA,aAAa,GAAK,IAAI,cAAT,CAAU;QACvB,IAAA,KAAK,GAAgB,KAAK,MAArB,EAAE,SAAS,GAAK,KAAK,UAAV,CAAW;QACnC,IAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,EAAqB,CAAC;QACxE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChE,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAClD,IAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,oBAAoB,EAAE,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IACH,qBAAC;AAAD,CAAC,AArHD,IAqHC","sourcesContent":["import type { DocumentNode } from 'graphql';\n\nimport type { ObservableQuery, OperationVariables } from '../../core';\nimport type { QueryDataOptions } from '../types/types';\n\n// TODO: A vestigial interface from when hooks were implemented with utility\n// classes, which should be deleted in the future.\ninterface QueryData {\n getOptions(): any;\n fetchData(): Promise<void>;\n}\n\ntype QueryInfo = {\n seen: boolean;\n observable: ObservableQuery<any, any> | null;\n};\n\nfunction makeDefaultQueryInfo(): QueryInfo {\n return {\n seen: false,\n observable: null\n };\n}\n\nexport class RenderPromises {\n // Map from Query component instances to pending fetchData promises.\n private queryPromises = new Map<QueryDataOptions<any, any>, Promise<any>>();\n\n // Two-layered map from (query document, stringified variables) to QueryInfo\n // objects. These QueryInfo objects are intended to survive through the whole\n // getMarkupFromTree process, whereas specific Query instances do not survive\n // beyond a single call to renderToStaticMarkup.\n private queryInfoTrie = new Map<DocumentNode, Map<string, QueryInfo>>();\n\n private stopped = false;\n public stop() {\n if (!this.stopped) {\n this.queryPromises.clear();\n this.queryInfoTrie.clear();\n this.stopped = true;\n }\n }\n\n // Registers the server side rendered observable.\n public registerSSRObservable<TData, TVariables extends OperationVariables>(\n observable: ObservableQuery<any, TVariables>,\n ) {\n if (this.stopped) return;\n this.lookupQueryInfo(observable.options).observable = observable;\n }\n\n // Get's the cached observable that matches the SSR Query instances query and variables.\n public getSSRObservable<TData, TVariables extends OperationVariables>(\n props: QueryDataOptions<TData, TVariables>\n ): ObservableQuery<any, TVariables> | null {\n return this.lookupQueryInfo(props).observable;\n }\n\n public addQueryPromise(\n queryInstance: QueryData,\n finish?: () => React.ReactNode,\n ): React.ReactNode {\n if (!this.stopped) {\n const info = this.lookupQueryInfo(queryInstance.getOptions());\n if (!info.seen) {\n this.queryPromises.set(\n queryInstance.getOptions(),\n new Promise(resolve => {\n resolve(queryInstance.fetchData());\n })\n );\n // Render null to abandon this subtree for this rendering, so that we\n // can wait for the data to arrive.\n return null;\n }\n }\n return finish ? finish() : null;\n }\n\n public addObservableQueryPromise<TData, TVariables extends OperationVariables>(\n obsQuery: ObservableQuery<TData, TVariables>,\n ) {\n return this.addQueryPromise({\n // The only options which seem to actually be used by the\n // RenderPromises class are query and variables.\n getOptions: () => obsQuery.options,\n fetchData: () => new Promise<void>((resolve) => {\n const sub = obsQuery.subscribe({\n next(result) {\n if (!result.loading) {\n resolve()\n sub.unsubscribe();\n }\n },\n error() {\n resolve();\n sub.unsubscribe();\n },\n complete() {\n resolve();\n },\n });\n }),\n });\n }\n\n public hasPromises() {\n return this.queryPromises.size > 0;\n }\n\n public consumeAndAwaitPromises() {\n const promises: Promise<any>[] = [];\n this.queryPromises.forEach((promise, queryInstance) => {\n // Make sure we never try to call fetchData for this query document and\n // these variables again. Since the queryInstance objects change with\n // every rendering, deduplicating them by query and variables is the\n // best we can do. If a different Query component happens to have the\n // same query document and variables, it will be immediately rendered\n // by calling finish() in addQueryPromise, which could result in the\n // rendering of an unwanted loading state, but that's not nearly as bad\n // as getting stuck in an infinite rendering loop because we kept calling\n // queryInstance.fetchData for the same Query component indefinitely.\n this.lookupQueryInfo(queryInstance).seen = true;\n promises.push(promise);\n });\n this.queryPromises.clear();\n return Promise.all(promises);\n }\n\n private lookupQueryInfo<TData, TVariables extends OperationVariables>(\n props: QueryDataOptions<TData, TVariables>\n ): QueryInfo {\n const { queryInfoTrie } = this;\n const { query, variables } = props;\n const varMap = queryInfoTrie.get(query) || new Map<string, QueryInfo>();\n if (!queryInfoTrie.has(query)) queryInfoTrie.set(query, varMap);\n const variablesString = JSON.stringify(variables);\n const info = varMap.get(variablesString) || makeDefaultQueryInfo();\n if (!varMap.has(variablesString)) varMap.set(variablesString, info);\n return info;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderToStringWithData.d.ts","sourceRoot":"","sources":["../../../src/react/ssr/renderToStringWithData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"renderToStringWithData.d.ts","sourceRoot":"","sources":["../../../src/react/ssr/renderToStringWithData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC,CAKjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderToStringWithData.js","sourceRoot":"","sources":["../../../src/react/ssr/renderToStringWithData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,sBAAsB,CACpC,SAA4B;IAE5B,OAAO,iBAAiB,CAAC;QACvB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,cAAc;KAC/B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { ReactElement } from 'react';\nimport { getMarkupFromTree } from './getDataFromTree';\nimport { renderToString } from 'react-dom/server';\n\nexport function renderToStringWithData(\n component: ReactElement<any>\n): Promise<string> {\n return getMarkupFromTree({\n tree: component,\n renderFunction: renderToString\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"renderToStringWithData.js","sourceRoot":"","sources":["../../../src/react/ssr/renderToStringWithData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,sBAAsB,CACpC,SAA4B;IAE5B,OAAO,iBAAiB,CAAC;QACvB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,cAAc;KAC/B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ReactElement } from 'react';\nimport { getMarkupFromTree } from './getDataFromTree';\nimport { renderToString } from 'react-dom/server';\n\nexport function renderToStringWithData(\n component: ReactElement<any>\n): Promise<string> {\n return getMarkupFromTree({\n tree: component,\n renderFunction: renderToString\n });\n}\n"]}
|
package/react/types/types.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { DocumentNode } from 'graphql';
|
|
3
|
-
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
4
|
-
import { Observable, ObservableSubscription } from '../../utilities';
|
|
5
|
-
import { FetchResult } from '../../link/core';
|
|
6
|
-
import { ApolloError } from '../../errors';
|
|
7
|
-
import { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, MutationOptions, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy } from '../../core';
|
|
8
|
-
import {
|
|
9
|
-
import { SuspenseCache } from '../cache';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DocumentNode } from 'graphql';
|
|
3
|
+
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
4
|
+
import type { Observable, ObservableSubscription } from '../../utilities';
|
|
5
|
+
import type { FetchResult } from '../../link/core';
|
|
6
|
+
import type { ApolloError } from '../../errors';
|
|
7
|
+
import type { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, MutationOptions, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy } from '../../core';
|
|
8
|
+
import type { SuspenseCache } from '../cache';
|
|
10
9
|
export type { DefaultContext as Context } from "../../core";
|
|
11
10
|
export type CommonOptions<TOptions> = TOptions & {
|
|
12
11
|
client?: ApolloClient<object>;
|
|
@@ -44,13 +43,11 @@ export interface LazyQueryHookOptions<TData = any, TVariables extends OperationV
|
|
|
44
43
|
export interface LazyQueryHookExecOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends LazyQueryHookOptions<TData, TVariables> {
|
|
45
44
|
query?: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
46
45
|
}
|
|
47
|
-
export type SuspensePolicy = 'always' | 'initial';
|
|
48
46
|
export type SuspenseQueryHookFetchPolicy = Extract<WatchQueryFetchPolicy, 'cache-first' | 'network-only' | 'no-cache' | 'cache-and-network'>;
|
|
49
|
-
export interface SuspenseQueryHookOptions<TData =
|
|
47
|
+
export interface SuspenseQueryHookOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> extends Pick<QueryHookOptions<TData, TVariables>, 'client' | 'variables' | 'errorPolicy' | 'context' | 'canonizeResults' | 'returnPartialData' | 'refetchWritePolicy'> {
|
|
50
48
|
fetchPolicy?: SuspenseQueryHookFetchPolicy;
|
|
51
|
-
nextFetchPolicy?: SuspenseQueryHookFetchPolicy | ((currentFetchPolicy: SuspenseQueryHookFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => SuspenseQueryHookFetchPolicy);
|
|
52
|
-
suspensePolicy?: SuspensePolicy;
|
|
53
49
|
suspenseCache?: SuspenseCache;
|
|
50
|
+
queryKey?: string | number | any[];
|
|
54
51
|
}
|
|
55
52
|
export interface QueryLazyOptions<TVariables> {
|
|
56
53
|
variables?: TVariables;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,WAAW,EACX,eAAe,EACf,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI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