@apollo/client 4.3.0-alpha.0 → 4.3.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +490 -0
- package/README.md +3 -7
- package/__cjs/cache/core/Scalar.cjs +36 -0
- package/__cjs/cache/core/Scalar.cjs.map +1 -0
- package/__cjs/cache/core/Scalar.d.cts +20 -0
- package/__cjs/cache/core/cache.cjs +32 -1
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +89 -6
- package/__cjs/cache/core/types/Cache.d.cts +25 -0
- package/__cjs/cache/index.cjs +3 -1
- package/__cjs/cache/index.cjs.map +1 -1
- package/__cjs/cache/index.d.cts +3 -2
- package/__cjs/cache/inmemory/entityStore.cjs +48 -5
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.d.cts +3 -0
- package/__cjs/cache/inmemory/helpers.d.cts +9 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +83 -4
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +44 -5
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +35 -6
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.d.cts +4 -1
- package/__cjs/cache/inmemory/readFromStore.cjs +490 -49
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.d.cts +11 -2
- package/__cjs/cache/inmemory/types.d.cts +29 -4
- package/__cjs/cache/inmemory/writeToStore.cjs +6 -6
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs +37 -38
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +44 -10
- package/__cjs/core/ObservableQuery.cjs +228 -76
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +16 -8
- package/__cjs/core/QueryInfo.cjs +178 -190
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +17 -22
- package/__cjs/core/QueryManager.cjs +88 -59
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +1 -3
- package/__cjs/core/RefetchEventManager.cjs +3 -3
- package/__cjs/core/dataStateErrorCache.cjs +12 -0
- package/__cjs/core/dataStateErrorCache.cjs.map +1 -0
- package/__cjs/core/dataStateErrorCache.d.cts +3 -0
- package/__cjs/core/index.cjs +2 -1
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +4 -3
- package/__cjs/core/types.d.cts +12 -6
- package/__cjs/incremental/GraphQLCodegenIncremental.cjs +3 -0
- package/__cjs/incremental/GraphQLCodegenIncremental.cjs.map +1 -0
- package/__cjs/incremental/GraphQLCodegenIncremental.d.cts +55 -0
- package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
- package/__cjs/incremental/handlers/defer20220824.d.cts +2 -4
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs +47 -16
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs.map +1 -1
- package/__cjs/incremental/handlers/graphql17Alpha9.d.cts +29 -6
- package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/__cjs/incremental/index.cjs.map +1 -1
- package/__cjs/incremental/index.d.cts +1 -0
- package/__cjs/incremental/internal/types.cjs +3 -0
- package/__cjs/incremental/internal/types.cjs.map +1 -0
- package/__cjs/incremental/internal/types.d.cts +17 -0
- package/__cjs/incremental/types.d.cts +55 -4
- package/__cjs/invariantErrorCodes.cjs +167 -112
- package/__cjs/link/core/ApolloLink.cjs +3 -3
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +2 -2
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/ws/index.cjs +1 -1
- package/__cjs/local-state/LocalState.cjs +11 -11
- package/__cjs/masking/internal/types.d.cts +1 -2
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/utils.cjs +3 -3
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +100 -47
- package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +39 -33
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +23 -15
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +10 -7
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +74 -32
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +83 -34
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/types.d.cts +14 -3
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +20 -5
- package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
- package/__cjs/react/types/deprecated.d.cts +5 -4
- package/__cjs/testing/core/mocking/mockLink.cjs +25 -5
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockLink.d.cts +1 -2
- package/__cjs/utilities/caching/sizes.cjs.map +1 -1
- package/__cjs/utilities/caching/sizes.d.cts +39 -1
- package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/index.d.cts +1 -0
- package/__cjs/utilities/internal/StreamArrayState.cjs +27 -0
- package/__cjs/utilities/internal/StreamArrayState.cjs.map +1 -0
- package/__cjs/utilities/internal/StreamArrayState.d.cts +12 -0
- package/__cjs/utilities/internal/addDeferFragmentLabels.cjs +33 -0
- package/__cjs/utilities/internal/addDeferFragmentLabels.cjs.map +1 -0
- package/__cjs/utilities/internal/addDeferFragmentLabels.d.cts +3 -0
- package/__cjs/utilities/internal/capitalize.cjs +12 -0
- package/__cjs/utilities/internal/capitalize.cjs.map +1 -0
- package/__cjs/utilities/internal/capitalize.d.cts +7 -0
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs +69 -0
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs.map +1 -0
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.d.cts +9 -0
- package/__cjs/utilities/internal/constants.cjs +20 -1
- package/__cjs/utilities/internal/constants.cjs.map +1 -1
- package/__cjs/utilities/internal/constants.d.cts +19 -0
- package/__cjs/utilities/internal/getDirectiveArgValue.cjs +19 -0
- package/__cjs/utilities/internal/getDirectiveArgValue.cjs.map +1 -0
- package/__cjs/utilities/internal/getDirectiveArgValue.d.cts +9 -0
- package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs +2 -2
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
- package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.cjs +6 -0
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.d.cts +4 -0
- package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
- package/__cjs/utilities/internal/getUnwrappedType.cjs +20 -0
- package/__cjs/utilities/internal/getUnwrappedType.cjs.map +1 -0
- package/__cjs/utilities/internal/getUnwrappedType.d.cts +8 -0
- package/__cjs/utilities/internal/index.cjs +25 -2
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +16 -1
- package/__cjs/utilities/internal/isDeferredFragment.cjs +38 -0
- package/__cjs/utilities/internal/isDeferredFragment.cjs.map +1 -0
- package/__cjs/utilities/internal/isDeferredFragment.d.cts +9 -0
- package/__cjs/utilities/internal/isStreamField.cjs +37 -0
- package/__cjs/utilities/internal/isStreamField.cjs.map +1 -0
- package/__cjs/utilities/internal/isStreamField.d.cts +9 -0
- package/__cjs/utilities/internal/isTypenameField.cjs +7 -0
- package/__cjs/utilities/internal/isTypenameField.cjs.map +1 -0
- package/__cjs/utilities/internal/isTypenameField.d.cts +3 -0
- package/__cjs/utilities/internal/makeStreamInfoTrie.cjs +17 -0
- package/__cjs/utilities/internal/makeStreamInfoTrie.cjs.map +1 -0
- package/__cjs/utilities/internal/makeStreamInfoTrie.d.cts +8 -0
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
- package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
- package/__cjs/utilities/internal/toDiffWithDataState.cjs +20 -0
- package/__cjs/utilities/internal/toDiffWithDataState.cjs.map +1 -0
- package/__cjs/utilities/internal/toDiffWithDataState.d.cts +8 -0
- package/__cjs/utilities/internal/types/DeferInfo.cjs +3 -0
- package/__cjs/utilities/internal/types/DeferInfo.cjs.map +1 -0
- package/__cjs/utilities/internal/types/DeferInfo.d.cts +10 -0
- package/__cjs/utilities/internal/types/Exact.cjs +3 -0
- package/__cjs/utilities/internal/types/Exact.cjs.map +1 -0
- package/__cjs/utilities/internal/types/Exact.d.cts +2 -0
- package/__cjs/utilities/internal/types/IsLooselyEqual.cjs +3 -0
- package/__cjs/utilities/internal/types/IsLooselyEqual.cjs.map +1 -0
- package/__cjs/utilities/internal/types/IsLooselyEqual.d.cts +10 -0
- package/__cjs/utilities/internal/types/IsNeverish.cjs +3 -0
- package/__cjs/utilities/internal/types/IsNeverish.cjs.map +1 -0
- package/__cjs/utilities/internal/types/IsNeverish.d.cts +4 -0
- package/__cjs/utilities/internal/types/StreamInfoTrie.d.cts +2 -0
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
- package/__cjs/utilities/policies/pagination.cjs.map +1 -1
- package/__cjs/utilities/policies/pagination.d.cts +1 -1
- package/__cjs/utilities/subscriptions/relay/index.cjs +1 -0
- package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/cache/core/Scalar.d.ts +20 -0
- package/cache/core/Scalar.js +32 -0
- package/cache/core/Scalar.js.map +1 -0
- package/cache/core/cache.d.ts +89 -6
- package/cache/core/cache.js +33 -2
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +25 -0
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/index.d.ts +3 -2
- package/cache/index.js +1 -0
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +3 -0
- package/cache/inmemory/entityStore.js +49 -6
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +9 -1
- package/cache/inmemory/inMemoryCache.d.ts +44 -5
- package/cache/inmemory/inMemoryCache.js +84 -5
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.d.ts +4 -1
- package/cache/inmemory/policies.js +35 -6
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +11 -2
- package/cache/inmemory/readFromStore.js +486 -49
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +30 -5
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.js +7 -7
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +44 -10
- package/core/ApolloClient.js +37 -38
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +16 -8
- package/core/ObservableQuery.js +225 -77
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +18 -23
- package/core/QueryInfo.js +174 -190
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +1 -3
- package/core/QueryManager.js +89 -60
- package/core/QueryManager.js.map +1 -1
- package/core/RefetchEventManager.js +3 -3
- package/core/dataStateErrorCache.d.ts +3 -0
- package/core/dataStateErrorCache.js +9 -0
- package/core/dataStateErrorCache.js.map +1 -0
- package/core/index.d.ts +4 -3
- package/core/index.js +1 -1
- package/core/index.js.map +1 -1
- package/core/types.d.ts +12 -6
- package/core/types.js.map +1 -1
- package/incremental/GraphQLCodegenIncremental.d.ts +55 -0
- package/incremental/GraphQLCodegenIncremental.js +2 -0
- package/incremental/GraphQLCodegenIncremental.js.map +1 -0
- package/incremental/handlers/defer20220824.d.ts +2 -4
- package/incremental/handlers/defer20220824.js.map +1 -1
- package/incremental/handlers/graphql17Alpha9.d.ts +29 -6
- package/incremental/handlers/graphql17Alpha9.js +48 -17
- package/incremental/handlers/graphql17Alpha9.js.map +1 -1
- package/incremental/handlers/notImplemented.js +1 -1
- package/incremental/index.d.ts +1 -0
- package/incremental/index.js.map +1 -1
- package/incremental/internal/types.d.ts +17 -0
- package/incremental/internal/types.js +2 -0
- package/incremental/internal/types.js.map +1 -0
- package/incremental/types.d.ts +55 -4
- package/incremental/types.js.map +1 -1
- package/invariantErrorCodes.js +167 -112
- package/link/core/ApolloLink.js +3 -3
- package/link/http/checkFetcher.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +2 -2
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/ws/index.js +1 -1
- package/local-state/LocalState.js +11 -11
- package/masking/internal/types.d.ts +1 -2
- package/masking/internal/types.js.map +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/utils.js +3 -3
- package/package.json +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +100 -47
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +39 -33
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +23 -15
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +10 -7
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +74 -32
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +83 -34
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks-compiled/useApolloClient.js +1 -1
- package/react/hooks-compiled/useBackgroundQuery.d.ts +100 -47
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.d.ts +39 -33
- package/react/hooks-compiled/useLazyQuery.js +2 -2
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useLoadableQuery.d.ts +23 -15
- package/react/hooks-compiled/useLoadableQuery.js +2 -2
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +10 -7
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/react/hooks-compiled/useQuery.d.ts +74 -32
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
- package/react/hooks-compiled/useSubscription.js +1 -1
- package/react/hooks-compiled/useSuspenseQuery.d.ts +83 -34
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/types.d.ts +15 -4
- package/react/internal/types.js.map +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +20 -5
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/prerenderStatic.js +2 -2
- package/react/types/deprecated.d.ts +5 -4
- package/react/types/deprecated.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +1 -2
- package/testing/core/mocking/mockLink.js +25 -5
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/utilities/caching/sizes.d.ts +39 -1
- package/utilities/caching/sizes.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/index.d.ts +1 -0
- package/utilities/index.js.map +1 -1
- package/utilities/internal/StreamArrayState.d.ts +12 -0
- package/utilities/internal/StreamArrayState.js +23 -0
- package/utilities/internal/StreamArrayState.js.map +1 -0
- package/utilities/internal/addDeferFragmentLabels.d.ts +3 -0
- package/utilities/internal/addDeferFragmentLabels.js +30 -0
- package/utilities/internal/addDeferFragmentLabels.js.map +1 -0
- package/utilities/internal/capitalize.d.ts +7 -0
- package/utilities/internal/capitalize.js +9 -0
- package/utilities/internal/capitalize.js.map +1 -0
- package/utilities/internal/coerceScalarFieldsToParsed.d.ts +9 -0
- package/utilities/internal/coerceScalarFieldsToParsed.js +66 -0
- package/utilities/internal/coerceScalarFieldsToParsed.js.map +1 -0
- package/utilities/internal/constants.d.ts +19 -0
- package/utilities/internal/constants.js +19 -0
- package/utilities/internal/constants.js.map +1 -1
- package/utilities/internal/getDirectiveArgValue.d.ts +9 -0
- package/utilities/internal/getDirectiveArgValue.js +16 -0
- package/utilities/internal/getDirectiveArgValue.js.map +1 -0
- package/utilities/internal/getFragmentDefinition.js +3 -3
- package/utilities/internal/getFragmentFromSelection.js +2 -2
- package/utilities/internal/getFragmentFromSelection.js.map +1 -1
- package/utilities/internal/getFragmentQueryDocument.js +2 -2
- package/utilities/internal/getMainDefinition.js +1 -1
- package/utilities/internal/getMemoryInternals.d.ts +4 -0
- package/utilities/internal/getMemoryInternals.js +6 -0
- package/utilities/internal/getMemoryInternals.js.map +1 -1
- package/utilities/internal/getQueryDefinition.js +1 -1
- package/utilities/internal/getUnwrappedType.d.ts +8 -0
- package/utilities/internal/getUnwrappedType.js +17 -0
- package/utilities/internal/getUnwrappedType.js.map +1 -0
- package/utilities/internal/index.d.ts +16 -1
- package/utilities/internal/index.js +12 -1
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/isDeferredFragment.d.ts +9 -0
- package/utilities/internal/isDeferredFragment.js +35 -0
- package/utilities/internal/isDeferredFragment.js.map +1 -0
- package/utilities/internal/isStreamField.d.ts +9 -0
- package/utilities/internal/isStreamField.js +34 -0
- package/utilities/internal/isStreamField.js.map +1 -0
- package/utilities/internal/isTypenameField.d.ts +3 -0
- package/utilities/internal/isTypenameField.js +4 -0
- package/utilities/internal/isTypenameField.js.map +1 -0
- package/utilities/internal/makeStreamInfoTrie.d.ts +8 -0
- package/utilities/internal/makeStreamInfoTrie.js +14 -0
- package/utilities/internal/makeStreamInfoTrie.js.map +1 -0
- package/utilities/internal/removeDirectivesFromDocument.js +1 -1
- package/utilities/internal/shouldInclude.js +4 -4
- package/utilities/internal/toDiffWithDataState.d.ts +8 -0
- package/utilities/internal/toDiffWithDataState.js +17 -0
- package/utilities/internal/toDiffWithDataState.js.map +1 -0
- package/utilities/internal/types/DeferInfo.d.ts +10 -0
- package/utilities/internal/types/DeferInfo.js +2 -0
- package/utilities/internal/types/DeferInfo.js.map +1 -0
- package/utilities/internal/types/Exact.d.ts +2 -0
- package/utilities/internal/types/Exact.js +2 -0
- package/utilities/internal/types/Exact.js.map +1 -0
- package/utilities/internal/types/IsLooselyEqual.d.ts +10 -0
- package/utilities/internal/types/IsLooselyEqual.js +2 -0
- package/utilities/internal/types/IsLooselyEqual.js.map +1 -0
- package/utilities/internal/types/IsNeverish.d.ts +4 -0
- package/utilities/internal/types/IsNeverish.js +2 -0
- package/utilities/internal/types/IsNeverish.js.map +1 -0
- package/utilities/internal/types/StreamInfoTrie.d.ts +2 -0
- package/utilities/internal/types/StreamInfoTrie.js.map +1 -1
- package/utilities/internal/valueToObjectRepresentation.js +1 -1
- package/utilities/policies/pagination.d.ts +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/subscriptions/relay/index.js +1 -0
- package/utilities/subscriptions/relay/index.js.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -78,8 +78,8 @@ class ApolloClient {
|
|
|
78
78
|
*/
|
|
79
79
|
constructor(options) {
|
|
80
80
|
if (environment_1.__DEV__) {
|
|
81
|
-
(0, invariant_1.invariant)(options.cache,
|
|
82
|
-
(0, invariant_1.invariant)(options.link,
|
|
81
|
+
(0, invariant_1.invariant)(options.cache, 69);
|
|
82
|
+
(0, invariant_1.invariant)(options.link, 70);
|
|
83
83
|
}
|
|
84
84
|
const { cache, documentTransform, ssrMode = false, ssrForceFetchDelay = 0, queryDeduplication = true, defaultOptions, defaultContext, assumeImmutableResults = cache.assumeImmutableResults, localState, devtools, dataMasking, link, incrementalHandler = new incremental_1.NotImplementedHandler(), experiments = [], refetchEventManager, } = options;
|
|
85
85
|
this.link = link;
|
|
@@ -148,29 +148,28 @@ class ApolloClient {
|
|
|
148
148
|
*/
|
|
149
149
|
if (!hasSuggestedDevtools && environment_1.__DEV__) {
|
|
150
150
|
hasSuggestedDevtools = true;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
const win = window;
|
|
152
|
+
const ua = win.navigator.userAgent;
|
|
153
|
+
let url;
|
|
154
|
+
if (typeof ua === "string") {
|
|
155
|
+
if (ua.indexOf("Chrome/") > -1) {
|
|
156
|
+
url =
|
|
157
|
+
"https://chrome.google.com/webstore/detail/" +
|
|
158
|
+
"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
|
|
159
|
+
}
|
|
160
|
+
else if (ua.indexOf("Firefox/") > -1) {
|
|
161
|
+
url =
|
|
162
|
+
"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (win.document &&
|
|
166
|
+
win.top === win.self &&
|
|
167
|
+
/^(https?|file):$/.test(win.location.protocol) &&
|
|
168
|
+
url) {
|
|
154
169
|
setTimeout(() => {
|
|
155
|
-
if (!
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
let url;
|
|
159
|
-
if (typeof ua === "string") {
|
|
160
|
-
if (ua.indexOf("Chrome/") > -1) {
|
|
161
|
-
url =
|
|
162
|
-
"https://chrome.google.com/webstore/detail/" +
|
|
163
|
-
"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
|
|
164
|
-
}
|
|
165
|
-
else if (ua.indexOf("Firefox/") > -1) {
|
|
166
|
-
url =
|
|
167
|
-
"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (url) {
|
|
171
|
-
__DEV__ && invariant_1.invariant.log("Download the Apollo DevTools for a better development " +
|
|
172
|
-
"experience: %s", url);
|
|
173
|
-
}
|
|
170
|
+
if (!win.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
|
|
171
|
+
__DEV__ && invariant_1.invariant.log("Download the Apollo DevTools for a better development " +
|
|
172
|
+
"experience: %s", url);
|
|
174
173
|
}
|
|
175
174
|
}, 10000);
|
|
176
175
|
}
|
|
@@ -268,12 +267,12 @@ class ApolloClient {
|
|
|
268
267
|
if (refetchOn) {
|
|
269
268
|
const operationName = (0, internal_1.getOperationName)(query, "(anonymous)");
|
|
270
269
|
if (!refetchEventManager) {
|
|
271
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
270
|
+
__DEV__ && invariant_1.invariant.warn(71, operationName);
|
|
272
271
|
}
|
|
273
272
|
else if (typeof refetchOn === "object") {
|
|
274
273
|
Object.keys(refetchOn).forEach((source) => {
|
|
275
274
|
if (!refetchEventManager.hasSource(source)) {
|
|
276
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
275
|
+
__DEV__ && invariant_1.invariant.warn(72, source, operationName);
|
|
277
276
|
}
|
|
278
277
|
});
|
|
279
278
|
}
|
|
@@ -295,13 +294,13 @@ class ApolloClient {
|
|
|
295
294
|
options = (0, internal_1.mergeOptions)(this.defaultOptions.query, options);
|
|
296
295
|
}
|
|
297
296
|
if (environment_1.__DEV__) {
|
|
298
|
-
(0, invariant_1.invariant)(options.fetchPolicy !== "cache-and-network",
|
|
299
|
-
(0, invariant_1.invariant)(options.fetchPolicy !== "standby",
|
|
300
|
-
(0, invariant_1.invariant)(options.query,
|
|
301
|
-
(0, invariant_1.invariant)(options.query.kind === "Document",
|
|
302
|
-
(0, invariant_1.invariant)(!options.returnPartialData,
|
|
303
|
-
(0, invariant_1.invariant)(!options.pollInterval,
|
|
304
|
-
(0, invariant_1.invariant)(!options.notifyOnNetworkStatusChange,
|
|
297
|
+
(0, invariant_1.invariant)(options.fetchPolicy !== "cache-and-network", 73);
|
|
298
|
+
(0, invariant_1.invariant)(options.fetchPolicy !== "standby", 74);
|
|
299
|
+
(0, invariant_1.invariant)(options.query, 75);
|
|
300
|
+
(0, invariant_1.invariant)(options.query.kind === "Document", 76);
|
|
301
|
+
(0, invariant_1.invariant)(!options.returnPartialData, 77);
|
|
302
|
+
(0, invariant_1.invariant)(!options.pollInterval, 78);
|
|
303
|
+
(0, invariant_1.invariant)(!options.notifyOnNetworkStatusChange, 79);
|
|
305
304
|
}
|
|
306
305
|
return this.queryManager.query(options);
|
|
307
306
|
};
|
|
@@ -319,9 +318,9 @@ class ApolloClient {
|
|
|
319
318
|
errorPolicy: "none",
|
|
320
319
|
}, this.defaultOptions.mutate), options);
|
|
321
320
|
if (environment_1.__DEV__) {
|
|
322
|
-
(0, invariant_1.invariant)(optionsWithDefaults.mutation,
|
|
321
|
+
(0, invariant_1.invariant)(optionsWithDefaults.mutation, 80);
|
|
323
322
|
(0, invariant_1.invariant)(optionsWithDefaults.fetchPolicy === "network-only" ||
|
|
324
|
-
optionsWithDefaults.fetchPolicy === "no-cache",
|
|
323
|
+
optionsWithDefaults.fetchPolicy === "no-cache", 81);
|
|
325
324
|
}
|
|
326
325
|
(0, internal_1.checkDocument)(optionsWithDefaults.mutation, graphql_1.OperationTypeNode.MUTATION);
|
|
327
326
|
return this.queryManager.mutate(optionsWithDefaults);
|
|
@@ -344,7 +343,7 @@ class ApolloClient {
|
|
|
344
343
|
})));
|
|
345
344
|
return Object.assign(mapped, { restart: observable.restart });
|
|
346
345
|
}
|
|
347
|
-
readQuery(options, optimistic =
|
|
346
|
+
readQuery(options, optimistic = !!options.optimistic) {
|
|
348
347
|
return this.cache.readQuery({ ...options, query: this.transform(options.query) }, optimistic);
|
|
349
348
|
}
|
|
350
349
|
watchFragment(options) {
|
|
@@ -369,7 +368,7 @@ class ApolloClient {
|
|
|
369
368
|
}
|
|
370
369
|
return observable;
|
|
371
370
|
}
|
|
372
|
-
readFragment(options, optimistic =
|
|
371
|
+
readFragment(options, optimistic = !!options.optimistic) {
|
|
373
372
|
return this.cache.readFragment({ ...options, fragment: this.transform(options.fragment) }, optimistic);
|
|
374
373
|
}
|
|
375
374
|
/**
|
|
@@ -527,7 +526,7 @@ class ApolloClient {
|
|
|
527
526
|
// result.queries and result.results instead, you shouldn't have to worry
|
|
528
527
|
// about preventing uncaught rejections for the Promise.all result.
|
|
529
528
|
result.catch((error) => {
|
|
530
|
-
__DEV__ && invariant_1.invariant.debug(
|
|
529
|
+
__DEV__ && invariant_1.invariant.debug(82, error);
|
|
531
530
|
});
|
|
532
531
|
return result;
|
|
533
532
|
}
|