@apollo/client 4.0.0-rc.2 → 4.0.0-rc.3
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 +19 -0
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/index.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/reactiveVars.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs +20 -4
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +17 -2
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/equalByQuery.cjs.map +1 -1
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/networkStatus.cjs.map +1 -1
- package/__cjs/dev/index.cjs.map +1 -1
- package/__cjs/dev/loadDevMessages.cjs.map +1 -1
- package/__cjs/dev/loadErrorMessageHandler.cjs.map +1 -1
- package/__cjs/dev/loadErrorMessages.cjs.map +1 -1
- package/__cjs/dev/setErrorMessageHandler.cjs.map +1 -1
- package/__cjs/dev/symbol.cjs.map +1 -1
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
- package/__cjs/errors/LinkError.cjs.map +1 -1
- package/__cjs/errors/LocalStateError.cjs.map +1 -1
- package/__cjs/errors/ServerError.cjs.map +1 -1
- package/__cjs/errors/ServerParseError.cjs.map +1 -1
- package/__cjs/errors/UnconventionalError.cjs.map +1 -1
- package/__cjs/errors/index.cjs.map +1 -1
- package/__cjs/errors/isErrorLike.cjs.map +1 -1
- package/__cjs/errors/utils.cjs.map +1 -1
- package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
- package/__cjs/incremental/index.cjs.map +1 -1
- package/__cjs/invariantErrorCodes.cjs.map +1 -1
- package/__cjs/link/batch/batchLink.cjs.map +1 -1
- package/__cjs/link/batch/index.cjs.map +1 -1
- package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
- package/__cjs/link/batch-http/index.cjs.map +1 -1
- package/__cjs/link/client-awareness/index.cjs.map +1 -1
- package/__cjs/link/core/concat.cjs.map +1 -1
- package/__cjs/link/core/empty.cjs.map +1 -1
- package/__cjs/link/core/execute.cjs.map +1 -1
- package/__cjs/link/core/from.cjs.map +1 -1
- package/__cjs/link/core/split.cjs.map +1 -1
- package/__cjs/link/http/BaseHttpLink.cjs.map +1 -1
- package/__cjs/link/http/HttpLink.cjs.map +1 -1
- package/__cjs/link/http/index.cjs.map +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/http/rewriteURIForGET.cjs.map +1 -1
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
- package/__cjs/link/index.cjs.map +1 -1
- package/__cjs/link/remove-typename/index.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
- package/__cjs/link/retry/delayFunction.cjs.map +1 -1
- package/__cjs/link/retry/index.cjs.map +1 -1
- package/__cjs/link/retry/retryFunction.cjs.map +1 -1
- package/__cjs/link/retry/retryLink.cjs.map +1 -1
- package/__cjs/link/utils/createOperation.cjs.map +1 -1
- package/__cjs/link/utils/filterOperationVariables.cjs.map +1 -1
- package/__cjs/link/utils/index.cjs.map +1 -1
- package/__cjs/link/utils/transformOperation.cjs.map +1 -1
- package/__cjs/link/utils/validateOperation.cjs.map +1 -1
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/local-state/index.cjs.map +1 -1
- package/__cjs/masking/index.cjs.map +1 -1
- package/__cjs/masking/maskDefinition.cjs.map +1 -1
- package/__cjs/masking/maskFragment.cjs.map +1 -1
- package/__cjs/masking/maskOperation.cjs.map +1 -1
- package/__cjs/masking/utils.cjs.map +1 -1
- package/__cjs/react/context/ApolloContext.cjs.map +1 -1
- package/__cjs/react/hooks/constants.cjs.map +1 -1
- package/__cjs/react/hooks/internal/__use.cjs.map +1 -1
- package/__cjs/react/hooks/internal/index.cjs.map +1 -1
- package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs.map +1 -1
- package/__cjs/react/hooks/internal/useRenderGuard.cjs.map +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs.map +1 -1
- package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSyncExternalStore.cjs.map +1 -1
- package/__cjs/react/index.cjs +2 -1
- package/__cjs/react/index.cjs.map +1 -1
- package/__cjs/react/index.d.cts +1 -0
- package/__cjs/react/index.react-server.cjs.map +1 -1
- package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/compiler-runtime/index.cjs +32 -0
- package/__cjs/react/internal/compiler-runtime/index.cjs.map +1 -0
- package/__cjs/react/internal/compiler-runtime/index.d.cts +8 -0
- package/__cjs/react/internal/index.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
- package/__cjs/react/ssr/index.cjs.map +1 -1
- package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -1
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/index.cjs.map +1 -1
- package/__cjs/testing/react/index.cjs.map +1 -1
- package/__cjs/utilities/caching/index.cjs.map +1 -1
- package/__cjs/utilities/caching/sizes.cjs.map +1 -1
- package/__cjs/utilities/common/stripTypename.cjs.map +1 -1
- package/__cjs/utilities/environment/index.cjs.map +1 -1
- package/__cjs/utilities/environment/index.development.cjs.map +1 -1
- package/__cjs/utilities/environment/index.production.cjs.map +1 -1
- package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs.map +1 -1
- package/__cjs/utilities/graphql/operations.cjs.map +1 -1
- package/__cjs/utilities/graphql/print.cjs.map +1 -1
- package/__cjs/utilities/graphql/storeUtils.cjs.map +1 -1
- package/__cjs/utilities/graphql/transform.cjs.map +1 -1
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/internal/argumentsObjectFromField.cjs.map +1 -1
- package/__cjs/utilities/internal/caches.cjs.map +1 -1
- package/__cjs/utilities/internal/canUseDOM.cjs.map +1 -1
- package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/cloneDeep.cjs.map +1 -1
- package/__cjs/utilities/internal/compact.cjs.map +1 -1
- package/__cjs/utilities/internal/createFragmentMap.cjs.map +1 -1
- package/__cjs/utilities/internal/createFulfilledPromise.cjs.map +1 -1
- package/__cjs/utilities/internal/createRejectedPromise.cjs.map +1 -1
- package/__cjs/utilities/internal/dealias.cjs.map +1 -1
- package/__cjs/utilities/internal/decoratePromise.cjs.map +1 -1
- package/__cjs/utilities/internal/deepFreeze.cjs.map +1 -1
- package/__cjs/utilities/internal/filterMap.cjs.map +1 -1
- package/__cjs/utilities/internal/getDefaultValues.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentDefinition.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentDefinitions.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs.map +1 -1
- package/__cjs/utilities/internal/getMainDefinition.cjs.map +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
- package/__cjs/utilities/internal/getOperationDefinition.cjs.map +1 -1
- package/__cjs/utilities/internal/getOperationName.cjs.map +1 -1
- package/__cjs/utilities/internal/getQueryDefinition.cjs.map +1 -1
- package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
- package/__cjs/utilities/internal/globals/global.cjs.map +1 -1
- package/__cjs/utilities/internal/globals/index.cjs.map +1 -1
- package/__cjs/utilities/internal/globals/maybe.cjs.map +1 -1
- package/__cjs/utilities/internal/graphQLResultHasError.cjs.map +1 -1
- package/__cjs/utilities/internal/hasDirectives.cjs.map +1 -1
- package/__cjs/utilities/internal/hasForcedResolvers.cjs.map +1 -1
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.production.cjs.map +1 -1
- package/__cjs/utilities/internal/isArray.cjs.map +1 -1
- package/__cjs/utilities/internal/isDocumentNode.cjs.map +1 -1
- package/__cjs/utilities/internal/isField.cjs.map +1 -1
- package/__cjs/utilities/internal/isNonEmptyArray.cjs.map +1 -1
- package/__cjs/utilities/internal/isNonNullObject.cjs.map +1 -1
- package/__cjs/utilities/internal/isPlainObject.cjs.map +1 -1
- package/__cjs/utilities/internal/makeReference.cjs.map +1 -1
- package/__cjs/utilities/internal/makeUniqueId.cjs.map +1 -1
- package/__cjs/utilities/internal/maybeDeepFreeze.cjs.map +1 -1
- package/__cjs/utilities/internal/mergeDeep.cjs.map +1 -1
- package/__cjs/utilities/internal/mergeDeepArray.cjs.map +1 -1
- package/__cjs/utilities/internal/mergeOptions.cjs.map +1 -1
- package/__cjs/utilities/internal/omitDeep.cjs.map +1 -1
- package/__cjs/utilities/internal/preventUnhandledRejection.cjs.map +1 -1
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/resultKeyNameFromField.cjs.map +1 -1
- package/__cjs/utilities/internal/shouldInclude.cjs.map +1 -1
- package/__cjs/utilities/internal/storeKeyNameFromField.cjs.map +1 -1
- package/__cjs/utilities/internal/stringifyForDisplay.cjs.map +1 -1
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -1
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs.map +1 -1
- package/__cjs/utilities/invariant/index.cjs.map +1 -1
- package/__cjs/utilities/invariant/index.development.cjs.map +1 -1
- package/__cjs/utilities/policies/pagination.cjs.map +1 -1
- package/__cjs/utilities/shared/canonicalStringify.cjs.map +1 -1
- 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/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +1 -1
- package/cache/core/types/Cache.js +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +1 -1
- package/cache/core/types/DataProxy.js +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.d.ts +1 -1
- package/cache/core/types/common.js +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/index.d.ts +1 -1
- package/cache/index.js +1 -1
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +1 -1
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts +1 -1
- package/cache/inmemory/fragmentRegistry.js +1 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +1 -1
- package/cache/inmemory/helpers.js +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/key-extractor.d.ts +1 -1
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/policies.d.ts +1 -1
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.js +1 -1
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +1 -1
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +1 -1
- package/cache/inmemory/types.js +1 -1
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +17 -2
- package/core/ApolloClient.js +20 -4
- package/core/ApolloClient.js.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +1 -1
- package/core/QueryManager.js.map +1 -1
- package/core/equalByQuery.d.ts +1 -1
- package/core/equalByQuery.js +1 -1
- package/core/equalByQuery.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/core/index.js.map +1 -1
- package/core/networkStatus.d.ts +1 -1
- package/core/networkStatus.js +1 -1
- package/core/networkStatus.js.map +1 -1
- package/core/types.js +1 -1
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.js +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/index.d.ts +1 -1
- package/dev/index.js +1 -1
- package/dev/index.js.map +1 -1
- package/dev/loadDevMessages.d.ts +1 -1
- package/dev/loadDevMessages.js +1 -1
- package/dev/loadDevMessages.js.map +1 -1
- package/dev/loadErrorMessageHandler.d.ts +1 -1
- package/dev/loadErrorMessageHandler.js +1 -1
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/dev/loadErrorMessages.d.ts +1 -1
- package/dev/loadErrorMessages.js +1 -1
- package/dev/loadErrorMessages.js.map +1 -1
- package/dev/setErrorMessageHandler.d.ts +1 -1
- package/dev/setErrorMessageHandler.js +1 -1
- package/dev/setErrorMessageHandler.js.map +1 -1
- package/dev/symbol.d.ts +1 -1
- package/dev/symbol.js +1 -1
- package/dev/symbol.js.map +1 -1
- package/errors/CombinedGraphQLErrors.d.ts +1 -1
- package/errors/CombinedGraphQLErrors.js +1 -1
- package/errors/CombinedGraphQLErrors.js.map +1 -1
- package/errors/CombinedProtocolErrors.d.ts +1 -1
- package/errors/CombinedProtocolErrors.js +1 -1
- package/errors/CombinedProtocolErrors.js.map +1 -1
- package/errors/LinkError.js.map +1 -1
- package/errors/LocalStateError.d.ts +1 -1
- package/errors/LocalStateError.js +1 -1
- package/errors/LocalStateError.js.map +1 -1
- package/errors/ServerError.d.ts +1 -1
- package/errors/ServerError.js +1 -1
- package/errors/ServerError.js.map +1 -1
- package/errors/ServerParseError.d.ts +1 -1
- package/errors/ServerParseError.js +1 -1
- package/errors/ServerParseError.js.map +1 -1
- package/errors/UnconventionalError.d.ts +1 -1
- package/errors/UnconventionalError.js +1 -1
- package/errors/UnconventionalError.js.map +1 -1
- package/errors/index.d.ts +1 -1
- package/errors/index.js +1 -1
- package/errors/index.js.map +1 -1
- package/errors/isErrorLike.d.ts +1 -1
- package/errors/isErrorLike.js +1 -1
- package/errors/isErrorLike.js.map +1 -1
- package/errors/utils.d.ts +1 -1
- package/errors/utils.js +1 -1
- package/errors/utils.js.map +1 -1
- package/incremental/handlers/defer20220824.d.ts +1 -1
- package/incremental/handlers/defer20220824.js +1 -1
- package/incremental/handlers/defer20220824.js.map +1 -1
- package/incremental/handlers/notImplemented.d.ts +1 -1
- package/incremental/index.d.ts +1 -1
- package/incremental/index.js.map +1 -1
- package/incremental/types.js +1 -1
- package/incremental/types.js.map +1 -1
- package/invariantErrorCodes.d.ts +1 -1
- package/invariantErrorCodes.js +4 -1
- package/invariantErrorCodes.js.map +1 -1
- package/legacyEntryPoints/react/internal/compiler-runtime/compiler-runtime.cjs +1 -0
- package/legacyEntryPoints/react/internal/compiler-runtime/compiler-runtime.d.cts +1 -0
- package/legacyEntryPoints/react/internal/compiler-runtime/index.d.ts +1 -0
- package/legacyEntryPoints/react/internal/compiler-runtime/index.js +1 -0
- package/link/batch/batchLink.d.ts +1 -1
- package/link/batch/batchLink.js +1 -1
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.d.ts +1 -1
- package/link/batch/batching.js +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch/index.d.ts +1 -1
- package/link/batch/index.js +1 -1
- package/link/batch/index.js.map +1 -1
- package/link/batch-http/batchHttpLink.d.ts +1 -1
- package/link/batch-http/batchHttpLink.js +1 -1
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/batch-http/index.d.ts +1 -1
- package/link/batch-http/index.js +1 -1
- package/link/batch-http/index.js.map +1 -1
- package/link/client-awareness/ClientAwarenessLink.d.ts +1 -1
- package/link/client-awareness/ClientAwarenessLink.js +1 -1
- package/link/client-awareness/ClientAwarenessLink.js.map +1 -1
- package/link/client-awareness/index.d.ts +1 -1
- package/link/client-awareness/index.js +1 -1
- package/link/client-awareness/index.js.map +1 -1
- package/link/context/index.d.ts +1 -1
- package/link/context/index.js +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/concat.d.ts +1 -1
- package/link/core/concat.js +1 -1
- package/link/core/concat.js.map +1 -1
- package/link/core/empty.d.ts +1 -1
- package/link/core/empty.js +1 -1
- package/link/core/empty.js.map +1 -1
- package/link/core/execute.d.ts +1 -1
- package/link/core/execute.js +1 -1
- package/link/core/execute.js.map +1 -1
- package/link/core/from.d.ts +1 -1
- package/link/core/from.js +1 -1
- package/link/core/from.js.map +1 -1
- package/link/core/split.d.ts +1 -1
- package/link/core/split.js +1 -1
- package/link/core/split.js.map +1 -1
- package/link/core/types.d.ts +1 -1
- package/link/core/types.js +1 -1
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +1 -1
- package/link/error/index.js +1 -1
- package/link/error/index.js.map +1 -1
- package/link/http/BaseHttpLink.d.ts +1 -1
- package/link/http/BaseHttpLink.js +1 -1
- package/link/http/BaseHttpLink.js.map +1 -1
- package/link/http/HttpLink.d.ts +1 -1
- package/link/http/HttpLink.js +1 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.d.ts +1 -1
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createSignalIfSupported.d.ts +1 -1
- package/link/http/createSignalIfSupported.js +1 -1
- package/link/http/createSignalIfSupported.js.map +1 -1
- package/link/http/index.d.ts +1 -1
- package/link/http/index.js +1 -1
- package/link/http/index.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +1 -1
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/rewriteURIForGET.d.ts +1 -1
- package/link/http/rewriteURIForGET.js +1 -1
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +1 -1
- package/link/http/selectHttpOptionsAndBody.js +1 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.d.ts +1 -1
- package/link/http/selectURI.js +1 -1
- package/link/http/selectURI.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/index.d.ts +1 -1
- package/link/index.js +1 -1
- package/link/index.js.map +1 -1
- package/link/persisted-queries/index.d.ts +1 -1
- package/link/remove-typename/index.d.ts +1 -1
- package/link/remove-typename/index.js.map +1 -1
- package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
- package/link/remove-typename/removeTypenameFromVariables.js +1 -1
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/link/retry/delayFunction.d.ts +1 -1
- package/link/retry/delayFunction.js +1 -1
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/index.d.ts +1 -1
- package/link/retry/index.js +1 -1
- package/link/retry/index.js.map +1 -1
- package/link/retry/retryFunction.d.ts +1 -1
- package/link/retry/retryFunction.js +1 -1
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.d.ts +1 -1
- package/link/retry/retryLink.js +1 -1
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +1 -1
- package/link/schema/index.js +1 -1
- package/link/schema/index.js.map +1 -1
- package/link/subscriptions/index.d.ts +1 -1
- package/link/subscriptions/index.js +1 -1
- package/link/subscriptions/index.js.map +1 -1
- package/link/utils/createOperation.d.ts +1 -1
- package/link/utils/createOperation.js +1 -1
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/filterOperationVariables.d.ts +1 -1
- package/link/utils/filterOperationVariables.js +1 -1
- package/link/utils/filterOperationVariables.js.map +1 -1
- package/link/utils/index.d.ts +1 -1
- package/link/utils/index.js +1 -1
- package/link/utils/index.js.map +1 -1
- package/link/utils/transformOperation.d.ts +1 -1
- package/link/utils/transformOperation.js +1 -1
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/validateOperation.d.ts +1 -1
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.d.ts +1 -1
- package/link/ws/index.js +1 -1
- package/link/ws/index.js.map +1 -1
- package/local-state/LocalState.d.ts +1 -1
- package/local-state/LocalState.js.map +1 -1
- package/local-state/index.d.ts +1 -1
- package/local-state/index.js +1 -1
- package/local-state/index.js.map +1 -1
- package/masking/GraphQLCodegenDataMasking.d.ts +1 -1
- package/masking/GraphQLCodegenDataMasking.js +1 -1
- package/masking/GraphQLCodegenDataMasking.js.map +1 -1
- package/masking/index.d.ts +1 -1
- package/masking/index.js +1 -1
- package/masking/index.js.map +1 -1
- package/masking/internal/types.d.ts +1 -1
- package/masking/internal/types.js +1 -1
- package/masking/internal/types.js.map +1 -1
- package/masking/maskDefinition.d.ts +1 -1
- package/masking/maskDefinition.js.map +1 -1
- package/masking/maskFragment.js.map +1 -1
- package/masking/maskOperation.js.map +1 -1
- package/masking/types.d.ts +1 -1
- package/masking/types.js +1 -1
- package/masking/types.js.map +1 -1
- package/masking/utils.js.map +1 -1
- package/package.json +10 -4
- package/react/compiled/index.d.ts +2 -0
- package/react/compiled/index.js +2 -0
- package/react/compiled/index.js.map +1 -0
- package/react/context/ApolloConsumer.d.ts +1 -1
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +1 -1
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +1 -1
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/hooks/constants.d.ts +1 -1
- package/react/hooks/constants.js +1 -1
- package/react/hooks/constants.js.map +1 -1
- package/react/hooks/internal/__use.d.ts +1 -1
- package/react/hooks/internal/__use.js +1 -1
- package/react/hooks/internal/__use.js.map +1 -1
- package/react/hooks/internal/index.d.ts +1 -1
- package/react/hooks/internal/index.js +1 -1
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts +1 -1
- package/react/hooks/internal/useDeepMemo.js +1 -1
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/internal/useRenderGuard.d.ts +1 -1
- package/react/hooks/internal/useRenderGuard.js +1 -1
- package/react/hooks/internal/useRenderGuard.js.map +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.d.ts +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.js.map +1 -1
- package/react/hooks/internal/wrapHook.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.js +1 -14
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.js +7 -7
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +1 -1
- package/react/hooks/useFragment.js +12 -12
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.js +14 -14
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +69 -229
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.js +82 -192
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.js +54 -225
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.js +24 -64
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -1
- package/react/hooks/useReactiveVar.js +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +1 -1
- package/react/hooks/useReadQuery.js +3 -3
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +4 -4
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +1 -1
- package/react/hooks/useSuspenseFragment.js +1 -1
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +34 -59
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.d.ts +1 -1
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/hooks-compiled/constants.d.ts +3 -0
- package/react/hooks-compiled/constants.js +2 -0
- package/react/hooks-compiled/constants.js.map +1 -0
- package/react/hooks-compiled/internal/__use.d.ts +4 -0
- package/react/hooks-compiled/internal/__use.js +22 -0
- package/react/hooks-compiled/internal/__use.js.map +1 -0
- package/react/hooks-compiled/internal/index.d.ts +5 -0
- package/react/hooks-compiled/internal/index.js +6 -0
- package/react/hooks-compiled/internal/index.js.map +1 -0
- package/react/hooks-compiled/internal/useDeepMemo.d.ts +3 -0
- package/react/hooks-compiled/internal/useDeepMemo.js +13 -0
- package/react/hooks-compiled/internal/useDeepMemo.js.map +1 -0
- package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.d.ts +3 -0
- package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.js +9 -0
- package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.js.map +1 -0
- package/react/hooks-compiled/internal/useRenderGuard.d.ts +2 -0
- package/react/hooks-compiled/internal/useRenderGuard.js +42 -0
- package/react/hooks-compiled/internal/useRenderGuard.js.map +1 -0
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.d.ts +3 -0
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +22 -0
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js.map +1 -0
- package/react/hooks-compiled/internal/wrapHook.d.ts +66 -0
- package/react/hooks-compiled/internal/wrapHook.js +64 -0
- package/react/hooks-compiled/internal/wrapHook.js.map +1 -0
- package/react/hooks-compiled/useApolloClient.d.ts +18 -0
- package/react/hooks-compiled/useApolloClient.js +36 -0
- package/react/hooks-compiled/useApolloClient.js.map +1 -0
- package/react/hooks-compiled/useBackgroundQuery.d.ts +210 -0
- package/react/hooks-compiled/useBackgroundQuery.js +80 -0
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -0
- package/react/hooks-compiled/useFragment.d.ts +55 -0
- package/react/hooks-compiled/useFragment.js +97 -0
- package/react/hooks-compiled/useFragment.js.map +1 -0
- package/react/hooks-compiled/useLazyQuery.d.ts +280 -0
- package/react/hooks-compiled/useLazyQuery.js +181 -0
- package/react/hooks-compiled/useLazyQuery.js.map +1 -0
- package/react/hooks-compiled/useLoadableQuery.d.ts +175 -0
- package/react/hooks-compiled/useLoadableQuery.js +247 -0
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -0
- package/react/hooks-compiled/useMutation.d.ts +280 -0
- package/react/hooks-compiled/useMutation.js +263 -0
- package/react/hooks-compiled/useMutation.js.map +1 -0
- package/react/hooks-compiled/useQuery.d.ts +265 -0
- package/react/hooks-compiled/useQuery.js +395 -0
- package/react/hooks-compiled/useQuery.js.map +1 -0
- package/react/hooks-compiled/useQueryRefHandlers.d.ts +44 -0
- package/react/hooks-compiled/useQueryRefHandlers.js +109 -0
- package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -0
- package/react/hooks-compiled/useReactiveVar.d.ts +20 -0
- package/react/hooks-compiled/useReactiveVar.js +33 -0
- package/react/hooks-compiled/useReactiveVar.js.map +1 -0
- package/react/hooks-compiled/useReadQuery.d.ts +24 -0
- package/react/hooks-compiled/useReadQuery.js +43 -0
- package/react/hooks-compiled/useReadQuery.js.map +1 -0
- package/react/hooks-compiled/useSubscription.d.ts +178 -0
- package/react/hooks-compiled/useSubscription.js +223 -0
- package/react/hooks-compiled/useSubscription.js.map +1 -0
- package/react/hooks-compiled/useSuspenseFragment.d.ts +47 -0
- package/react/hooks-compiled/useSuspenseFragment.js +47 -0
- package/react/hooks-compiled/useSuspenseFragment.js.map +1 -0
- package/react/hooks-compiled/useSuspenseQuery.d.ts +204 -0
- package/react/hooks-compiled/useSuspenseQuery.js +144 -0
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -0
- package/react/hooks-compiled/useSyncExternalStore.d.ts +4 -0
- package/react/hooks-compiled/useSyncExternalStore.js +126 -0
- package/react/hooks-compiled/useSyncExternalStore.js.map +1 -0
- package/react/index.compiled.d.ts +26 -0
- package/react/index.compiled.js +21 -0
- package/react/index.compiled.js.map +1 -0
- package/react/index.d.ts +2 -1
- package/react/index.js +2 -1
- package/react/index.js.map +1 -1
- package/react/index.react-server.d.ts +1 -1
- package/react/index.react-server.js +1 -1
- package/react/index.react-server.js.map +1 -1
- package/react/internal/cache/FragmentReference.d.ts +1 -1
- package/react/internal/cache/FragmentReference.js +1 -1
- package/react/internal/cache/FragmentReference.js.map +1 -1
- package/react/internal/cache/SuspenseCache.d.ts +1 -1
- package/react/internal/cache/SuspenseCache.js +1 -1
- package/react/internal/cache/SuspenseCache.js.map +1 -1
- package/react/internal/cache/getSuspenseCache.d.ts +1 -1
- package/react/internal/cache/getSuspenseCache.js +1 -1
- package/react/internal/cache/getSuspenseCache.js.map +1 -1
- package/react/internal/cache/types.d.ts +1 -1
- package/react/internal/cache/types.js +1 -1
- package/react/internal/cache/types.js.map +1 -1
- package/react/internal/compiler-runtime/index.d.ts +8 -0
- package/react/internal/compiler-runtime/index.js +28 -0
- package/react/internal/compiler-runtime/index.js.map +1 -0
- package/react/internal/index.d.ts +1 -1
- package/react/internal/index.js +1 -1
- package/react/internal/index.js.map +1 -1
- package/react/internal/types.d.ts +1 -1
- package/react/internal/types.js +1 -1
- package/react/internal/types.js.map +1 -1
- package/react/query-preloader/createQueryPreloader.js +1 -1
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/getDataFromTree.d.ts +1 -1
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/index.d.ts +1 -1
- package/react/ssr/index.js +1 -1
- package/react/ssr/index.js.map +1 -1
- package/react/ssr/prerenderStatic.d.ts +1 -1
- package/react/ssr/renderToStringWithData.d.ts +1 -1
- package/react/ssr/renderToStringWithData.js +1 -1
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/ssr/useSSRQuery.d.ts +1 -1
- package/react/ssr/useSSRQuery.js +1 -1
- package/react/ssr/useSSRQuery.js.map +1 -1
- package/react/types/deprecated.d.ts +1 -1
- package/react/types/deprecated.js +1 -1
- package/react/types/deprecated.js.map +1 -1
- package/react/types/types.documentation.js +1 -1
- package/react/types/types.documentation.js.map +1 -1
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/types/deprecated.d.ts +1 -1
- package/testing/core/types/deprecated.js +1 -1
- package/testing/core/types/deprecated.js.map +1 -1
- package/testing/index.d.ts +1 -1
- package/testing/index.js +1 -1
- package/testing/index.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +1 -1
- package/testing/react/MockedProvider.js +1 -1
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/react/index.d.ts +1 -1
- package/testing/react/index.js +1 -1
- package/testing/react/index.js.map +1 -1
- package/utilities/DeepPartial.d.ts +1 -1
- package/utilities/DeepPartial.js +1 -1
- package/utilities/DeepPartial.js.map +1 -1
- package/utilities/HKT.d.ts +1 -1
- package/utilities/HKT.js +1 -1
- package/utilities/HKT.js.map +1 -1
- package/utilities/caching/index.d.ts +1 -1
- package/utilities/caching/index.js +1 -1
- package/utilities/caching/index.js.map +1 -1
- package/utilities/caching/sizes.d.ts +1 -1
- package/utilities/caching/sizes.js +1 -1
- package/utilities/caching/sizes.js.map +1 -1
- package/utilities/common/stripTypename.d.ts +1 -1
- package/utilities/common/stripTypename.js +1 -1
- package/utilities/common/stripTypename.js.map +1 -1
- package/utilities/environment/index.d.ts +1 -1
- package/utilities/environment/index.development.d.ts +1 -1
- package/utilities/environment/index.development.js +1 -1
- package/utilities/environment/index.development.js.map +1 -1
- package/utilities/environment/index.js +1 -1
- package/utilities/environment/index.js.map +1 -1
- package/utilities/environment/index.production.d.ts +1 -1
- package/utilities/environment/index.production.js +1 -1
- package/utilities/environment/index.production.js.map +1 -1
- package/utilities/graphql/isFormattedExecutionResult.d.ts +1 -1
- package/utilities/graphql/isFormattedExecutionResult.js +1 -1
- package/utilities/graphql/isFormattedExecutionResult.js.map +1 -1
- package/utilities/graphql/operations.d.ts +1 -1
- package/utilities/graphql/operations.js +1 -1
- package/utilities/graphql/operations.js.map +1 -1
- package/utilities/graphql/print.d.ts +1 -1
- package/utilities/graphql/print.js +1 -1
- package/utilities/graphql/print.js.map +1 -1
- package/utilities/graphql/storeUtils.d.ts +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts +1 -1
- package/utilities/graphql/transform.js +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +1 -1
- package/utilities/index.js +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/internal/argumentsObjectFromField.js.map +1 -1
- package/utilities/internal/caches.js.map +1 -1
- package/utilities/internal/canUseDOM.js.map +1 -1
- package/utilities/internal/checkDocument.js.map +1 -1
- package/utilities/internal/cloneDeep.js.map +1 -1
- package/utilities/internal/compact.js.map +1 -1
- package/utilities/internal/createFragmentMap.js.map +1 -1
- package/utilities/internal/createFulfilledPromise.js.map +1 -1
- package/utilities/internal/createRejectedPromise.js.map +1 -1
- package/utilities/internal/dealias.d.ts +1 -1
- package/utilities/internal/dealias.js +1 -1
- package/utilities/internal/dealias.js.map +1 -1
- package/utilities/internal/decoratePromise.js.map +1 -1
- package/utilities/internal/deepFreeze.js.map +1 -1
- package/utilities/internal/filterMap.d.ts +1 -1
- package/utilities/internal/filterMap.js +1 -1
- package/utilities/internal/filterMap.js.map +1 -1
- package/utilities/internal/getDefaultValues.js.map +1 -1
- package/utilities/internal/getFragmentDefinition.js.map +1 -1
- package/utilities/internal/getFragmentDefinitions.js.map +1 -1
- package/utilities/internal/getFragmentFromSelection.js.map +1 -1
- package/utilities/internal/getFragmentQueryDocument.js.map +1 -1
- package/utilities/internal/getGraphQLErrorsFromResult.js.map +1 -1
- package/utilities/internal/getMainDefinition.js.map +1 -1
- package/utilities/internal/getMemoryInternals.js.map +1 -1
- package/utilities/internal/getOperationDefinition.js.map +1 -1
- package/utilities/internal/getOperationName.js.map +1 -1
- package/utilities/internal/getQueryDefinition.js.map +1 -1
- package/utilities/internal/getStoreKeyName.js.map +1 -1
- package/utilities/internal/globals/global.d.ts +1 -1
- package/utilities/internal/globals/index.d.ts +1 -1
- package/utilities/internal/globals/index.js +1 -1
- package/utilities/internal/globals/index.js.map +1 -1
- package/utilities/internal/globals/maybe.d.ts +1 -1
- package/utilities/internal/globals/maybe.js +1 -1
- package/utilities/internal/globals/maybe.js.map +1 -1
- package/utilities/internal/graphQLResultHasError.js.map +1 -1
- package/utilities/internal/hasDirectives.js.map +1 -1
- package/utilities/internal/hasForcedResolvers.d.ts +1 -1
- package/utilities/internal/hasForcedResolvers.js +1 -1
- package/utilities/internal/hasForcedResolvers.js.map +1 -1
- package/utilities/internal/index.d.ts +1 -1
- package/utilities/internal/index.js +1 -1
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/index.production.d.ts +1 -1
- package/utilities/internal/index.production.js +1 -1
- package/utilities/internal/index.production.js.map +1 -1
- package/utilities/internal/isArray.js.map +1 -1
- package/utilities/internal/isDocumentNode.js.map +1 -1
- package/utilities/internal/isField.js.map +1 -1
- package/utilities/internal/isNonEmptyArray.js.map +1 -1
- package/utilities/internal/isNonNullObject.js.map +1 -1
- package/utilities/internal/isPlainObject.js.map +1 -1
- package/utilities/internal/makeReference.js.map +1 -1
- package/utilities/internal/makeUniqueId.js.map +1 -1
- package/utilities/internal/maybeDeepFreeze.js.map +1 -1
- package/utilities/internal/mergeDeep.js.map +1 -1
- package/utilities/internal/mergeDeepArray.js.map +1 -1
- package/utilities/internal/mergeOptions.js.map +1 -1
- package/utilities/internal/omitDeep.js.map +1 -1
- package/utilities/internal/preventUnhandledRejection.d.ts +1 -1
- package/utilities/internal/preventUnhandledRejection.js +1 -1
- package/utilities/internal/preventUnhandledRejection.js.map +1 -1
- package/utilities/internal/removeDirectivesFromDocument.js.map +1 -1
- package/utilities/internal/resultKeyNameFromField.js.map +1 -1
- package/utilities/internal/shouldInclude.js.map +1 -1
- package/utilities/internal/storeKeyNameFromField.js.map +1 -1
- package/utilities/internal/stringifyForDisplay.js.map +1 -1
- package/utilities/internal/toQueryResult.js.map +1 -1
- package/utilities/internal/types/ApplyHKT.js +1 -1
- package/utilities/internal/types/ApplyHKT.js.map +1 -1
- package/utilities/internal/types/ApplyHKTImplementationWithDefault.js +1 -1
- package/utilities/internal/types/ApplyHKTImplementationWithDefault.js.map +1 -1
- package/utilities/internal/types/DecoratedPromise.js +1 -1
- package/utilities/internal/types/DecoratedPromise.js.map +1 -1
- package/utilities/internal/types/DeepOmit.js +1 -1
- package/utilities/internal/types/DeepOmit.js.map +1 -1
- package/utilities/internal/types/FragmentMap.js +1 -1
- package/utilities/internal/types/FragmentMap.js.map +1 -1
- package/utilities/internal/types/FragmentMapFunction.js +1 -1
- package/utilities/internal/types/FragmentMapFunction.js.map +1 -1
- package/utilities/internal/types/FulfilledPromise.js +1 -1
- package/utilities/internal/types/FulfilledPromise.js.map +1 -1
- package/utilities/internal/types/IsAny.js +1 -1
- package/utilities/internal/types/IsAny.js.map +1 -1
- package/utilities/internal/types/NoInfer.d.ts +1 -1
- package/utilities/internal/types/NoInfer.js +1 -1
- package/utilities/internal/types/NoInfer.js.map +1 -1
- package/utilities/internal/types/PendingPromise.js +1 -1
- package/utilities/internal/types/PendingPromise.js.map +1 -1
- package/utilities/internal/types/Prettify.js +1 -1
- package/utilities/internal/types/Prettify.js.map +1 -1
- package/utilities/internal/types/Primitive.js +1 -1
- package/utilities/internal/types/Primitive.js.map +1 -1
- package/utilities/internal/types/RejectedPromise.js +1 -1
- package/utilities/internal/types/RejectedPromise.js.map +1 -1
- package/utilities/internal/types/RemoveIndexSignature.js +1 -1
- package/utilities/internal/types/RemoveIndexSignature.js.map +1 -1
- package/utilities/internal/types/TupleToIntersection.d.ts +1 -1
- package/utilities/internal/types/TupleToIntersection.js +1 -1
- package/utilities/internal/types/TupleToIntersection.js.map +1 -1
- package/utilities/internal/types/VariablesOption.js +1 -1
- package/utilities/internal/types/VariablesOption.js.map +1 -1
- package/utilities/internal/valueToObjectRepresentation.js.map +1 -1
- package/utilities/invariant/index.d.ts +1 -1
- package/utilities/invariant/index.development.d.ts +1 -1
- package/utilities/invariant/index.development.js +1 -1
- package/utilities/invariant/index.development.js.map +1 -1
- package/utilities/invariant/index.js +1 -1
- package/utilities/invariant/index.js.map +1 -1
- package/utilities/policies/pagination.d.ts +1 -1
- package/utilities/policies/pagination.js +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/shared/canonicalStringify.d.ts +1 -1
- package/utilities/shared/canonicalStringify.js +1 -1
- package/utilities/shared/canonicalStringify.js.map +1 -1
- package/utilities/subscriptions/relay/index.d.ts +1 -1
- package/utilities/subscriptions/relay/index.js +1 -1
- package/utilities/subscriptions/relay/index.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { c as _c } from "@apollo/client/react/internal/compiler-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { canonicalStringify } from "@apollo/client/cache";
|
|
4
|
+
import { assertWrappedQueryRef, getSuspenseCache, unwrapQueryRef, updateWrappedQueryRef, wrapQueryRef, } from "@apollo/client/react/internal";
|
|
5
|
+
import { __DEV__ } from "@apollo/client/utilities/environment";
|
|
6
|
+
import { invariant } from "@apollo/client/utilities/invariant";
|
|
7
|
+
import { useDeepMemo, useRenderGuard } from "./internal/index.js";
|
|
8
|
+
import { validateSuspenseHookOptions } from "./internal/validateSuspenseHookOptions.js";
|
|
9
|
+
import { useApolloClient } from "./useApolloClient.js";
|
|
10
|
+
export function useLoadableQuery(query, t0) {
|
|
11
|
+
const $ = _c(34);
|
|
12
|
+
let t1;
|
|
13
|
+
|
|
14
|
+
if ($[0] !== t0) {
|
|
15
|
+
t1 = t0 === undefined ? {} : t0;
|
|
16
|
+
$[0] = t0;
|
|
17
|
+
$[1] = t1;
|
|
18
|
+
} else {
|
|
19
|
+
t1 = $[1];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const options = t1;
|
|
23
|
+
const client = useApolloClient(options.client);
|
|
24
|
+
let t2;
|
|
25
|
+
|
|
26
|
+
if ($[2] !== client) {
|
|
27
|
+
t2 = getSuspenseCache(client);
|
|
28
|
+
$[2] = client;
|
|
29
|
+
$[3] = t2;
|
|
30
|
+
} else {
|
|
31
|
+
t2 = $[3];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const suspenseCache = t2;
|
|
35
|
+
let t3;
|
|
36
|
+
|
|
37
|
+
if ($[4] !== client || $[5] !== options || $[6] !== query) {
|
|
38
|
+
t3 = {
|
|
39
|
+
client,
|
|
40
|
+
query,
|
|
41
|
+
options
|
|
42
|
+
};
|
|
43
|
+
$[4] = client;
|
|
44
|
+
$[5] = options;
|
|
45
|
+
$[6] = query;
|
|
46
|
+
$[7] = t3;
|
|
47
|
+
} else {
|
|
48
|
+
t3 = $[7];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const watchQueryOptions = useWatchQueryOptions(t3);
|
|
52
|
+
const {
|
|
53
|
+
queryKey: t4
|
|
54
|
+
} = options;
|
|
55
|
+
let t5;
|
|
56
|
+
|
|
57
|
+
if ($[8] !== t4) {
|
|
58
|
+
t5 = t4 === undefined ? [] : t4;
|
|
59
|
+
$[8] = t4;
|
|
60
|
+
$[9] = t5;
|
|
61
|
+
} else {
|
|
62
|
+
t5 = $[9];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const queryKey = t5;
|
|
66
|
+
const [queryRef, setQueryRef] = React.useState(null);
|
|
67
|
+
assertWrappedQueryRef(queryRef);
|
|
68
|
+
let t6;
|
|
69
|
+
|
|
70
|
+
if ($[10] !== queryRef) {
|
|
71
|
+
t6 = queryRef && unwrapQueryRef(queryRef);
|
|
72
|
+
$[10] = queryRef;
|
|
73
|
+
$[11] = t6;
|
|
74
|
+
} else {
|
|
75
|
+
t6 = $[11];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const internalQueryRef = t6;
|
|
79
|
+
|
|
80
|
+
if (queryRef && internalQueryRef?.didChangeOptions(watchQueryOptions)) {
|
|
81
|
+
const promise = internalQueryRef.applyOptions(watchQueryOptions);
|
|
82
|
+
updateWrappedQueryRef(queryRef, promise);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const calledDuringRender = useRenderGuard();
|
|
86
|
+
let t7;
|
|
87
|
+
|
|
88
|
+
if ($[12] !== internalQueryRef) {
|
|
89
|
+
t7 = options_0 => {
|
|
90
|
+
if (!internalQueryRef) {
|
|
91
|
+
throw new Error("The query has not been loaded. Please load the query.");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const promise_0 = internalQueryRef.fetchMore(options_0);
|
|
95
|
+
setQueryRef(wrapQueryRef(internalQueryRef));
|
|
96
|
+
return promise_0;
|
|
97
|
+
};
|
|
98
|
+
$[12] = internalQueryRef;
|
|
99
|
+
$[13] = t7;
|
|
100
|
+
} else {
|
|
101
|
+
t7 = $[13];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const fetchMore = t7;
|
|
105
|
+
let t8;
|
|
106
|
+
|
|
107
|
+
if ($[14] !== internalQueryRef) {
|
|
108
|
+
t8 = options_1 => {
|
|
109
|
+
if (!internalQueryRef) {
|
|
110
|
+
throw new Error("The query has not been loaded. Please load the query.");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const promise_1 = internalQueryRef.refetch(options_1);
|
|
114
|
+
setQueryRef(wrapQueryRef(internalQueryRef));
|
|
115
|
+
return promise_1;
|
|
116
|
+
};
|
|
117
|
+
$[14] = internalQueryRef;
|
|
118
|
+
$[15] = t8;
|
|
119
|
+
} else {
|
|
120
|
+
t8 = $[15];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const refetch = t8;
|
|
124
|
+
let t9;
|
|
125
|
+
|
|
126
|
+
if ($[16] !== calledDuringRender || $[17] !== client || $[18] !== query || $[19] !== queryKey || $[20] !== suspenseCache || $[21] !== watchQueryOptions) {
|
|
127
|
+
t9 = (...t10) => {
|
|
128
|
+
const args = t10;
|
|
129
|
+
invariant(!calledDuringRender(), 31);
|
|
130
|
+
const [variables] = args;
|
|
131
|
+
const cacheKey = [query, canonicalStringify(variables), ...[].concat(queryKey)];
|
|
132
|
+
const queryRef_0 = suspenseCache.getQueryRef(cacheKey, () => client.watchQuery({
|
|
133
|
+
...watchQueryOptions,
|
|
134
|
+
variables
|
|
135
|
+
}));
|
|
136
|
+
setQueryRef(wrapQueryRef(queryRef_0));
|
|
137
|
+
};
|
|
138
|
+
$[16] = calledDuringRender;
|
|
139
|
+
$[17] = client;
|
|
140
|
+
$[18] = query;
|
|
141
|
+
$[19] = queryKey;
|
|
142
|
+
$[20] = suspenseCache;
|
|
143
|
+
$[21] = watchQueryOptions;
|
|
144
|
+
$[22] = t9;
|
|
145
|
+
} else {
|
|
146
|
+
t9 = $[22];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const loadQuery = t9;
|
|
150
|
+
let t10;
|
|
151
|
+
|
|
152
|
+
if ($[23] !== internalQueryRef) {
|
|
153
|
+
t10 = options_2 => {
|
|
154
|
+
invariant(internalQueryRef, 32);
|
|
155
|
+
return internalQueryRef.observable.subscribeToMore(options_2);
|
|
156
|
+
};
|
|
157
|
+
$[23] = internalQueryRef;
|
|
158
|
+
$[24] = t10;
|
|
159
|
+
} else {
|
|
160
|
+
t10 = $[24];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const subscribeToMore = t10;
|
|
164
|
+
let t11;
|
|
165
|
+
|
|
166
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
167
|
+
t11 = () => {
|
|
168
|
+
setQueryRef(null);
|
|
169
|
+
};
|
|
170
|
+
$[25] = t11;
|
|
171
|
+
} else {
|
|
172
|
+
t11 = $[25];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const reset = t11;
|
|
176
|
+
let t12;
|
|
177
|
+
|
|
178
|
+
if ($[26] !== fetchMore || $[27] !== refetch || $[28] !== subscribeToMore) {
|
|
179
|
+
t12 = {
|
|
180
|
+
fetchMore,
|
|
181
|
+
refetch,
|
|
182
|
+
reset,
|
|
183
|
+
subscribeToMore
|
|
184
|
+
};
|
|
185
|
+
$[26] = fetchMore;
|
|
186
|
+
$[27] = refetch;
|
|
187
|
+
$[28] = subscribeToMore;
|
|
188
|
+
$[29] = t12;
|
|
189
|
+
} else {
|
|
190
|
+
t12 = $[29];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let t13;
|
|
194
|
+
|
|
195
|
+
if ($[30] !== loadQuery || $[31] !== queryRef || $[32] !== t12) {
|
|
196
|
+
t13 = [loadQuery, queryRef, t12];
|
|
197
|
+
$[30] = loadQuery;
|
|
198
|
+
$[31] = queryRef;
|
|
199
|
+
$[32] = t12;
|
|
200
|
+
$[33] = t13;
|
|
201
|
+
} else {
|
|
202
|
+
t13 = $[33];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return t13;
|
|
206
|
+
}
|
|
207
|
+
function useWatchQueryOptions(t0) {
|
|
208
|
+
const $ = _c(5);
|
|
209
|
+
const {
|
|
210
|
+
client,
|
|
211
|
+
query,
|
|
212
|
+
options
|
|
213
|
+
} = t0;
|
|
214
|
+
let t1;
|
|
215
|
+
let t2;
|
|
216
|
+
|
|
217
|
+
if ($[0] !== client || $[1] !== options || $[2] !== query) {
|
|
218
|
+
t1 = () => {
|
|
219
|
+
const fetchPolicy = options.fetchPolicy || client.defaultOptions.watchQuery?.fetchPolicy || "cache-first";
|
|
220
|
+
const watchQueryOptions = {
|
|
221
|
+
...options,
|
|
222
|
+
fetchPolicy,
|
|
223
|
+
query,
|
|
224
|
+
notifyOnNetworkStatusChange: false,
|
|
225
|
+
nextFetchPolicy: void 0
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
if (__DEV__) {
|
|
229
|
+
validateSuspenseHookOptions(watchQueryOptions);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return watchQueryOptions;
|
|
233
|
+
};t2 = [client, options, query];
|
|
234
|
+
$[0] = client;
|
|
235
|
+
$[1] = options;
|
|
236
|
+
$[2] = query;
|
|
237
|
+
$[3] = t1;
|
|
238
|
+
$[4] = t2;
|
|
239
|
+
} else {
|
|
240
|
+
t1 = $[3];
|
|
241
|
+
t2 = $[4];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return useDeepMemo(t1, t2);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
//# sourceMappingURL=useLoadableQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLoadableQuery.js","sources":["../../../src/react/hooks/useLoadableQuery.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport type {\n ApolloClient,\n DataState,\n DefaultContext,\n DocumentNode,\n ErrorPolicy,\n OperationVariables,\n RefetchWritePolicy,\n TypedDocumentNode,\n WatchQueryFetchPolicy,\n WatchQueryOptions,\n} from \"@apollo/client\";\nimport type {\n SubscribeToMoreFunction,\n SubscribeToMoreOptions,\n} from \"@apollo/client\";\nimport { canonicalStringify } from \"@apollo/client/cache\";\nimport type {\n CacheKey,\n FetchMoreFunction,\n QueryRef,\n RefetchFunction,\n} from \"@apollo/client/react/internal\";\nimport {\n assertWrappedQueryRef,\n getSuspenseCache,\n unwrapQueryRef,\n updateWrappedQueryRef,\n wrapQueryRef,\n} from \"@apollo/client/react/internal\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { __use, useDeepMemo, useRenderGuard } from \"./internal/index.js\";\nimport { validateSuspenseHookOptions } from \"./internal/validateSuspenseHookOptions.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\n\ntype ResetFunction = () => void;\n\nexport declare namespace useLoadableQuery {\n export type LoadQueryFunction<TVariables extends OperationVariables> = (\n // Use variadic args to handle cases where TVariables is type `never`, in\n // which case we don't want to allow a variables argument. In other\n // words, we don't want to allow variables to be passed as an argument to this\n // function if the query does not expect variables in the document.\n ...args: {} extends TVariables ? [variables?: TVariables]\n : [variables: TVariables]\n ) => void;\n\n export type Result<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n TStates extends\n DataState<TData>[\"dataState\"] = DataState<TData>[\"dataState\"],\n > = [\n loadQuery: LoadQueryFunction<TVariables>,\n queryRef: QueryRef<TData, TVariables, TStates> | null,\n handlers: {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#fetchMore:member} */\n fetchMore: FetchMoreFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: RefetchFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!ObservableQuery#subscribeToMore:member(1)} */\n subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;\n /**\n * A function that resets the `queryRef` back to `null`.\n */\n reset: ResetFunction;\n },\n ];\n\n export type FetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n >;\n\n export interface Options {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: FetchPolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#queryKey:member} */\n queryKey?: string | number | any[];\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n }\n}\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n returnPartialData: true;\n errorPolicy: \"ignore\" | \"all\";\n }\n): useLoadableQuery.Result<\n TData,\n TVariables,\n \"complete\" | \"streaming\" | \"partial\" | \"empty\"\n>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n errorPolicy: \"ignore\" | \"all\";\n }\n): useLoadableQuery.Result<\n TData,\n TVariables,\n \"complete\" | \"streaming\" | \"empty\"\n>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n returnPartialData: true;\n }\n): useLoadableQuery.Result<\n TData,\n TVariables,\n \"complete\" | \"streaming\" | \"partial\"\n>;\n\n/**\n * A hook for imperatively loading a query, such as responding to a user\n * interaction.\n *\n * > Refer to the [Suspense - Fetching in response to user interaction](https://www.apollographql.com/docs/react/data/suspense#fetching-in-response-to-user-interaction) section for a more in-depth overview of `useLoadableQuery`.\n *\n * @example\n * ```jsx\n * import { gql, useLoadableQuery } from \"@apollo/client\";\n *\n * const GET_GREETING = gql`\n * query GetGreeting($language: String!) {\n * greeting(language: $language) {\n * message\n * }\n * }\n * `;\n *\n * function App() {\n * const [loadGreeting, queryRef] = useLoadableQuery(GET_GREETING);\n *\n * return (\n * <>\n * <button onClick={() => loadGreeting({ language: \"english\" })}>\n * Load greeting\n * </button>\n * <Suspense fallback={<div>Loading...</div>}>\n * {queryRef && <Hello queryRef={queryRef} />}\n * </Suspense>\n * </>\n * );\n * }\n *\n * function Hello({ queryRef }) {\n * const { data } = useReadQuery(queryRef);\n *\n * return <div>{data.greeting.message}</div>;\n * }\n * ```\n *\n * @since 3.9.0\n * @param query - A GraphQL query document parsed into an AST by `gql`.\n * @param options - Options to control how the query is executed.\n * @returns A tuple in the form of `[loadQuery, queryRef, handlers]`\n */\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: useLoadableQuery.Options\n): useLoadableQuery.Result<TData, TVariables, \"complete\" | \"streaming\">;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options = {}\n): useLoadableQuery.Result<TData, TVariables> {\n const client = useApolloClient(options.client);\n const suspenseCache = getSuspenseCache(client);\n const watchQueryOptions = useWatchQueryOptions({ client, query, options });\n const { queryKey = [] } = options;\n\n const [queryRef, setQueryRef] = React.useState<QueryRef<\n TData,\n TVariables,\n DataState<TData>[\"dataState\"]\n > | null>(null);\n\n assertWrappedQueryRef(queryRef);\n\n const internalQueryRef = queryRef && unwrapQueryRef(queryRef);\n\n if (queryRef && internalQueryRef?.didChangeOptions(watchQueryOptions)) {\n const promise = internalQueryRef.applyOptions(watchQueryOptions);\n updateWrappedQueryRef(queryRef, promise);\n }\n\n const calledDuringRender = useRenderGuard();\n\n const fetchMore: FetchMoreFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.fetchMore(options);\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const refetch: RefetchFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.refetch(options);\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const loadQuery: useLoadableQuery.LoadQueryFunction<TVariables> =\n React.useCallback(\n (...args) => {\n invariant(\n !calledDuringRender(),\n \"useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook.\"\n );\n\n const [variables] = args;\n\n const cacheKey: CacheKey = [\n query,\n canonicalStringify(variables),\n ...([] as any[]).concat(queryKey),\n ];\n\n const queryRef = suspenseCache.getQueryRef(cacheKey, () =>\n client.watchQuery({\n ...watchQueryOptions,\n variables,\n } as WatchQueryOptions<any, any>)\n );\n\n setQueryRef(wrapQueryRef(queryRef));\n },\n [\n query,\n queryKey,\n suspenseCache,\n watchQueryOptions,\n calledDuringRender,\n client,\n ]\n );\n\n const subscribeToMore: SubscribeToMoreFunction<TData, TVariables> =\n React.useCallback(\n (options) => {\n invariant(\n internalQueryRef,\n \"The query has not been loaded. Please load the query.\"\n );\n\n return internalQueryRef.observable.subscribeToMore(\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n options as any as SubscribeToMoreOptions<TData, OperationVariables>\n );\n },\n [internalQueryRef]\n );\n\n const reset: ResetFunction = React.useCallback(() => {\n setQueryRef(null);\n }, []);\n\n return [loadQuery, queryRef, { fetchMore, refetch, reset, subscribeToMore }];\n}\n\nfunction useWatchQueryOptions<TData, TVariables extends OperationVariables>({\n client,\n query,\n options,\n}: {\n client: ApolloClient;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n options: useLoadableQuery.Options;\n}): WatchQueryOptions<TVariables, TData> {\n return useDeepMemo<WatchQueryOptions<TVariables, TData>>(() => {\n const fetchPolicy =\n options.fetchPolicy ||\n client.defaultOptions.watchQuery?.fetchPolicy ||\n \"cache-first\";\n\n const watchQueryOptions = {\n ...options,\n fetchPolicy,\n query,\n notifyOnNetworkStatusChange: false,\n nextFetchPolicy: void 0,\n };\n\n if (__DEV__) {\n validateSuspenseHookOptions(watchQueryOptions as any);\n }\n\n return watchQueryOptions as WatchQueryOptions<TVariables, TData>;\n }, [client, options, query]);\n}\n"],"names":[],"mappings":";AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAP,CAAA,EAAY,CAAZ,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAuB,CAAvB,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B;AAkB9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAmC,CAAnC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyD;AAOzD,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EACL,CADF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACuB,EACrB,CAFF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEkB,EAChB,CAHF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAGgB,EACd,CAJF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAIuB,EACrB,CALF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAKc,EALd,EAAA,CAAA,CAAA,CAAA,EAMO,CANP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAMsC;AACtC,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAwB,CAAxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAC9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0B,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAS,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2B,EAAE,CAA7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAmD,CAAnD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwE;AACxE,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA4C,CAA5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuF;AACvF,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAgC,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsD"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
2
|
+
import type { ApolloCache, ApolloClient, DefaultContext, DocumentNode, ErrorLike, ErrorPolicy, InternalRefetchQueriesInclude, MaybeMasked, MutateResult, MutationFetchPolicy, MutationQueryReducersMap, MutationUpdaterFunction, NormalizedExecutionResult, OnQueryUpdated, OperationVariables, Unmasked } from "@apollo/client";
|
|
3
|
+
import type { IgnoreModifier } from "@apollo/client/cache";
|
|
4
|
+
import type { NoInfer, Prettify } from "@apollo/client/utilities/internal";
|
|
5
|
+
type MakeRequiredVariablesOptional<TVariables extends OperationVariables, TConfiguredVariables extends Partial<TVariables>> = Prettify<{
|
|
6
|
+
[K in keyof TVariables as K extends keyof TConfiguredVariables ? K : never]?: TVariables[K];
|
|
7
|
+
} & Omit<TVariables, keyof TConfiguredVariables>>;
|
|
8
|
+
export declare namespace useMutation {
|
|
9
|
+
interface Options<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache, TConfiguredVariables extends Partial<TVariables> = Partial<TVariables>> {
|
|
10
|
+
/**
|
|
11
|
+
* By providing either an object or a callback function that, when invoked after a mutation, allows you to return optimistic data and optionally skip updates via the `IGNORE` sentinel object, Apollo Client caches this temporary (and potentially incorrect) response until the mutation completes, enabling more responsive UI updates.
|
|
12
|
+
*
|
|
13
|
+
* For more information, see [Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui/).
|
|
14
|
+
*
|
|
15
|
+
* @docGroup
|
|
16
|
+
*
|
|
17
|
+
* 3. Caching options
|
|
18
|
+
*/
|
|
19
|
+
optimisticResponse?: Unmasked<NoInfer<TData>> | ((vars: TVariables, { IGNORE }: {
|
|
20
|
+
IGNORE: IgnoreModifier;
|
|
21
|
+
}) => Unmasked<NoInfer<TData>> | IgnoreModifier);
|
|
22
|
+
/**
|
|
23
|
+
* A `MutationQueryReducersMap`, which is map from query names to mutation query reducers. Briefly, this map defines how to incorporate the results of the mutation into the results of queries that are currently being watched by your application.
|
|
24
|
+
*/
|
|
25
|
+
updateQueries?: MutationQueryReducersMap<TData>;
|
|
26
|
+
/**
|
|
27
|
+
* An array (or a function that _returns_ an array) that specifies which queries you want to refetch after the mutation occurs.
|
|
28
|
+
*
|
|
29
|
+
* Each array value can be either:
|
|
30
|
+
*
|
|
31
|
+
* - An object containing the `query` to execute, along with any `variables`
|
|
32
|
+
*
|
|
33
|
+
* - A string indicating the operation name of the query to refetch
|
|
34
|
+
*
|
|
35
|
+
* @docGroup
|
|
36
|
+
*
|
|
37
|
+
* 1. Operation options
|
|
38
|
+
*/
|
|
39
|
+
refetchQueries?: ((result: NormalizedExecutionResult<Unmasked<TData>>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
|
|
40
|
+
/**
|
|
41
|
+
* If `true`, makes sure all queries included in `refetchQueries` are completed before the mutation is considered complete.
|
|
42
|
+
*
|
|
43
|
+
* The default value is `false` (queries are refetched asynchronously).
|
|
44
|
+
*
|
|
45
|
+
* @docGroup
|
|
46
|
+
*
|
|
47
|
+
* 1. Operation options
|
|
48
|
+
*/
|
|
49
|
+
awaitRefetchQueries?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* A function used to update the Apollo Client cache after the mutation completes.
|
|
52
|
+
*
|
|
53
|
+
* For more information, see [Updating the cache after a mutation](https://www.apollographql.com/docs/react/data/mutations#updating-the-cache-after-a-mutation).
|
|
54
|
+
*
|
|
55
|
+
* @docGroup
|
|
56
|
+
*
|
|
57
|
+
* 3. Caching options
|
|
58
|
+
*/
|
|
59
|
+
update?: MutationUpdaterFunction<TData, TVariables, TCache>;
|
|
60
|
+
/**
|
|
61
|
+
* Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the `refetchQueries: [...]` list passed to `client.mutate`.
|
|
62
|
+
*
|
|
63
|
+
* Returning a `Promise` from `onQueryUpdated` will cause the final mutation `Promise` to await the returned `Promise`. Returning `false` causes the query to be ignored.
|
|
64
|
+
*
|
|
65
|
+
* @docGroup
|
|
66
|
+
*
|
|
67
|
+
* 1. Operation options
|
|
68
|
+
*/
|
|
69
|
+
onQueryUpdated?: OnQueryUpdated<any>;
|
|
70
|
+
/**
|
|
71
|
+
* Specifies how the mutation handles a response that returns both GraphQL errors and partial results.
|
|
72
|
+
*
|
|
73
|
+
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
|
|
74
|
+
*
|
|
75
|
+
* The default value is `none`, meaning that the mutation result includes error details but _not_ partial results.
|
|
76
|
+
*
|
|
77
|
+
* @docGroup
|
|
78
|
+
*
|
|
79
|
+
* 1. Operation options
|
|
80
|
+
*/
|
|
81
|
+
errorPolicy?: ErrorPolicy;
|
|
82
|
+
/**
|
|
83
|
+
* An object containing all of the GraphQL variables your mutation requires to execute.
|
|
84
|
+
*
|
|
85
|
+
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
86
|
+
*
|
|
87
|
+
* @docGroup
|
|
88
|
+
*
|
|
89
|
+
* 1. Operation options
|
|
90
|
+
*/
|
|
91
|
+
variables?: TConfiguredVariables;
|
|
92
|
+
/**
|
|
93
|
+
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
|
|
94
|
+
*
|
|
95
|
+
* @docGroup
|
|
96
|
+
*
|
|
97
|
+
* 2. Networking options
|
|
98
|
+
*/
|
|
99
|
+
context?: DefaultContext;
|
|
100
|
+
/**
|
|
101
|
+
* Provide `no-cache` if the mutation's result should _not_ be written to the Apollo Client cache.
|
|
102
|
+
*
|
|
103
|
+
* The default value is `network-only` (which means the result _is_ written to the cache).
|
|
104
|
+
*
|
|
105
|
+
* Unlike queries, mutations _do not_ support [fetch policies](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy) besides `network-only` and `no-cache`.
|
|
106
|
+
*
|
|
107
|
+
* @docGroup
|
|
108
|
+
*
|
|
109
|
+
* 3. Caching options
|
|
110
|
+
*/
|
|
111
|
+
fetchPolicy?: MutationFetchPolicy;
|
|
112
|
+
/**
|
|
113
|
+
* To avoid retaining sensitive information from mutation root field arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION` fields from the cache after each mutation finishes. If you need this information to remain in the cache, you can prevent the removal by passing `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are also passed to the mutation `update` function, so we recommend obtaining the results that way, rather than using this option, if possible.
|
|
114
|
+
*/
|
|
115
|
+
keepRootFields?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* The instance of `ApolloClient` to use to execute the mutation.
|
|
118
|
+
*
|
|
119
|
+
* By default, the instance that's passed down via context is used, but you can provide a different instance here.
|
|
120
|
+
*
|
|
121
|
+
* @docGroup
|
|
122
|
+
*
|
|
123
|
+
* 2. Networking options
|
|
124
|
+
*/
|
|
125
|
+
client?: ApolloClient;
|
|
126
|
+
/**
|
|
127
|
+
* If `true`, the in-progress mutation's associated component re-renders whenever the network status changes or a network error occurs.
|
|
128
|
+
*
|
|
129
|
+
* The default value is `true`.
|
|
130
|
+
*
|
|
131
|
+
* @docGroup
|
|
132
|
+
*
|
|
133
|
+
* 2. Networking options
|
|
134
|
+
*/
|
|
135
|
+
notifyOnNetworkStatusChange?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* A callback function that's called when your mutation successfully completes with zero errors (or if `errorPolicy` is `ignore` and partial data is returned).
|
|
138
|
+
*
|
|
139
|
+
* This function is passed the mutation's result `data` and any options passed to the mutation.
|
|
140
|
+
*
|
|
141
|
+
* @docGroup
|
|
142
|
+
*
|
|
143
|
+
* 1. Operation options
|
|
144
|
+
*/
|
|
145
|
+
onCompleted?: (data: MaybeMasked<TData>, clientOptions?: Options<TData, TVariables, TCache>) => void;
|
|
146
|
+
/**
|
|
147
|
+
* A callback function that's called when the mutation encounters one or more errors (unless `errorPolicy` is `ignore`).
|
|
148
|
+
*
|
|
149
|
+
* This function is passed an [`ApolloError`](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/errors/index.ts#L36-L39) object that contains either a `networkError` object or a `graphQLErrors` array, depending on the error(s) that occurred, as well as any options passed the mutation.
|
|
150
|
+
*
|
|
151
|
+
* @docGroup
|
|
152
|
+
*
|
|
153
|
+
* 1. Operation options
|
|
154
|
+
*/
|
|
155
|
+
onError?: (error: ErrorLike, clientOptions?: Options<TData, TVariables, TCache>) => void;
|
|
156
|
+
}
|
|
157
|
+
interface Result<TData = unknown> {
|
|
158
|
+
/**
|
|
159
|
+
* The data returned from your mutation. Can be `undefined` if `ignoreResults` is `true`.
|
|
160
|
+
*/
|
|
161
|
+
data: MaybeMasked<TData> | null | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* If the mutation produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
|
|
164
|
+
*
|
|
165
|
+
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
166
|
+
*/
|
|
167
|
+
error: ErrorLike | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* If `true`, the mutation is currently in flight.
|
|
170
|
+
*/
|
|
171
|
+
loading: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* If `true`, the mutation's mutate function has been called.
|
|
174
|
+
*/
|
|
175
|
+
called: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* The instance of Apollo Client that executed the mutation.
|
|
178
|
+
*
|
|
179
|
+
* Can be useful for manually executing followup operations or writing data to the cache.
|
|
180
|
+
*/
|
|
181
|
+
client: ApolloClient;
|
|
182
|
+
/**
|
|
183
|
+
* A function that you can call to reset the mutation's result to its initial, uncalled state.
|
|
184
|
+
*/
|
|
185
|
+
reset: () => void;
|
|
186
|
+
}
|
|
187
|
+
type ResultTuple<TData, TVariables extends OperationVariables, TCache extends ApolloCache = ApolloCache> = [
|
|
188
|
+
mutate: MutationFunction<TData, TVariables, TCache>,
|
|
189
|
+
result: Result<TData>
|
|
190
|
+
];
|
|
191
|
+
type MutationFunction<TData, TVariables extends OperationVariables, TCache extends ApolloCache = ApolloCache> = (...[options]: {} extends TVariables ? [
|
|
192
|
+
options?: MutationFunctionOptions<TData, TVariables, TCache> & {
|
|
193
|
+
/**
|
|
194
|
+
* An object containing all of the GraphQL variables your mutation requires to execute.
|
|
195
|
+
*
|
|
196
|
+
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
197
|
+
*
|
|
198
|
+
* @docGroup
|
|
199
|
+
*
|
|
200
|
+
* 1. Operation options
|
|
201
|
+
*/
|
|
202
|
+
variables?: TVariables;
|
|
203
|
+
}
|
|
204
|
+
] : [
|
|
205
|
+
options: MutationFunctionOptions<TData, TVariables, TCache> & {
|
|
206
|
+
/**
|
|
207
|
+
* An object containing all of the GraphQL variables your mutation requires to execute.
|
|
208
|
+
*
|
|
209
|
+
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
210
|
+
*
|
|
211
|
+
* @docGroup
|
|
212
|
+
*
|
|
213
|
+
* 1. Operation options
|
|
214
|
+
*/
|
|
215
|
+
variables: TVariables;
|
|
216
|
+
}
|
|
217
|
+
]) => Promise<MutateResult<MaybeMasked<TData>>>;
|
|
218
|
+
type MutationFunctionOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache> = Options<TData, TVariables, TCache> & {
|
|
219
|
+
/**
|
|
220
|
+
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single mutation inside of it.
|
|
221
|
+
*
|
|
222
|
+
* @docGroup
|
|
223
|
+
*
|
|
224
|
+
* 1. Operation options
|
|
225
|
+
*/
|
|
226
|
+
mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
*
|
|
231
|
+
*
|
|
232
|
+
* > Refer to the [Mutations](https://www.apollographql.com/docs/react/data/mutations/) section for a more in-depth overview of `useMutation`.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```jsx
|
|
236
|
+
* import { gql, useMutation } from '@apollo/client';
|
|
237
|
+
*
|
|
238
|
+
* const ADD_TODO = gql`
|
|
239
|
+
* mutation AddTodo($type: String!) {
|
|
240
|
+
* addTodo(type: $type) {
|
|
241
|
+
* id
|
|
242
|
+
* type
|
|
243
|
+
* }
|
|
244
|
+
* }
|
|
245
|
+
* `;
|
|
246
|
+
*
|
|
247
|
+
* function AddTodo() {
|
|
248
|
+
* let input;
|
|
249
|
+
* const [addTodo, { data }] = useMutation(ADD_TODO);
|
|
250
|
+
*
|
|
251
|
+
* return (
|
|
252
|
+
* <div>
|
|
253
|
+
* <form
|
|
254
|
+
* onSubmit={e => {
|
|
255
|
+
* e.preventDefault();
|
|
256
|
+
* addTodo({ variables: { type: input.value } });
|
|
257
|
+
* input.value = '';
|
|
258
|
+
* }}
|
|
259
|
+
* >
|
|
260
|
+
* <input
|
|
261
|
+
* ref={node => {
|
|
262
|
+
* input = node;
|
|
263
|
+
* }}
|
|
264
|
+
* />
|
|
265
|
+
* <button type="submit">Add Todo</button>
|
|
266
|
+
* </form>
|
|
267
|
+
* </div>
|
|
268
|
+
* );
|
|
269
|
+
* }
|
|
270
|
+
* ```
|
|
271
|
+
* @since 3.0.0
|
|
272
|
+
* @param mutation - A GraphQL mutation document parsed into an AST by `gql`.
|
|
273
|
+
* @param options - Options to control how the mutation is executed.
|
|
274
|
+
* @returns A tuple in the form of `[mutate, result]`
|
|
275
|
+
*/
|
|
276
|
+
export declare function useMutation<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache, TConfiguredVariables extends Partial<TVariables> = {}>(mutation: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: useMutation.Options<NoInfer<TData>, NoInfer<TVariables>, TCache, {
|
|
277
|
+
[K in keyof TConfiguredVariables]: K extends keyof TVariables ? TConfiguredVariables[K] : never;
|
|
278
|
+
}>): useMutation.ResultTuple<TData, MakeRequiredVariablesOptional<TVariables, TConfiguredVariables>, TCache>;
|
|
279
|
+
export {};
|
|
280
|
+
//# sourceMappingURL=useMutation.d.ts.map
|