@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
|
@@ -18,7 +18,7 @@ function shouldInclude(_a, variables) {
|
|
|
18
18
|
var evaledValue = false;
|
|
19
19
|
if (ifArgument.value.kind === 'Variable') {
|
|
20
20
|
evaledValue = variables && variables[ifArgument.value.name.value];
|
|
21
|
-
globals.
|
|
21
|
+
globals.invariant(evaledValue !== void 0, 66, directive.name.value);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
evaledValue = ifArgument.value.value;
|
|
@@ -65,13 +65,12 @@ function getInclusionDirectives(directives) {
|
|
|
65
65
|
return;
|
|
66
66
|
var directiveArguments = directive.arguments;
|
|
67
67
|
var directiveName = directive.name.value;
|
|
68
|
-
globals.
|
|
68
|
+
globals.invariant(directiveArguments && directiveArguments.length === 1, 67, directiveName);
|
|
69
69
|
var ifArgument = directiveArguments[0];
|
|
70
|
-
globals.
|
|
70
|
+
globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 68, directiveName);
|
|
71
71
|
var ifValue = ifArgument.value;
|
|
72
|
-
globals.
|
|
73
|
-
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),
|
|
74
|
-
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 44);
|
|
72
|
+
globals.invariant(ifValue &&
|
|
73
|
+
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 69, directiveName);
|
|
75
74
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
76
75
|
});
|
|
77
76
|
}
|
|
@@ -83,15 +82,18 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
83
82
|
var fragments = [];
|
|
84
83
|
document.definitions.forEach(function (definition) {
|
|
85
84
|
if (definition.kind === 'OperationDefinition') {
|
|
86
|
-
throw globals.
|
|
87
|
-
|
|
85
|
+
throw globals.newInvariantError(
|
|
86
|
+
70,
|
|
87
|
+
definition.operation,
|
|
88
|
+
definition.name ? " named '".concat(definition.name.value, "'") : ''
|
|
89
|
+
);
|
|
88
90
|
}
|
|
89
91
|
if (definition.kind === 'FragmentDefinition') {
|
|
90
92
|
fragments.push(definition);
|
|
91
93
|
}
|
|
92
94
|
});
|
|
93
95
|
if (typeof actualFragmentName === 'undefined') {
|
|
94
|
-
globals.
|
|
96
|
+
globals.invariant(fragments.length === 1, 71, fragments.length);
|
|
95
97
|
actualFragmentName = fragments[0].name.value;
|
|
96
98
|
}
|
|
97
99
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
@@ -132,7 +134,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
132
134
|
return fragmentMap(fragmentName);
|
|
133
135
|
}
|
|
134
136
|
var fragment = fragmentMap && fragmentMap[fragmentName];
|
|
135
|
-
globals.
|
|
137
|
+
globals.invariant(fragment, 72, fragmentName);
|
|
136
138
|
return fragment || null;
|
|
137
139
|
}
|
|
138
140
|
default:
|
|
@@ -143,6 +145,12 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
143
145
|
function isNonNullObject(obj) {
|
|
144
146
|
return obj !== null && typeof obj === 'object';
|
|
145
147
|
}
|
|
148
|
+
function isPlainObject(obj) {
|
|
149
|
+
return (obj !== null &&
|
|
150
|
+
typeof obj === 'object' &&
|
|
151
|
+
(Object.getPrototypeOf(obj) === Object.prototype ||
|
|
152
|
+
Object.getPrototypeOf(obj) === null));
|
|
153
|
+
}
|
|
146
154
|
|
|
147
155
|
function makeReference(id) {
|
|
148
156
|
return { __ref: String(id) };
|
|
@@ -214,9 +222,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
214
222
|
argObj[name.value] = null;
|
|
215
223
|
}
|
|
216
224
|
else {
|
|
217
|
-
throw globals.
|
|
218
|
-
'is not supported. Use variables instead of inline arguments to ' +
|
|
219
|
-
'overcome this limitation.') : new globals.InvariantError(56);
|
|
225
|
+
throw globals.newInvariantError(81, name.value, value.kind);
|
|
220
226
|
}
|
|
221
227
|
}
|
|
222
228
|
function storeKeyNameFromField(field, variables) {
|
|
@@ -250,6 +256,7 @@ var KNOWN_DIRECTIVES = [
|
|
|
250
256
|
'client',
|
|
251
257
|
'rest',
|
|
252
258
|
'export',
|
|
259
|
+
'nonreactive',
|
|
253
260
|
];
|
|
254
261
|
var getStoreKeyName = Object.assign(function (fieldName, args, directives) {
|
|
255
262
|
if (args &&
|
|
@@ -324,9 +331,7 @@ function resultKeyNameFromField(field) {
|
|
|
324
331
|
return field.alias ? field.alias.value : field.name.value;
|
|
325
332
|
}
|
|
326
333
|
function getTypenameFromResult(result, selectionSet, fragmentMap) {
|
|
327
|
-
|
|
328
|
-
return result.__typename;
|
|
329
|
-
}
|
|
334
|
+
var fragments;
|
|
330
335
|
for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {
|
|
331
336
|
var selection = _a[_i];
|
|
332
337
|
if (isField(selection)) {
|
|
@@ -334,7 +339,19 @@ function getTypenameFromResult(result, selectionSet, fragmentMap) {
|
|
|
334
339
|
return result[resultKeyNameFromField(selection)];
|
|
335
340
|
}
|
|
336
341
|
}
|
|
342
|
+
else if (fragments) {
|
|
343
|
+
fragments.push(selection);
|
|
344
|
+
}
|
|
337
345
|
else {
|
|
346
|
+
fragments = [selection];
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (typeof result.__typename === 'string') {
|
|
350
|
+
return result.__typename;
|
|
351
|
+
}
|
|
352
|
+
if (fragments) {
|
|
353
|
+
for (var _b = 0, fragments_1 = fragments; _b < fragments_1.length; _b++) {
|
|
354
|
+
var selection = fragments_1[_b];
|
|
338
355
|
var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);
|
|
339
356
|
if (typeof typename === 'string') {
|
|
340
357
|
return typename;
|
|
@@ -350,16 +367,16 @@ function isInlineFragment(selection) {
|
|
|
350
367
|
}
|
|
351
368
|
|
|
352
369
|
function checkDocument(doc) {
|
|
353
|
-
globals.
|
|
370
|
+
globals.invariant(doc && doc.kind === 'Document', 73);
|
|
354
371
|
var operations = doc.definitions
|
|
355
372
|
.filter(function (d) { return d.kind !== 'FragmentDefinition'; })
|
|
356
373
|
.map(function (definition) {
|
|
357
374
|
if (definition.kind !== 'OperationDefinition') {
|
|
358
|
-
throw globals.
|
|
375
|
+
throw globals.newInvariantError(74, definition.kind);
|
|
359
376
|
}
|
|
360
377
|
return definition;
|
|
361
378
|
});
|
|
362
|
-
globals.
|
|
379
|
+
globals.invariant(operations.length <= 1, 75, operations.length);
|
|
363
380
|
return doc;
|
|
364
381
|
}
|
|
365
382
|
function getOperationDefinition(doc) {
|
|
@@ -382,14 +399,14 @@ function getFragmentDefinitions(doc) {
|
|
|
382
399
|
}
|
|
383
400
|
function getQueryDefinition(doc) {
|
|
384
401
|
var queryDef = getOperationDefinition(doc);
|
|
385
|
-
globals.
|
|
402
|
+
globals.invariant(queryDef && queryDef.operation === 'query', 76);
|
|
386
403
|
return queryDef;
|
|
387
404
|
}
|
|
388
405
|
function getFragmentDefinition(doc) {
|
|
389
|
-
globals.
|
|
390
|
-
globals.
|
|
406
|
+
globals.invariant(doc.kind === 'Document', 77);
|
|
407
|
+
globals.invariant(doc.definitions.length <= 1, 78);
|
|
391
408
|
var fragmentDef = doc.definitions[0];
|
|
392
|
-
globals.
|
|
409
|
+
globals.invariant(fragmentDef.kind === 'FragmentDefinition', 79);
|
|
393
410
|
return fragmentDef;
|
|
394
411
|
}
|
|
395
412
|
function getMainDefinition(queryDoc) {
|
|
@@ -412,7 +429,7 @@ function getMainDefinition(queryDoc) {
|
|
|
412
429
|
if (fragmentDefinition) {
|
|
413
430
|
return fragmentDefinition;
|
|
414
431
|
}
|
|
415
|
-
throw globals.
|
|
432
|
+
throw globals.newInvariantError(80);
|
|
416
433
|
}
|
|
417
434
|
function getDefaultValues(definition) {
|
|
418
435
|
var defaultValues = Object.create(null);
|
|
@@ -448,19 +465,30 @@ function nullIfDocIsEmpty(doc) {
|
|
|
448
465
|
? null
|
|
449
466
|
: doc;
|
|
450
467
|
}
|
|
451
|
-
function getDirectiveMatcher(
|
|
452
|
-
var
|
|
453
|
-
var tests =
|
|
454
|
-
|
|
455
|
-
if (directive
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
468
|
+
function getDirectiveMatcher(configs) {
|
|
469
|
+
var names = new Map();
|
|
470
|
+
var tests = new Map();
|
|
471
|
+
configs.forEach(function (directive) {
|
|
472
|
+
if (directive) {
|
|
473
|
+
if (directive.name) {
|
|
474
|
+
names.set(directive.name, directive);
|
|
475
|
+
}
|
|
476
|
+
else if (directive.test) {
|
|
477
|
+
tests.set(directive.test, directive);
|
|
478
|
+
}
|
|
460
479
|
}
|
|
461
480
|
});
|
|
462
|
-
return function (directive) {
|
|
463
|
-
|
|
481
|
+
return function (directive) {
|
|
482
|
+
var config = names.get(directive.name.value);
|
|
483
|
+
if (!config && tests.size) {
|
|
484
|
+
tests.forEach(function (testConfig, test) {
|
|
485
|
+
if (test(directive)) {
|
|
486
|
+
config = testConfig;
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
return config;
|
|
491
|
+
};
|
|
464
492
|
}
|
|
465
493
|
function makeInUseGetterFunction(defaultKey) {
|
|
466
494
|
var map = new Map();
|
|
@@ -477,6 +505,7 @@ function makeInUseGetterFunction(defaultKey) {
|
|
|
477
505
|
};
|
|
478
506
|
}
|
|
479
507
|
function removeDirectivesFromDocument(directives, doc) {
|
|
508
|
+
checkDocument(doc);
|
|
480
509
|
var getInUseByOperationName = makeInUseGetterFunction("");
|
|
481
510
|
var getInUseByFragmentName = makeInUseGetterFunction("");
|
|
482
511
|
var getInUse = function (ancestors) {
|
|
@@ -490,7 +519,7 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
490
519
|
return getInUseByFragmentName(ancestor.name.value);
|
|
491
520
|
}
|
|
492
521
|
}
|
|
493
|
-
globals.__DEV__ && globals.invariant.error(
|
|
522
|
+
globals.__DEV__ && globals.invariant.error(82);
|
|
494
523
|
return null;
|
|
495
524
|
};
|
|
496
525
|
var operationCount = 0;
|
|
@@ -500,10 +529,8 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
500
529
|
}
|
|
501
530
|
}
|
|
502
531
|
var directiveMatcher = getDirectiveMatcher(directives);
|
|
503
|
-
var
|
|
504
|
-
|
|
505
|
-
nodeDirectives &&
|
|
506
|
-
nodeDirectives.some(directiveMatcher)); };
|
|
532
|
+
var shouldRemoveField = function (nodeDirectives) { return (isNonEmptyArray(nodeDirectives) &&
|
|
533
|
+
nodeDirectives.map(directiveMatcher).some(function (config) { return config && config.remove; })); };
|
|
507
534
|
var originalFragmentDefsByPath = new Map();
|
|
508
535
|
var firstVisitMadeChanges = false;
|
|
509
536
|
var fieldOrInlineFragmentVisitor = {
|
|
@@ -668,8 +695,7 @@ var connectionRemoveConfig = {
|
|
|
668
695
|
if (willRemove) {
|
|
669
696
|
if (!directive.arguments ||
|
|
670
697
|
!directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
|
|
671
|
-
globals.__DEV__ && globals.invariant.warn(
|
|
672
|
-
'You may want to use the key parameter to specify a store key.');
|
|
698
|
+
globals.__DEV__ && globals.invariant.warn(83);
|
|
673
699
|
}
|
|
674
700
|
}
|
|
675
701
|
return willRemove;
|
|
@@ -763,6 +789,20 @@ function removeClientSetsFromDocument(document) {
|
|
|
763
789
|
return modifiedDoc;
|
|
764
790
|
}
|
|
765
791
|
|
|
792
|
+
function isOperation(document, operation) {
|
|
793
|
+
var _a;
|
|
794
|
+
return ((_a = getOperationDefinition(document)) === null || _a === void 0 ? void 0 : _a.operation) === operation;
|
|
795
|
+
}
|
|
796
|
+
function isMutationOperation(document) {
|
|
797
|
+
return isOperation(document, graphql.OperationTypeNode.MUTATION);
|
|
798
|
+
}
|
|
799
|
+
function isQueryOperation(document) {
|
|
800
|
+
return isOperation(document, graphql.OperationTypeNode.QUERY);
|
|
801
|
+
}
|
|
802
|
+
function isSubscriptionOperation(document) {
|
|
803
|
+
return isOperation(document, graphql.OperationTypeNode.SUBSCRIPTION);
|
|
804
|
+
}
|
|
805
|
+
|
|
766
806
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
767
807
|
function mergeDeep() {
|
|
768
808
|
var sources = [];
|
|
@@ -984,6 +1024,43 @@ function makeEmptyData() {
|
|
|
984
1024
|
};
|
|
985
1025
|
}
|
|
986
1026
|
|
|
1027
|
+
function createFulfilledPromise(value) {
|
|
1028
|
+
var promise = Promise.resolve(value);
|
|
1029
|
+
promise.status = 'fulfilled';
|
|
1030
|
+
promise.value = value;
|
|
1031
|
+
return promise;
|
|
1032
|
+
}
|
|
1033
|
+
function createRejectedPromise(reason) {
|
|
1034
|
+
var promise = Promise.reject(reason);
|
|
1035
|
+
promise.status = 'rejected';
|
|
1036
|
+
promise.reason = reason;
|
|
1037
|
+
return promise;
|
|
1038
|
+
}
|
|
1039
|
+
function isStatefulPromise(promise) {
|
|
1040
|
+
return 'status' in promise;
|
|
1041
|
+
}
|
|
1042
|
+
function wrapPromiseWithState(promise) {
|
|
1043
|
+
if (isStatefulPromise(promise)) {
|
|
1044
|
+
return promise;
|
|
1045
|
+
}
|
|
1046
|
+
var pendingPromise = promise;
|
|
1047
|
+
pendingPromise.status = 'pending';
|
|
1048
|
+
pendingPromise.then(function (value) {
|
|
1049
|
+
if (pendingPromise.status === 'pending') {
|
|
1050
|
+
var fulfilledPromise = pendingPromise;
|
|
1051
|
+
fulfilledPromise.status = 'fulfilled';
|
|
1052
|
+
fulfilledPromise.value = value;
|
|
1053
|
+
}
|
|
1054
|
+
}, function (reason) {
|
|
1055
|
+
if (pendingPromise.status === 'pending') {
|
|
1056
|
+
var rejectedPromise = pendingPromise;
|
|
1057
|
+
rejectedPromise.status = 'rejected';
|
|
1058
|
+
rejectedPromise.reason = reason;
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
return promise;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
987
1064
|
var toString = Object.prototype.toString;
|
|
988
1065
|
function cloneDeep(value) {
|
|
989
1066
|
return cloneDeepHelper(value);
|
|
@@ -1266,6 +1343,9 @@ function isExecutionPatchResult(value) {
|
|
|
1266
1343
|
return (isExecutionPatchIncrementalResult(value) ||
|
|
1267
1344
|
isExecutionPatchInitialResult(value));
|
|
1268
1345
|
}
|
|
1346
|
+
function isApolloPayloadResult(value) {
|
|
1347
|
+
return isNonNullObject(value) && "payload" in value;
|
|
1348
|
+
}
|
|
1269
1349
|
function mergeIncrementalData(prevResult, result) {
|
|
1270
1350
|
var mergedData = prevResult;
|
|
1271
1351
|
var merger = new DeepMerger();
|
|
@@ -1331,16 +1411,17 @@ function makeUniqueId(prefix) {
|
|
|
1331
1411
|
return "".concat(prefix, ":").concat(count, ":").concat(Math.random().toString(36).slice(2));
|
|
1332
1412
|
}
|
|
1333
1413
|
|
|
1334
|
-
function stringifyForDisplay(value) {
|
|
1414
|
+
function stringifyForDisplay(value, space) {
|
|
1415
|
+
if (space === void 0) { space = 0; }
|
|
1335
1416
|
var undefId = makeUniqueId("stringifyForDisplay");
|
|
1336
1417
|
return JSON.stringify(value, function (key, value) {
|
|
1337
1418
|
return value === void 0 ? undefId : value;
|
|
1338
|
-
}).split(JSON.stringify(undefId)).join("<undefined>");
|
|
1419
|
+
}, space).split(JSON.stringify(undefId)).join("<undefined>");
|
|
1339
1420
|
}
|
|
1340
1421
|
|
|
1341
1422
|
function mergeOptions(defaults, options) {
|
|
1342
1423
|
return compact(defaults, options, options.variables && {
|
|
1343
|
-
variables: tslib.__assign(tslib.__assign({}, (defaults && defaults.variables)), options.variables),
|
|
1424
|
+
variables: compact(tslib.__assign(tslib.__assign({}, (defaults && defaults.variables)), options.variables)),
|
|
1344
1425
|
});
|
|
1345
1426
|
}
|
|
1346
1427
|
|
|
@@ -1364,6 +1445,50 @@ function isNodeReadableStream(value) {
|
|
|
1364
1445
|
return !!value.pipe;
|
|
1365
1446
|
}
|
|
1366
1447
|
|
|
1448
|
+
function omitDeep(value, key) {
|
|
1449
|
+
return __omitDeep(value, key);
|
|
1450
|
+
}
|
|
1451
|
+
function __omitDeep(value, key, known) {
|
|
1452
|
+
if (known === void 0) { known = new Map(); }
|
|
1453
|
+
if (known.has(value)) {
|
|
1454
|
+
return known.get(value);
|
|
1455
|
+
}
|
|
1456
|
+
var modified = false;
|
|
1457
|
+
if (Array.isArray(value)) {
|
|
1458
|
+
var array_1 = [];
|
|
1459
|
+
known.set(value, array_1);
|
|
1460
|
+
value.forEach(function (value, index) {
|
|
1461
|
+
var result = __omitDeep(value, key, known);
|
|
1462
|
+
modified || (modified = result !== value);
|
|
1463
|
+
array_1[index] = result;
|
|
1464
|
+
});
|
|
1465
|
+
if (modified) {
|
|
1466
|
+
return array_1;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
else if (isPlainObject(value)) {
|
|
1470
|
+
var obj_1 = Object.create(Object.getPrototypeOf(value));
|
|
1471
|
+
known.set(value, obj_1);
|
|
1472
|
+
Object.keys(value).forEach(function (k) {
|
|
1473
|
+
if (k === key) {
|
|
1474
|
+
modified = true;
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
var result = __omitDeep(value[k], key, known);
|
|
1478
|
+
modified || (modified = result !== value[k]);
|
|
1479
|
+
obj_1[k] = result;
|
|
1480
|
+
});
|
|
1481
|
+
if (modified) {
|
|
1482
|
+
return obj_1;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
return value;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
function stripTypename(value) {
|
|
1489
|
+
return omitDeep(value, '__typename');
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1367
1492
|
exports.DEV = globals.DEV;
|
|
1368
1493
|
exports.maybe = globals.maybe;
|
|
1369
1494
|
exports.Observable = zenObservableTs.Observable;
|
|
@@ -1384,6 +1509,8 @@ exports.cloneDeep = cloneDeep;
|
|
|
1384
1509
|
exports.compact = compact;
|
|
1385
1510
|
exports.concatPagination = concatPagination;
|
|
1386
1511
|
exports.createFragmentMap = createFragmentMap;
|
|
1512
|
+
exports.createFulfilledPromise = createFulfilledPromise;
|
|
1513
|
+
exports.createRejectedPromise = createRejectedPromise;
|
|
1387
1514
|
exports.fixObservableSubclass = fixObservableSubclass;
|
|
1388
1515
|
exports.getDefaultValues = getDefaultValues;
|
|
1389
1516
|
exports.getDirectiveNames = getDirectiveNames;
|
|
@@ -1404,6 +1531,7 @@ exports.hasAllDirectives = hasAllDirectives;
|
|
|
1404
1531
|
exports.hasAnyDirectives = hasAnyDirectives;
|
|
1405
1532
|
exports.hasClientExports = hasClientExports;
|
|
1406
1533
|
exports.hasDirectives = hasDirectives;
|
|
1534
|
+
exports.isApolloPayloadResult = isApolloPayloadResult;
|
|
1407
1535
|
exports.isArray = isArray;
|
|
1408
1536
|
exports.isAsyncIterableIterator = isAsyncIterableIterator;
|
|
1409
1537
|
exports.isBlob = isBlob;
|
|
@@ -1413,13 +1541,18 @@ exports.isExecutionPatchInitialResult = isExecutionPatchInitialResult;
|
|
|
1413
1541
|
exports.isExecutionPatchResult = isExecutionPatchResult;
|
|
1414
1542
|
exports.isField = isField;
|
|
1415
1543
|
exports.isInlineFragment = isInlineFragment;
|
|
1544
|
+
exports.isMutationOperation = isMutationOperation;
|
|
1416
1545
|
exports.isNodeReadableStream = isNodeReadableStream;
|
|
1417
1546
|
exports.isNodeResponse = isNodeResponse;
|
|
1418
1547
|
exports.isNonEmptyArray = isNonEmptyArray;
|
|
1419
1548
|
exports.isNonNullObject = isNonNullObject;
|
|
1549
|
+
exports.isPlainObject = isPlainObject;
|
|
1550
|
+
exports.isQueryOperation = isQueryOperation;
|
|
1420
1551
|
exports.isReadableStream = isReadableStream;
|
|
1421
1552
|
exports.isReference = isReference;
|
|
1553
|
+
exports.isStatefulPromise = isStatefulPromise;
|
|
1422
1554
|
exports.isStreamableBlob = isStreamableBlob;
|
|
1555
|
+
exports.isSubscriptionOperation = isSubscriptionOperation;
|
|
1423
1556
|
exports.iterateObserversSafely = iterateObserversSafely;
|
|
1424
1557
|
exports.makeReference = makeReference;
|
|
1425
1558
|
exports.makeUniqueId = makeUniqueId;
|
|
@@ -1429,6 +1562,7 @@ exports.mergeDeepArray = mergeDeepArray;
|
|
|
1429
1562
|
exports.mergeIncrementalData = mergeIncrementalData;
|
|
1430
1563
|
exports.mergeOptions = mergeOptions;
|
|
1431
1564
|
exports.offsetLimitPagination = offsetLimitPagination;
|
|
1565
|
+
exports.omitDeep = omitDeep;
|
|
1432
1566
|
exports.relayStylePagination = relayStylePagination;
|
|
1433
1567
|
exports.removeArgumentsFromDocument = removeArgumentsFromDocument;
|
|
1434
1568
|
exports.removeClientSetsFromDocument = removeClientSetsFromDocument;
|
|
@@ -1439,5 +1573,7 @@ exports.resultKeyNameFromField = resultKeyNameFromField;
|
|
|
1439
1573
|
exports.shouldInclude = shouldInclude;
|
|
1440
1574
|
exports.storeKeyNameFromField = storeKeyNameFromField;
|
|
1441
1575
|
exports.stringifyForDisplay = stringifyForDisplay;
|
|
1576
|
+
exports.stripTypename = stripTypename;
|
|
1442
1577
|
exports.valueToObjectRepresentation = valueToObjectRepresentation;
|
|
1578
|
+
exports.wrapPromiseWithState = wrapPromiseWithState;
|
|
1443
1579
|
//# sourceMappingURL=utilities.cjs.map
|
package/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = '3.8.0-
|
|
1
|
+
export var version = '3.8.0-beta.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"optimism.d.ts","sourceRoot":"","sources":["../../../../src/cache/inmemory/__mocks__/optimism.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ,KAAiC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var optimism = jest.requireActual('optimism');
|
|
13
|
-
module.exports = __assign(__assign({}, optimism), { wrap: jest.fn(optimism.wrap) });
|
|
14
|
-
//# sourceMappingURL=optimism.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"optimism.js","sourceRoot":"","sources":["../../../../src/cache/inmemory/__mocks__/optimism.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,IAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;AAChD,MAAM,CAAC,OAAO,yBACT,QAAQ,KACX,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAC7B,CAAC","sourcesContent":["const optimism = jest.requireActual('optimism');\nmodule.exports = {\n ...optimism,\n wrap: jest.fn(optimism.wrap),\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compareResults.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/compareResults.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,EAOb,MAAM,SAAS,CAAC;AAejB,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAC1C,OAAO,CAWT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compareResults.js","sourceRoot":"","sources":["../../../src/react/hooks/compareResults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,eAAe,CAAC;AAalC,OAAO,EACL,iBAAiB,EAEjB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,OAAO,EACP,sBAAsB,EACtB,aAAa,GACd,MAAM,iBAAiB,CAAC;AAIzB,MAAM,UAAU,wBAAwB,CACtC,KAAmB,EACnB,OAAY,EACZ,OAAY,EACZ,SAA2C;IAE3C,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,+BAA+B,CACpC,iBAAiB,CAAC,KAAK,CAAC,CAAC,YAAY,EACrC,OAAO,EACP,OAAO,EACP;QACE,WAAW,EAAE,iBAAiB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;QAC7D,SAAS,WAAA;KACV,CACF,CAAC;AACJ,CAAC;AASD,SAAS,+BAA+B,CACtC,YAA8B,EAC9B,OAAY,EACZ,OAAY,EACZ,OAAuB;IAEvB,IAAM,cAAc,GAAG,IAAI,GAAG,EAAiB,CAAC;IAKhD,OAAO,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,UAAA,SAAS;QAG5C,IAAI,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC/C,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAG9B,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAI9D,IAAI,gCAAgC,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAE7D,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE;YACtB,IAAM,SAAS,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;YACpD,IAAM,YAAY,GAAG,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;YACnD,IAAM,YAAY,GAAG,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;YACnD,IAAM,iBAAiB,GAAG,SAAS,CAAC,YAAY,CAAC;YAEjD,IAAI,CAAC,iBAAiB,EAAE;gBAGtB,OAAO,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;aAC1C;YAED,IAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAClD,IAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAClD,IAAI,aAAa,KAAK,aAAa;gBAAE,OAAO,KAAK,CAAC;YAClD,IAAI,aAAa,IAAI,aAAa,EAAE;gBAClC,IAAM,QAAM,GAAG,YAAY,CAAC,MAAM,CAAC;gBACnC,IAAI,YAAY,CAAC,MAAM,KAAK,QAAM,EAAE;oBAClC,OAAO,KAAK,CAAC;iBACd;gBACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAM,EAAE,EAAE,CAAC,EAAE;oBAC/B,IAAI,CAAC,+BAA+B,CAClC,iBAAiB,EACjB,YAAY,CAAC,CAAC,CAAC,EACf,YAAY,CAAC,CAAC,CAAC,EACf,OAAO,CACR,EAAE;wBACD,OAAO,KAAK,CAAC;qBACd;iBACF;gBACD,OAAO,IAAI,CAAC;aACb;YAED,OAAO,+BAA+B,CACpC,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,OAAO,CACR,CAAC;SAEH;aAAM;YACL,IAAM,QAAQ,GAAG,wBAAwB,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;YAC1E,IAAI,QAAQ,EAAE;gBAGZ,IAAI,gCAAgC,CAAC,QAAQ,CAAC;oBAAE,OAAO,IAAI,CAAC;gBAE5D,OAAO,+BAA+B,CACpC,QAAQ,CAAC,YAAY,EAKrB,OAAO,EACP,OAAO,EACP,OAAO,CACR,CAAC;aACH;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gCAAgC,CAAC,SAIhB;IAExB,OAAO,CAAC,CAAC,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AACrF,CAAC;AAED,SAAS,sBAAsB,CAAC,GAAkB;IAChD,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,aAAa,CAAC;AAC1C,CAAC","sourcesContent":["import equal from \"@wry/equality\";\n\nimport {\n DirectiveNode,\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionNode,\n SelectionSetNode,\n} from \"graphql\";\n\nimport {\n createFragmentMap,\n FragmentMap,\n getFragmentDefinitions,\n getFragmentFromSelection,\n getMainDefinition,\n isField,\n resultKeyNameFromField,\n shouldInclude,\n} from \"../../utilities\";\n\n// Returns true if aResult and bResult are deeply equal according to the fields\n// selected by the given query, ignoring any fields marked as @nonreactive.\nexport function compareResultsUsingQuery(\n query: DocumentNode,\n aResult: any,\n bResult: any,\n variables?: Record<string, any> | undefined,\n): boolean {\n if (aResult === bResult) return true;\n return compareResultsUsingSelectionSet(\n getMainDefinition(query).selectionSet,\n aResult,\n bResult,\n {\n fragmentMap: createFragmentMap(getFragmentDefinitions(query)),\n variables,\n },\n );\n}\n\n// Encapsulates the information used by compareResultsUsingSelectionSet that\n// does not change during the recursion.\ninterface CompareContext {\n fragmentMap: FragmentMap;\n variables: Record<string, any> | undefined;\n}\n\nfunction compareResultsUsingSelectionSet(\n selectionSet: SelectionSetNode,\n aResult: any,\n bResult: any,\n context: CompareContext,\n): boolean {\n const seenSelections = new Set<SelectionNode>();\n\n // Returning true from this Array.prototype.every callback function skips the\n // current field/subtree. Returning false aborts the entire traversal\n // immediately, causing compareResultsUsingSelectionSet to return false.\n return selectionSet.selections.every(selection => {\n // Avoid re-processing the same selection at the same level of recursion, in\n // case the same field gets included via multiple indirect fragment spreads.\n if (seenSelections.has(selection)) return true;\n seenSelections.add(selection);\n\n // Ignore @skip(if: true) and @include(if: false) fields.\n if (!shouldInclude(selection, context.variables)) return true;\n\n // If the field or (named) fragment spread has a @nonreactive directive on\n // it, we don't care if it's different, so we pretend it's the same.\n if (selectionHasNonreactiveDirective(selection)) return true;\n\n if (isField(selection)) {\n const resultKey = resultKeyNameFromField(selection);\n const aResultChild = aResult && aResult[resultKey];\n const bResultChild = bResult && bResult[resultKey];\n const childSelectionSet = selection.selectionSet;\n\n if (!childSelectionSet) {\n // These are scalar values, so we can compare them with deep equal\n // without redoing the main recursive work.\n return equal(aResultChild, bResultChild);\n }\n\n const aChildIsArray = Array.isArray(aResultChild);\n const bChildIsArray = Array.isArray(bResultChild);\n if (aChildIsArray !== bChildIsArray) return false;\n if (aChildIsArray && bChildIsArray) {\n const length = aResultChild.length;\n if (bResultChild.length !== length) {\n return false;\n }\n for (let i = 0; i < length; ++i) {\n if (!compareResultsUsingSelectionSet(\n childSelectionSet,\n aResultChild[i],\n bResultChild[i],\n context,\n )) {\n return false;\n }\n }\n return true;\n }\n\n return compareResultsUsingSelectionSet(\n childSelectionSet,\n aResultChild,\n bResultChild,\n context,\n );\n\n } else {\n const fragment = getFragmentFromSelection(selection, context.fragmentMap);\n if (fragment) {\n // The fragment might === selection if it's an inline fragment, but\n // could be !== if it's a named fragment ...spread.\n if (selectionHasNonreactiveDirective(fragment)) return true;\n\n return compareResultsUsingSelectionSet(\n fragment.selectionSet,\n // Notice that we reuse the same aResult and bResult values here,\n // since the fragment ...spread does not specify a field name, but\n // consists of multiple fields (within the fragment's selection set)\n // that should be applied to the current result value(s).\n aResult,\n bResult,\n context,\n );\n }\n }\n });\n}\n\nfunction selectionHasNonreactiveDirective(selection:\n | FieldNode\n | InlineFragmentNode\n | FragmentSpreadNode\n | FragmentDefinitionNode,\n): boolean {\n return !!selection.directives && selection.directives.some(directiveIsNonreactive);\n}\n\nfunction directiveIsNonreactive(dir: DirectiveNode): boolean {\n return dir.name.value === \"nonreactive\";\n}\n"]}
|