@apollo/client 0.0.0-pr-10521-20230206180228
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/LICENSE +22 -0
- package/README.md +45 -0
- package/apollo-client.cjs +7614 -0
- package/apollo-client.cjs.map +1 -0
- package/apollo-client.min.cjs +1 -0
- package/cache/cache.cjs +2425 -0
- package/cache/cache.cjs.map +1 -0
- package/cache/cache.cjs.native.js +2425 -0
- package/cache/core/cache.d.ts +32 -0
- package/cache/core/cache.d.ts.map +1 -0
- package/cache/core/cache.js +84 -0
- package/cache/core/cache.js.map +1 -0
- package/cache/core/types/Cache.d.ts +55 -0
- package/cache/core/types/Cache.d.ts.map +1 -0
- package/cache/core/types/Cache.js +4 -0
- package/cache/core/types/Cache.js.map +1 -0
- package/cache/core/types/DataProxy.d.ts +52 -0
- package/cache/core/types/DataProxy.d.ts.map +1 -0
- package/cache/core/types/DataProxy.js +2 -0
- package/cache/core/types/DataProxy.js.map +1 -0
- package/cache/core/types/common.d.ts +47 -0
- package/cache/core/types/common.d.ts.map +1 -0
- package/cache/core/types/common.js +26 -0
- package/cache/core/types/common.js.map +1 -0
- package/cache/index.d.ts +15 -0
- package/cache/index.d.ts.map +1 -0
- package/cache/index.js +14 -0
- package/cache/index.js.map +1 -0
- package/cache/inmemory/__mocks__/optimism.d.ts +2 -0
- package/cache/inmemory/__mocks__/optimism.d.ts.map +1 -0
- package/cache/inmemory/__mocks__/optimism.js +14 -0
- package/cache/inmemory/__mocks__/optimism.js.map +1 -0
- package/cache/inmemory/entityStore.d.ts +83 -0
- package/cache/inmemory/entityStore.d.ts.map +1 -0
- package/cache/inmemory/entityStore.js +467 -0
- package/cache/inmemory/entityStore.js.map +1 -0
- package/cache/inmemory/fixPolyfills.d.ts +1 -0
- package/cache/inmemory/fixPolyfills.d.ts.map +1 -0
- package/cache/inmemory/fixPolyfills.js +1 -0
- package/cache/inmemory/fixPolyfills.js.map +1 -0
- package/cache/inmemory/fixPolyfills.native.d.ts +2 -0
- package/cache/inmemory/fixPolyfills.native.d.ts.map +1 -0
- package/cache/inmemory/fixPolyfills.native.js +48 -0
- package/cache/inmemory/fixPolyfills.native.js.map +1 -0
- package/cache/inmemory/fragmentRegistry.d.ts +8 -0
- package/cache/inmemory/fragmentRegistry.d.ts.map +1 -0
- package/cache/inmemory/fragmentRegistry.js +113 -0
- package/cache/inmemory/fragmentRegistry.js.map +1 -0
- package/cache/inmemory/helpers.d.ts +27 -0
- package/cache/inmemory/helpers.d.ts.map +1 -0
- package/cache/inmemory/helpers.js +85 -0
- package/cache/inmemory/helpers.js.map +1 -0
- package/cache/inmemory/inMemoryCache.d.ts +52 -0
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -0
- package/cache/inmemory/inMemoryCache.js +316 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -0
- package/cache/inmemory/key-extractor.d.ts +9 -0
- package/cache/inmemory/key-extractor.d.ts.map +1 -0
- package/cache/inmemory/key-extractor.js +118 -0
- package/cache/inmemory/key-extractor.js.map +1 -0
- package/cache/inmemory/object-canon.d.ts +17 -0
- package/cache/inmemory/object-canon.d.ts.map +1 -0
- package/cache/inmemory/object-canon.js +120 -0
- package/cache/inmemory/object-canon.js.map +1 -0
- package/cache/inmemory/policies.d.ts +96 -0
- package/cache/inmemory/policies.d.ts.map +1 -0
- package/cache/inmemory/policies.js +416 -0
- package/cache/inmemory/policies.js.map +1 -0
- package/cache/inmemory/reactiveVars.d.ts +18 -0
- package/cache/inmemory/reactiveVars.d.ts.map +1 -0
- package/cache/inmemory/reactiveVars.js +65 -0
- package/cache/inmemory/reactiveVars.js.map +1 -0
- package/cache/inmemory/readFromStore.d.ts +36 -0
- package/cache/inmemory/readFromStore.d.ts.map +1 -0
- package/cache/inmemory/readFromStore.js +267 -0
- package/cache/inmemory/readFromStore.js.map +1 -0
- package/cache/inmemory/types.d.ts +81 -0
- package/cache/inmemory/types.d.ts.map +1 -0
- package/cache/inmemory/types.js +4 -0
- package/cache/inmemory/types.js.map +1 -0
- package/cache/inmemory/writeToStore.d.ts +37 -0
- package/cache/inmemory/writeToStore.d.ts.map +1 -0
- package/cache/inmemory/writeToStore.js +394 -0
- package/cache/inmemory/writeToStore.js.map +1 -0
- package/cache/package.json +8 -0
- package/config/jest/setup.d.ts +2 -0
- package/config/jest/setup.d.ts.map +1 -0
- package/config/jest/setup.js +5 -0
- package/config/jest/setup.js.map +1 -0
- package/core/ApolloClient.d.ts +76 -0
- package/core/ApolloClient.d.ts.map +1 -0
- package/core/ApolloClient.js +240 -0
- package/core/ApolloClient.js.map +1 -0
- package/core/LocalState.d.ts +69 -0
- package/core/LocalState.d.ts.map +1 -0
- package/core/LocalState.js +321 -0
- package/core/LocalState.js.map +1 -0
- package/core/ObservableQuery.d.ts +74 -0
- package/core/ObservableQuery.d.ts.map +1 -0
- package/core/ObservableQuery.js +507 -0
- package/core/ObservableQuery.js.map +1 -0
- package/core/QueryInfo.d.ts +62 -0
- package/core/QueryInfo.d.ts.map +1 -0
- package/core/QueryInfo.js +287 -0
- package/core/QueryInfo.js.map +1 -0
- package/core/QueryManager.d.ts +120 -0
- package/core/QueryManager.d.ts.map +1 -0
- package/core/QueryManager.js +890 -0
- package/core/QueryManager.js.map +1 -0
- package/core/core.cjs +2349 -0
- package/core/core.cjs.map +1 -0
- package/core/core.cjs.native.js +2349 -0
- package/core/index.d.ts +17 -0
- package/core/index.d.ts.map +1 -0
- package/core/index.js +17 -0
- package/core/index.js.map +1 -0
- package/core/networkStatus.d.ts +11 -0
- package/core/networkStatus.d.ts.map +1 -0
- package/core/networkStatus.js +14 -0
- package/core/networkStatus.js.map +1 -0
- package/core/package.json +8 -0
- package/core/types.d.ts +74 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +3 -0
- package/core/types.js.map +1 -0
- package/core/watchQueryOptions.d.ts +78 -0
- package/core/watchQueryOptions.d.ts.map +1 -0
- package/core/watchQueryOptions.js +2 -0
- package/core/watchQueryOptions.js.map +1 -0
- package/errors/errors.cjs +49 -0
- package/errors/errors.cjs.map +1 -0
- package/errors/errors.cjs.native.js +49 -0
- package/errors/index.d.ts +23 -0
- package/errors/index.d.ts.map +1 -0
- package/errors/index.js +42 -0
- package/errors/index.js.map +1 -0
- package/errors/package.json +8 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +3 -0
- package/index.js.map +1 -0
- package/invariantErrorCodes.js +339 -0
- package/link/batch/batch.cjs +159 -0
- package/link/batch/batch.cjs.map +1 -0
- package/link/batch/batch.cjs.native.js +159 -0
- package/link/batch/batchLink.d.ts +19 -0
- package/link/batch/batchLink.d.ts.map +1 -0
- package/link/batch/batchLink.js +31 -0
- package/link/batch/batchLink.js.map +1 -0
- package/link/batch/batching.d.ts +27 -0
- package/link/batch/batching.d.ts.map +1 -0
- package/link/batch/batching.js +125 -0
- package/link/batch/batching.js.map +1 -0
- package/link/batch/index.d.ts +2 -0
- package/link/batch/index.d.ts.map +1 -0
- package/link/batch/index.js +2 -0
- package/link/batch/index.js.map +1 -0
- package/link/batch/package.json +8 -0
- package/link/batch-http/batch-http.cjs +137 -0
- package/link/batch-http/batch-http.cjs.map +1 -0
- package/link/batch-http/batch-http.cjs.native.js +137 -0
- package/link/batch-http/batchHttpLink.d.ts +16 -0
- package/link/batch-http/batchHttpLink.d.ts.map +1 -0
- package/link/batch-http/batchHttpLink.js +131 -0
- package/link/batch-http/batchHttpLink.js.map +1 -0
- package/link/batch-http/index.d.ts +2 -0
- package/link/batch-http/index.d.ts.map +1 -0
- package/link/batch-http/index.js +2 -0
- package/link/batch-http/index.js.map +1 -0
- package/link/batch-http/package.json +8 -0
- package/link/context/context.cjs +38 -0
- package/link/context/context.cjs.map +1 -0
- package/link/context/context.cjs.native.js +38 -0
- package/link/context/index.d.ts +5 -0
- package/link/context/index.d.ts.map +1 -0
- package/link/context/index.js +31 -0
- package/link/context/index.js.map +1 -0
- package/link/context/package.json +8 -0
- package/link/core/ApolloLink.d.ts +16 -0
- package/link/core/ApolloLink.d.ts.map +1 -0
- package/link/core/ApolloLink.js +100 -0
- package/link/core/ApolloLink.js.map +1 -0
- package/link/core/concat.d.ts +3 -0
- package/link/core/concat.d.ts.map +1 -0
- package/link/core/concat.js +3 -0
- package/link/core/concat.js.map +1 -0
- package/link/core/core.cjs +121 -0
- package/link/core/core.cjs.map +1 -0
- package/link/core/core.cjs.native.js +121 -0
- package/link/core/empty.d.ts +3 -0
- package/link/core/empty.d.ts.map +1 -0
- package/link/core/empty.js +3 -0
- package/link/core/empty.js.map +1 -0
- package/link/core/execute.d.ts +3 -0
- package/link/core/execute.d.ts.map +1 -0
- package/link/core/execute.js +3 -0
- package/link/core/execute.js.map +1 -0
- package/link/core/from.d.ts +3 -0
- package/link/core/from.d.ts.map +1 -0
- package/link/core/from.js +3 -0
- package/link/core/from.js.map +1 -0
- package/link/core/index.d.ts +9 -0
- package/link/core/index.d.ts.map +1 -0
- package/link/core/index.js +9 -0
- package/link/core/index.js.map +1 -0
- package/link/core/package.json +8 -0
- package/link/core/split.d.ts +3 -0
- package/link/core/split.d.ts.map +1 -0
- package/link/core/split.js +3 -0
- package/link/core/split.js.map +1 -0
- package/link/core/types.d.ts +52 -0
- package/link/core/types.d.ts.map +1 -0
- package/link/core/types.js +2 -0
- package/link/core/types.js.map +1 -0
- package/link/error/error.cjs +90 -0
- package/link/error/error.cjs.map +1 -0
- package/link/error/error.cjs.native.js +90 -0
- package/link/error/index.d.ts +24 -0
- package/link/error/index.d.ts.map +1 -0
- package/link/error/index.js +83 -0
- package/link/error/index.js.map +1 -0
- package/link/error/package.json +8 -0
- package/link/http/HttpLink.d.ts +8 -0
- package/link/http/HttpLink.d.ts.map +1 -0
- package/link/http/HttpLink.js +15 -0
- package/link/http/HttpLink.js.map +1 -0
- package/link/http/checkFetcher.d.ts +2 -0
- package/link/http/checkFetcher.d.ts.map +1 -0
- package/link/http/checkFetcher.js +7 -0
- package/link/http/checkFetcher.js.map +1 -0
- package/link/http/createHttpLink.d.ts +4 -0
- package/link/http/createHttpLink.d.ts.map +1 -0
- package/link/http/createHttpLink.js +127 -0
- package/link/http/createHttpLink.js.map +1 -0
- package/link/http/createSignalIfSupported.d.ts +8 -0
- package/link/http/createSignalIfSupported.d.ts.map +1 -0
- package/link/http/createSignalIfSupported.js +8 -0
- package/link/http/createSignalIfSupported.js.map +1 -0
- package/link/http/http.cjs +593 -0
- package/link/http/http.cjs.map +1 -0
- package/link/http/http.cjs.native.js +593 -0
- package/link/http/index.d.ts +11 -0
- package/link/http/index.d.ts.map +1 -0
- package/link/http/index.js +11 -0
- package/link/http/index.js.map +1 -0
- package/link/http/iterators/async.d.ts +2 -0
- package/link/http/iterators/async.d.ts.map +1 -0
- package/link/http/iterators/async.js +14 -0
- package/link/http/iterators/async.js.map +1 -0
- package/link/http/iterators/nodeStream.d.ts +4 -0
- package/link/http/iterators/nodeStream.d.ts.map +1 -0
- package/link/http/iterators/nodeStream.js +71 -0
- package/link/http/iterators/nodeStream.js.map +1 -0
- package/link/http/iterators/promise.d.ts +2 -0
- package/link/http/iterators/promise.d.ts.map +1 -0
- package/link/http/iterators/promise.js +28 -0
- package/link/http/iterators/promise.js.map +1 -0
- package/link/http/iterators/reader.d.ts +2 -0
- package/link/http/iterators/reader.d.ts.map +1 -0
- package/link/http/iterators/reader.js +15 -0
- package/link/http/iterators/reader.js.map +1 -0
- package/link/http/package.json +8 -0
- package/link/http/parseAndCheckHttpResponse.d.ts +14 -0
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -0
- package/link/http/parseAndCheckHttpResponse.js +148 -0
- package/link/http/parseAndCheckHttpResponse.js.map +1 -0
- package/link/http/responseIterator.d.ts +3 -0
- package/link/http/responseIterator.d.ts.map +1 -0
- package/link/http/responseIterator.js +23 -0
- package/link/http/responseIterator.js.map +1 -0
- package/link/http/rewriteURIForGET.d.ts +9 -0
- package/link/http/rewriteURIForGET.d.ts.map +1 -0
- package/link/http/rewriteURIForGET.js +43 -0
- package/link/http/rewriteURIForGET.js.map +1 -0
- package/link/http/selectHttpOptionsAndBody.d.ts +57 -0
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -0
- package/link/http/selectHttpOptionsAndBody.js +78 -0
- package/link/http/selectHttpOptionsAndBody.js.map +1 -0
- package/link/http/selectURI.d.ts +3 -0
- package/link/http/selectURI.d.ts.map +1 -0
- package/link/http/selectURI.js +14 -0
- package/link/http/selectURI.js.map +1 -0
- package/link/http/serializeFetchParameter.d.ts +6 -0
- package/link/http/serializeFetchParameter.d.ts.map +1 -0
- package/link/http/serializeFetchParameter.js +14 -0
- package/link/http/serializeFetchParameter.js.map +1 -0
- package/link/persisted-queries/index.d.ts +31 -0
- package/link/persisted-queries/index.d.ts.map +1 -0
- package/link/persisted-queries/index.js +170 -0
- package/link/persisted-queries/index.js.map +1 -0
- package/link/persisted-queries/package.json +8 -0
- package/link/persisted-queries/persisted-queries.cjs +174 -0
- package/link/persisted-queries/persisted-queries.cjs.map +1 -0
- package/link/persisted-queries/persisted-queries.cjs.native.js +174 -0
- package/link/retry/delayFunction.d.ts +11 -0
- package/link/retry/delayFunction.d.ts.map +1 -0
- package/link/retry/delayFunction.js +12 -0
- package/link/retry/delayFunction.js.map +1 -0
- package/link/retry/index.d.ts +2 -0
- package/link/retry/index.d.ts.map +1 -0
- package/link/retry/index.js +2 -0
- package/link/retry/index.js.map +1 -0
- package/link/retry/package.json +8 -0
- package/link/retry/retry.cjs +170 -0
- package/link/retry/retry.cjs.map +1 -0
- package/link/retry/retry.cjs.native.js +170 -0
- package/link/retry/retryFunction.d.ts +10 -0
- package/link/retry/retryFunction.d.ts.map +1 -0
- package/link/retry/retryFunction.js +9 -0
- package/link/retry/retryFunction.js.map +1 -0
- package/link/retry/retryLink.d.ts +17 -0
- package/link/retry/retryLink.d.ts.map +1 -0
- package/link/retry/retryLink.js +145 -0
- package/link/retry/retryLink.js.map +1 -0
- package/link/schema/index.d.ts +22 -0
- package/link/schema/index.d.ts.map +1 -0
- package/link/schema/index.js +50 -0
- package/link/schema/index.js.map +1 -0
- package/link/schema/package.json +8 -0
- package/link/schema/schema.cjs +56 -0
- package/link/schema/schema.cjs.map +1 -0
- package/link/schema/schema.cjs.native.js +56 -0
- package/link/subscriptions/index.d.ts +9 -0
- package/link/subscriptions/index.d.ts.map +1 -0
- package/link/subscriptions/index.js +39 -0
- package/link/subscriptions/index.js.map +1 -0
- package/link/subscriptions/package.json +8 -0
- package/link/subscriptions/subscriptions.cjs +45 -0
- package/link/subscriptions/subscriptions.cjs.map +1 -0
- package/link/subscriptions/subscriptions.cjs.native.js +45 -0
- package/link/utils/createOperation.d.ts +3 -0
- package/link/utils/createOperation.d.ts.map +1 -0
- package/link/utils/createOperation.js +23 -0
- package/link/utils/createOperation.js.map +1 -0
- package/link/utils/fromError.d.ts +3 -0
- package/link/utils/fromError.d.ts.map +1 -0
- package/link/utils/fromError.js +7 -0
- package/link/utils/fromError.js.map +1 -0
- package/link/utils/fromPromise.d.ts +3 -0
- package/link/utils/fromPromise.d.ts.map +1 -0
- package/link/utils/fromPromise.js +12 -0
- package/link/utils/fromPromise.js.map +1 -0
- package/link/utils/index.d.ts +9 -0
- package/link/utils/index.d.ts.map +1 -0
- package/link/utils/index.js +9 -0
- package/link/utils/index.js.map +1 -0
- package/link/utils/package.json +8 -0
- package/link/utils/throwServerError.d.ts +7 -0
- package/link/utils/throwServerError.d.ts.map +1 -0
- package/link/utils/throwServerError.js +9 -0
- package/link/utils/throwServerError.js.map +1 -0
- package/link/utils/toPromise.d.ts +3 -0
- package/link/utils/toPromise.d.ts.map +1 -0
- package/link/utils/toPromise.js +19 -0
- package/link/utils/toPromise.js.map +1 -0
- package/link/utils/transformOperation.d.ts +3 -0
- package/link/utils/transformOperation.d.ts.map +1 -0
- package/link/utils/transformOperation.js +17 -0
- package/link/utils/transformOperation.js.map +1 -0
- package/link/utils/utils.cjs +115 -0
- package/link/utils/utils.cjs.map +1 -0
- package/link/utils/utils.cjs.native.js +115 -0
- package/link/utils/validateOperation.d.ts +3 -0
- package/link/utils/validateOperation.d.ts.map +1 -0
- package/link/utils/validateOperation.js +18 -0
- package/link/utils/validateOperation.js.map +1 -0
- package/link/ws/index.d.ts +17 -0
- package/link/ws/index.d.ts.map +1 -0
- package/link/ws/index.js +22 -0
- package/link/ws/index.js.map +1 -0
- package/link/ws/package.json +8 -0
- package/link/ws/ws.cjs +28 -0
- package/link/ws/ws.cjs.map +1 -0
- package/link/ws/ws.cjs.native.js +28 -0
- package/main.cjs +16 -0
- package/main.cjs.map +1 -0
- package/main.cjs.native.js +16 -0
- package/package.json +141 -0
- package/react/cache/SuspenseCache.d.ts +18 -0
- package/react/cache/SuspenseCache.d.ts.map +1 -0
- package/react/cache/SuspenseCache.js +49 -0
- package/react/cache/SuspenseCache.js.map +1 -0
- package/react/cache/index.d.ts +2 -0
- package/react/cache/index.d.ts.map +1 -0
- package/react/cache/index.js +2 -0
- package/react/cache/index.js.map +1 -0
- package/react/components/Mutation.d.ts +12 -0
- package/react/components/Mutation.d.ts.map +1 -0
- package/react/components/Mutation.js +22 -0
- package/react/components/Mutation.js.map +1 -0
- package/react/components/Query.d.ts +12 -0
- package/react/components/Query.d.ts.map +1 -0
- package/react/components/Query.js +23 -0
- package/react/components/Query.js.map +1 -0
- package/react/components/Subscription.d.ts +12 -0
- package/react/components/Subscription.d.ts.map +1 -0
- package/react/components/Subscription.js +17 -0
- package/react/components/Subscription.js.map +1 -0
- package/react/components/components.cjs +81 -0
- package/react/components/components.cjs.map +1 -0
- package/react/components/components.cjs.native.js +81 -0
- package/react/components/index.d.ts +5 -0
- package/react/components/index.d.ts.map +1 -0
- package/react/components/index.js +5 -0
- package/react/components/index.js.map +1 -0
- package/react/components/package.json +8 -0
- package/react/components/types.d.ts +18 -0
- package/react/components/types.d.ts.map +1 -0
- package/react/components/types.js +2 -0
- package/react/components/types.js.map +1 -0
- package/react/context/ApolloConsumer.d.ts +7 -0
- package/react/context/ApolloConsumer.d.ts.map +1 -0
- package/react/context/ApolloConsumer.js +12 -0
- package/react/context/ApolloConsumer.js.map +1 -0
- package/react/context/ApolloContext.d.ts +12 -0
- package/react/context/ApolloContext.d.ts.map +1 -0
- package/react/context/ApolloContext.js +20 -0
- package/react/context/ApolloContext.js.map +1 -0
- package/react/context/ApolloProvider.d.ts +10 -0
- package/react/context/ApolloProvider.d.ts.map +1 -0
- package/react/context/ApolloProvider.js +20 -0
- package/react/context/ApolloProvider.js.map +1 -0
- package/react/context/context.cjs +70 -0
- package/react/context/context.cjs.map +1 -0
- package/react/context/context.cjs.native.js +70 -0
- package/react/context/index.d.ts +5 -0
- package/react/context/index.d.ts.map +1 -0
- package/react/context/index.js +5 -0
- package/react/context/index.js.map +1 -0
- package/react/context/package.json +8 -0
- package/react/hoc/graphql.d.ts +6 -0
- package/react/hoc/graphql.d.ts.map +1 -0
- package/react/hoc/graphql.js +17 -0
- package/react/hoc/graphql.js.map +1 -0
- package/react/hoc/hoc-utils.d.ts +17 -0
- package/react/hoc/hoc-utils.d.ts.map +1 -0
- package/react/hoc/hoc-utils.js +47 -0
- package/react/hoc/hoc-utils.js.map +1 -0
- package/react/hoc/hoc.cjs +325 -0
- package/react/hoc/hoc.cjs.map +1 -0
- package/react/hoc/hoc.cjs.native.js +325 -0
- package/react/hoc/index.d.ts +8 -0
- package/react/hoc/index.d.ts.map +1 -0
- package/react/hoc/index.js +8 -0
- package/react/hoc/index.js.map +1 -0
- package/react/hoc/mutation-hoc.d.ts +7 -0
- package/react/hoc/mutation-hoc.d.ts.map +1 -0
- package/react/hoc/mutation-hoc.js +63 -0
- package/react/hoc/mutation-hoc.js.map +1 -0
- package/react/hoc/package.json +8 -0
- package/react/hoc/query-hoc.d.ts +5 -0
- package/react/hoc/query-hoc.d.ts.map +1 -0
- package/react/hoc/query-hoc.js +70 -0
- package/react/hoc/query-hoc.js.map +1 -0
- package/react/hoc/subscription-hoc.d.ts +5 -0
- package/react/hoc/subscription-hoc.d.ts.map +1 -0
- package/react/hoc/subscription-hoc.js +80 -0
- package/react/hoc/subscription-hoc.js.map +1 -0
- package/react/hoc/types.d.ts +43 -0
- package/react/hoc/types.d.ts.map +1 -0
- package/react/hoc/types.js +2 -0
- package/react/hoc/types.js.map +1 -0
- package/react/hoc/withApollo.d.ts +4 -0
- package/react/hoc/withApollo.d.ts.map +1 -0
- package/react/hoc/withApollo.js +45 -0
- package/react/hoc/withApollo.js.map +1 -0
- package/react/hooks/compareResults.d.ts +3 -0
- package/react/hooks/compareResults.d.ts.map +1 -0
- package/react/hooks/compareResults.js +63 -0
- package/react/hooks/compareResults.js.map +1 -0
- package/react/hooks/hooks.cjs +913 -0
- package/react/hooks/hooks.cjs.map +1 -0
- package/react/hooks/hooks.cjs.native.js +913 -0
- package/react/hooks/index.d.ts +10 -0
- package/react/hooks/index.d.ts.map +1 -0
- package/react/hooks/index.js +10 -0
- package/react/hooks/index.js.map +1 -0
- package/react/hooks/internal/index.d.ts +3 -0
- package/react/hooks/internal/index.d.ts.map +1 -0
- package/react/hooks/internal/index.js +3 -0
- package/react/hooks/internal/index.js.map +1 -0
- package/react/hooks/internal/useDeepMemo.d.ts +3 -0
- package/react/hooks/internal/useDeepMemo.d.ts.map +1 -0
- package/react/hooks/internal/useDeepMemo.js +10 -0
- package/react/hooks/internal/useDeepMemo.js.map +1 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +3 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -0
- package/react/hooks/package.json +8 -0
- package/react/hooks/useApolloClient.d.ts +3 -0
- package/react/hooks/useApolloClient.d.ts.map +1 -0
- package/react/hooks/useApolloClient.js +12 -0
- package/react/hooks/useApolloClient.js.map +1 -0
- package/react/hooks/useFragment.d.ts +13 -0
- package/react/hooks/useFragment.d.ts.map +1 -0
- package/react/hooks/useFragment.js +39 -0
- package/react/hooks/useFragment.js.map +1 -0
- package/react/hooks/useLazyQuery.d.ts +6 -0
- package/react/hooks/useLazyQuery.d.ts.map +1 -0
- package/react/hooks/useLazyQuery.js +71 -0
- package/react/hooks/useLazyQuery.js.map +1 -0
- package/react/hooks/useMutation.d.ts +6 -0
- package/react/hooks/useMutation.d.ts.map +1 -0
- package/react/hooks/useMutation.js +100 -0
- package/react/hooks/useMutation.js.map +1 -0
- package/react/hooks/useQuery.d.ts +41 -0
- package/react/hooks/useQuery.d.ts.map +1 -0
- package/react/hooks/useQuery.js +302 -0
- package/react/hooks/useQuery.js.map +1 -0
- package/react/hooks/useReactiveVar.d.ts +3 -0
- package/react/hooks/useReactiveVar.d.ts.map +1 -0
- package/react/hooks/useReactiveVar.js +16 -0
- package/react/hooks/useReactiveVar.js.map +1 -0
- package/react/hooks/useSubscription.d.ts +6 -0
- package/react/hooks/useSubscription.d.ts.map +1 -0
- package/react/hooks/useSubscription.js +141 -0
- package/react/hooks/useSubscription.js.map +1 -0
- package/react/hooks/useSuspenseCache.d.ts +2 -0
- package/react/hooks/useSuspenseCache.d.ts.map +1 -0
- package/react/hooks/useSuspenseCache.js +10 -0
- package/react/hooks/useSuspenseCache.js.map +1 -0
- package/react/hooks/useSuspenseQuery.d.ts +12 -0
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -0
- package/react/hooks/useSuspenseQuery.js +181 -0
- package/react/hooks/useSuspenseQuery.js.map +1 -0
- package/react/hooks/useSyncExternalStore.d.ts +4 -0
- package/react/hooks/useSyncExternalStore.d.ts.map +1 -0
- package/react/hooks/useSyncExternalStore.js +48 -0
- package/react/hooks/useSyncExternalStore.js.map +1 -0
- package/react/index.d.ts +7 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +7 -0
- package/react/index.js.map +1 -0
- package/react/package.json +8 -0
- package/react/parser/index.d.ts +15 -0
- package/react/parser/index.d.ts.map +1 -0
- package/react/parser/index.js +94 -0
- package/react/parser/index.js.map +1 -0
- package/react/parser/package.json +8 -0
- package/react/parser/parser.cjs +103 -0
- package/react/parser/parser.cjs.map +1 -0
- package/react/parser/parser.cjs.native.js +103 -0
- package/react/react.cjs +69 -0
- package/react/react.cjs.map +1 -0
- package/react/react.cjs.native.js +69 -0
- package/react/ssr/RenderPromises.d.ts +22 -0
- package/react/ssr/RenderPromises.d.ts.map +1 -0
- package/react/ssr/RenderPromises.js +90 -0
- package/react/ssr/RenderPromises.js.map +1 -0
- package/react/ssr/getDataFromTree.d.ts +13 -0
- package/react/ssr/getDataFromTree.d.ts.map +1 -0
- package/react/ssr/getDataFromTree.js +32 -0
- package/react/ssr/getDataFromTree.js.map +1 -0
- package/react/ssr/index.d.ts +4 -0
- package/react/ssr/index.d.ts.map +1 -0
- package/react/ssr/index.js +4 -0
- package/react/ssr/index.js.map +1 -0
- package/react/ssr/package.json +8 -0
- package/react/ssr/renderToStringWithData.d.ts +3 -0
- package/react/ssr/renderToStringWithData.d.ts.map +1 -0
- package/react/ssr/renderToStringWithData.js +9 -0
- package/react/ssr/renderToStringWithData.js.map +1 -0
- package/react/ssr/ssr.cjs +151 -0
- package/react/ssr/ssr.cjs.map +1 -0
- package/react/ssr/ssr.cjs.native.js +151 -0
- package/react/types/types.d.ts +130 -0
- package/react/types/types.d.ts.map +1 -0
- package/react/types/types.js +2 -0
- package/react/types/types.js.map +1 -0
- package/testing/core/core.cjs +315 -0
- package/testing/core/core.cjs.map +1 -0
- package/testing/core/core.cjs.native.js +315 -0
- package/testing/core/index.d.ts +8 -0
- package/testing/core/index.d.ts.map +1 -0
- package/testing/core/index.js +8 -0
- package/testing/core/index.js.map +1 -0
- package/testing/core/itAsync.d.ts +6 -0
- package/testing/core/itAsync.d.ts.map +1 -0
- package/testing/core/itAsync.js +19 -0
- package/testing/core/itAsync.js.map +1 -0
- package/testing/core/mocking/mockClient.d.ts +5 -0
- package/testing/core/mocking/mockClient.d.ts.map +1 -0
- package/testing/core/mocking/mockClient.js +14 -0
- package/testing/core/mocking/mockClient.js.map +1 -0
- package/testing/core/mocking/mockFetch.d.ts +24 -0
- package/testing/core/mocking/mockFetch.d.ts.map +1 -0
- package/testing/core/mocking/mockFetch.js +83 -0
- package/testing/core/mocking/mockFetch.js.map +1 -0
- package/testing/core/mocking/mockLink.d.ts +28 -0
- package/testing/core/mocking/mockLink.d.ts.map +1 -0
- package/testing/core/mocking/mockLink.js +139 -0
- package/testing/core/mocking/mockLink.js.map +1 -0
- package/testing/core/mocking/mockQueryManager.d.ts +5 -0
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -0
- package/testing/core/mocking/mockQueryManager.js +14 -0
- package/testing/core/mocking/mockQueryManager.js.map +1 -0
- package/testing/core/mocking/mockSubscriptionLink.d.ts +24 -0
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -0
- package/testing/core/mocking/mockSubscriptionLink.js +62 -0
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -0
- package/testing/core/mocking/mockWatchQuery.d.ts +5 -0
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -0
- package/testing/core/mocking/mockWatchQuery.js +15 -0
- package/testing/core/mocking/mockWatchQuery.js.map +1 -0
- package/testing/core/observableToPromise.d.ts +15 -0
- package/testing/core/observableToPromise.d.ts.map +1 -0
- package/testing/core/observableToPromise.js +65 -0
- package/testing/core/observableToPromise.js.map +1 -0
- package/testing/core/package.json +8 -0
- package/testing/core/subscribeAndCount.d.ts +3 -0
- package/testing/core/subscribeAndCount.d.ts.map +1 -0
- package/testing/core/subscribeAndCount.js +16 -0
- package/testing/core/subscribeAndCount.js.map +1 -0
- package/testing/core/wait.d.ts +3 -0
- package/testing/core/wait.d.ts.map +1 -0
- package/testing/core/wait.js +16 -0
- package/testing/core/wait.js.map +1 -0
- package/testing/core/withConsoleSpy.d.ts +4 -0
- package/testing/core/withConsoleSpy.d.ts.map +1 -0
- package/testing/core/withConsoleSpy.js +39 -0
- package/testing/core/withConsoleSpy.js.map +1 -0
- package/testing/core/wrap.d.ts +4 -0
- package/testing/core/wrap.d.ts.map +1 -0
- package/testing/core/wrap.js +26 -0
- package/testing/core/wrap.js.map +1 -0
- package/testing/index.d.ts +4 -0
- package/testing/index.d.ts.map +1 -0
- package/testing/index.js +4 -0
- package/testing/index.js.map +1 -0
- package/testing/package.json +8 -0
- package/testing/react/MockedProvider.d.ts +30 -0
- package/testing/react/MockedProvider.d.ts.map +1 -0
- package/testing/react/MockedProvider.js +39 -0
- package/testing/react/MockedProvider.js.map +1 -0
- package/testing/testing.cjs +109 -0
- package/testing/testing.cjs.map +1 -0
- package/testing/testing.cjs.native.js +109 -0
- package/utilities/common/arrays.d.ts +2 -0
- package/utilities/common/arrays.d.ts.map +1 -0
- package/utilities/common/arrays.js +4 -0
- package/utilities/common/arrays.js.map +1 -0
- package/utilities/common/canUse.d.ts +7 -0
- package/utilities/common/canUse.d.ts.map +1 -0
- package/utilities/common/canUse.js +11 -0
- package/utilities/common/canUse.js.map +1 -0
- package/utilities/common/cloneDeep.d.ts +2 -0
- package/utilities/common/cloneDeep.d.ts.map +1 -0
- package/utilities/common/cloneDeep.js +33 -0
- package/utilities/common/cloneDeep.js.map +1 -0
- package/utilities/common/compact.d.ts +3 -0
- package/utilities/common/compact.d.ts.map +1 -0
- package/utilities/common/compact.js +19 -0
- package/utilities/common/compact.js.map +1 -0
- package/utilities/common/errorHandling.d.ts +4 -0
- package/utilities/common/errorHandling.d.ts.map +1 -0
- package/utilities/common/errorHandling.js +21 -0
- package/utilities/common/errorHandling.js.map +1 -0
- package/utilities/common/filterInPlace.d.ts +2 -0
- package/utilities/common/filterInPlace.d.ts.map +1 -0
- package/utilities/common/filterInPlace.js +11 -0
- package/utilities/common/filterInPlace.js.map +1 -0
- package/utilities/common/incrementalResult.d.ts +6 -0
- package/utilities/common/incrementalResult.d.ts.map +1 -0
- package/utilities/common/incrementalResult.js +32 -0
- package/utilities/common/incrementalResult.js.map +1 -0
- package/utilities/common/makeUniqueId.d.ts +2 -0
- package/utilities/common/makeUniqueId.d.ts.map +1 -0
- package/utilities/common/makeUniqueId.js +7 -0
- package/utilities/common/makeUniqueId.js.map +1 -0
- package/utilities/common/maybeDeepFreeze.d.ts +2 -0
- package/utilities/common/maybeDeepFreeze.d.ts.map +1 -0
- package/utilities/common/maybeDeepFreeze.js +34 -0
- package/utilities/common/maybeDeepFreeze.js.map +1 -0
- package/utilities/common/mergeDeep.d.ts +14 -0
- package/utilities/common/mergeDeep.d.ts.map +1 -0
- package/utilities/common/mergeDeep.js +76 -0
- package/utilities/common/mergeDeep.js.map +1 -0
- package/utilities/common/mergeOptions.d.ts +5 -0
- package/utilities/common/mergeOptions.d.ts.map +1 -0
- package/utilities/common/mergeOptions.js +8 -0
- package/utilities/common/mergeOptions.js.map +1 -0
- package/utilities/common/objects.d.ts +2 -0
- package/utilities/common/objects.d.ts.map +1 -0
- package/utilities/common/objects.js +4 -0
- package/utilities/common/objects.js.map +1 -0
- package/utilities/common/responseIterator.d.ts +10 -0
- package/utilities/common/responseIterator.d.ts.map +1 -0
- package/utilities/common/responseIterator.js +21 -0
- package/utilities/common/responseIterator.js.map +1 -0
- package/utilities/common/stringifyForDisplay.d.ts +2 -0
- package/utilities/common/stringifyForDisplay.d.ts.map +1 -0
- package/utilities/common/stringifyForDisplay.js +8 -0
- package/utilities/common/stringifyForDisplay.js.map +1 -0
- package/utilities/globals/DEV.d.ts +3 -0
- package/utilities/globals/DEV.d.ts.map +1 -0
- package/utilities/globals/DEV.js +9 -0
- package/utilities/globals/DEV.js.map +1 -0
- package/utilities/globals/fix-graphql.d.ts +2 -0
- package/utilities/globals/fix-graphql.d.ts.map +1 -0
- package/utilities/globals/fix-graphql.js +6 -0
- package/utilities/globals/fix-graphql.js.map +1 -0
- package/utilities/globals/global.d.ts +5 -0
- package/utilities/globals/global.d.ts.map +1 -0
- package/utilities/globals/global.js +6 -0
- package/utilities/globals/global.js.map +1 -0
- package/utilities/globals/globals.cjs +42 -0
- package/utilities/globals/globals.cjs.map +1 -0
- package/utilities/globals/globals.cjs.native.js +42 -0
- package/utilities/globals/index.d.ts +8 -0
- package/utilities/globals/index.d.ts.map +1 -0
- package/utilities/globals/index.js +10 -0
- package/utilities/globals/index.js.map +1 -0
- package/utilities/globals/maybe.d.ts +2 -0
- package/utilities/globals/maybe.d.ts.map +1 -0
- package/utilities/globals/maybe.js +7 -0
- package/utilities/globals/maybe.js.map +1 -0
- package/utilities/globals/package.json +8 -0
- package/utilities/graphql/directives.d.ts +18 -0
- package/utilities/graphql/directives.d.ts.map +1 -0
- package/utilities/graphql/directives.js +72 -0
- package/utilities/graphql/directives.js.map +1 -0
- package/utilities/graphql/fragments.d.ts +9 -0
- package/utilities/graphql/fragments.d.ts.map +1 -0
- package/utilities/graphql/fragments.js +64 -0
- package/utilities/graphql/fragments.js.map +1 -0
- package/utilities/graphql/getFromAST.d.ts +10 -0
- package/utilities/graphql/getFromAST.d.ts.map +1 -0
- package/utilities/graphql/getFromAST.js +76 -0
- package/utilities/graphql/getFromAST.js.map +1 -0
- package/utilities/graphql/storeUtils.d.ts +32 -0
- package/utilities/graphql/storeUtils.d.ts.map +1 -0
- package/utilities/graphql/storeUtils.js +208 -0
- package/utilities/graphql/storeUtils.js.map +1 -0
- package/utilities/graphql/transform.d.ts +27 -0
- package/utilities/graphql/transform.d.ts.map +1 -0
- package/utilities/graphql/transform.js +281 -0
- package/utilities/graphql/transform.js.map +1 -0
- package/utilities/index.d.ts +27 -0
- package/utilities/index.d.ts.map +1 -0
- package/utilities/index.js +27 -0
- package/utilities/index.js.map +1 -0
- package/utilities/observables/Concast.d.ts +27 -0
- package/utilities/observables/Concast.d.ts.map +1 -0
- package/utilities/observables/Concast.js +137 -0
- package/utilities/observables/Concast.js.map +1 -0
- package/utilities/observables/Observable.d.ts +5 -0
- package/utilities/observables/Observable.d.ts.map +1 -0
- package/utilities/observables/Observable.js +9 -0
- package/utilities/observables/Observable.js.map +1 -0
- package/utilities/observables/asyncMap.d.ts +3 -0
- package/utilities/observables/asyncMap.d.ts.map +1 -0
- package/utilities/observables/asyncMap.js +49 -0
- package/utilities/observables/asyncMap.js.map +1 -0
- package/utilities/observables/iteration.d.ts +3 -0
- package/utilities/observables/iteration.d.ts.map +1 -0
- package/utilities/observables/iteration.js +6 -0
- package/utilities/observables/iteration.js.map +1 -0
- package/utilities/observables/subclassing.d.ts +3 -0
- package/utilities/observables/subclassing.d.ts.map +1 -0
- package/utilities/observables/subclassing.js +13 -0
- package/utilities/observables/subclassing.js.map +1 -0
- package/utilities/package.json +8 -0
- package/utilities/policies/pagination.d.ts +28 -0
- package/utilities/policies/pagination.d.ts.map +1 -0
- package/utilities/policies/pagination.js +151 -0
- package/utilities/policies/pagination.js.map +1 -0
- package/utilities/types/IsStrictlyAny.d.ts +5 -0
- package/utilities/types/IsStrictlyAny.d.ts.map +1 -0
- package/utilities/types/IsStrictlyAny.js +2 -0
- package/utilities/types/IsStrictlyAny.js.map +1 -0
- package/utilities/utilities.cjs +1371 -0
- package/utilities/utilities.cjs.map +1 -0
- package/utilities/utilities.cjs.native.js +1371 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +2 -0
- package/version.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apollo/client",
|
|
3
|
+
"version": "0.0.0-pr-10521-20230206180228",
|
|
4
|
+
"description": "A fully-featured caching GraphQL client.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"keywords": [
|
|
7
|
+
"apollo",
|
|
8
|
+
"graphql",
|
|
9
|
+
"react",
|
|
10
|
+
"hooks",
|
|
11
|
+
"client",
|
|
12
|
+
"cache"
|
|
13
|
+
],
|
|
14
|
+
"author": "packages@apollographql.com",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"main": "./main.cjs",
|
|
17
|
+
"module": "./index.js",
|
|
18
|
+
"types": "./index.d.ts",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"react-native": {
|
|
21
|
+
"./dist/cache/inmemory/fixPolyfills.js": "./cache/inmemory/fixPolyfills.native.js",
|
|
22
|
+
"react-dom/server": false
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/apollographql/apollo-client.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/apollographql/apollo-client/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://www.apollographql.com/docs/react/",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
34
|
+
"graphql-ws": "^5.5.5",
|
|
35
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
36
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
37
|
+
"subscriptions-transport-ws": "^0.9.0 || ^0.11.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"graphql-ws": {
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"react": {
|
|
44
|
+
"optional": true
|
|
45
|
+
},
|
|
46
|
+
"react-dom": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"subscriptions-transport-ws": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@graphql-typed-document-node/core": "^3.1.1",
|
|
55
|
+
"@wry/context": "^0.7.0",
|
|
56
|
+
"@wry/equality": "^0.5.0",
|
|
57
|
+
"@wry/trie": "^0.3.0",
|
|
58
|
+
"graphql-tag": "^2.12.6",
|
|
59
|
+
"hoist-non-react-statics": "^3.3.2",
|
|
60
|
+
"optimism": "^0.16.1",
|
|
61
|
+
"prop-types": "^15.7.2",
|
|
62
|
+
"response-iterator": "^0.2.6",
|
|
63
|
+
"symbol-observable": "^4.0.0",
|
|
64
|
+
"ts-invariant": "^0.10.3",
|
|
65
|
+
"tslib": "^2.3.0",
|
|
66
|
+
"zen-observable-ts": "^1.2.5"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@babel/parser": "7.20.13",
|
|
70
|
+
"@changesets/changelog-github": "0.4.8",
|
|
71
|
+
"@changesets/cli": "2.26.0",
|
|
72
|
+
"@graphql-tools/schema": "9.0.14",
|
|
73
|
+
"@rollup/plugin-node-resolve": "11.2.1",
|
|
74
|
+
"@testing-library/jest-dom": "5.16.5",
|
|
75
|
+
"@testing-library/react": "13.4.0",
|
|
76
|
+
"@testing-library/react-12": "npm:@testing-library/react@^12",
|
|
77
|
+
"@testing-library/user-event": "14.4.3",
|
|
78
|
+
"@types/bytes": "3.1.1",
|
|
79
|
+
"@types/fast-json-stable-stringify": "2.0.0",
|
|
80
|
+
"@types/fetch-mock": "7.3.5",
|
|
81
|
+
"@types/glob": "8.0.1",
|
|
82
|
+
"@types/hoist-non-react-statics": "3.3.1",
|
|
83
|
+
"@types/jest": "29.2.6",
|
|
84
|
+
"@types/lodash": "4.14.191",
|
|
85
|
+
"@types/node": "18.11.18",
|
|
86
|
+
"@types/node-fetch": "2.6.2",
|
|
87
|
+
"@types/react": "18.0.27",
|
|
88
|
+
"@types/react-dom": "18.0.10",
|
|
89
|
+
"@types/use-sync-external-store": "0.0.3",
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "5.49.0",
|
|
91
|
+
"@typescript-eslint/parser": "5.49.0",
|
|
92
|
+
"acorn": "8.8.2",
|
|
93
|
+
"blob-polyfill": "7.0.20220408",
|
|
94
|
+
"bytes": "3.1.2",
|
|
95
|
+
"cross-fetch": "3.1.5",
|
|
96
|
+
"eslint": "8.33.0",
|
|
97
|
+
"eslint-plugin-testing-library": "5.10.0",
|
|
98
|
+
"fetch-mock": "9.11.0",
|
|
99
|
+
"glob": "8.1.0",
|
|
100
|
+
"graphql": "16.6.0",
|
|
101
|
+
"graphql-ws": "5.11.2",
|
|
102
|
+
"jest": "29.3.1",
|
|
103
|
+
"jest-environment-jsdom": "29.3.1",
|
|
104
|
+
"jest-junit": "15.0.0",
|
|
105
|
+
"lodash": "4.17.21",
|
|
106
|
+
"patch-package": "6.5.1",
|
|
107
|
+
"prettier": "2.7.1",
|
|
108
|
+
"react": "18.2.0",
|
|
109
|
+
"react-17": "npm:react@^17",
|
|
110
|
+
"react-dom": "18.2.0",
|
|
111
|
+
"react-dom-17": "npm:react-dom@^17",
|
|
112
|
+
"react-error-boundary": "3.1.4",
|
|
113
|
+
"recast": "0.22.0",
|
|
114
|
+
"resolve": "1.22.1",
|
|
115
|
+
"rimraf": "4.1.2",
|
|
116
|
+
"rollup": "2.79.1",
|
|
117
|
+
"rollup-plugin-terser": "7.0.2",
|
|
118
|
+
"rxjs": "7.8.0",
|
|
119
|
+
"subscriptions-transport-ws": "0.11.0",
|
|
120
|
+
"terser": "5.16.1",
|
|
121
|
+
"ts-jest": "29.0.5",
|
|
122
|
+
"ts-node": "10.9.1",
|
|
123
|
+
"typedoc": "0.22.18",
|
|
124
|
+
"typescript": "4.9.4",
|
|
125
|
+
"wait-for-observables": "1.0.3",
|
|
126
|
+
"web-streams-polyfill": "3.2.1",
|
|
127
|
+
"whatwg-fetch": "3.6.2"
|
|
128
|
+
},
|
|
129
|
+
"publishConfig": {
|
|
130
|
+
"access": "public"
|
|
131
|
+
},
|
|
132
|
+
"prettier": {
|
|
133
|
+
"bracketSpacing": true,
|
|
134
|
+
"printWidth": 80,
|
|
135
|
+
"semi": true,
|
|
136
|
+
"singleQuote": true,
|
|
137
|
+
"tabWidth": 2,
|
|
138
|
+
"trailingComma": "es5"
|
|
139
|
+
},
|
|
140
|
+
"type": "module"
|
|
141
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApolloQueryResult, DocumentNode, ObservableQuery, OperationVariables, TypedDocumentNode } from '../../core';
|
|
2
|
+
interface CacheEntry<TData, TVariables extends OperationVariables> {
|
|
3
|
+
observable: ObservableQuery<TData, TVariables>;
|
|
4
|
+
fulfilled: boolean;
|
|
5
|
+
promise: Promise<ApolloQueryResult<TData>>;
|
|
6
|
+
}
|
|
7
|
+
export declare class SuspenseCache {
|
|
8
|
+
private queries;
|
|
9
|
+
add<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, variables: TVariables | undefined, { promise, observable, }: {
|
|
10
|
+
promise: Promise<any>;
|
|
11
|
+
observable: ObservableQuery<TData, TVariables>;
|
|
12
|
+
}): CacheEntry<TData, TVariables>;
|
|
13
|
+
lookup<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, variables: TVariables | undefined): CacheEntry<TData, TVariables> | undefined;
|
|
14
|
+
remove(query: DocumentNode, variables: OperationVariables | undefined): void;
|
|
15
|
+
private getVariablesKey;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=SuspenseCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseCache.d.ts","sourceRoot":"","sources":["../../../src/react/cache/SuspenseCache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB,UAAU,UAAU,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB;IAC/D,UAAU,EAAE,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;CAC5C;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAGX;IAEJ,GAAG,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,EACzE,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC1D,SAAS,EAAE,UAAU,GAAG,SAAS,EACjC,EACE,OAAO,EACP,UAAU,GACX,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAAC,UAAU,EAAE,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;KAAE;IAyB9E,MAAM,CACJ,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,EAE1D,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC1D,SAAS,EAAE,UAAU,GAAG,SAAS,GAChC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,SAAS;IAM5C,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,GAAG,SAAS;IAmBrE,OAAO,CAAC,eAAe;CAGxB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { canonicalStringify } from "../../cache/index.js";
|
|
2
|
+
var SuspenseCache = (function () {
|
|
3
|
+
function SuspenseCache() {
|
|
4
|
+
this.queries = new Map();
|
|
5
|
+
}
|
|
6
|
+
SuspenseCache.prototype.add = function (query, variables, _a) {
|
|
7
|
+
var promise = _a.promise, observable = _a.observable;
|
|
8
|
+
var variablesKey = this.getVariablesKey(variables);
|
|
9
|
+
var map = this.queries.get(query) || new Map();
|
|
10
|
+
var entry = {
|
|
11
|
+
observable: observable,
|
|
12
|
+
fulfilled: false,
|
|
13
|
+
promise: promise
|
|
14
|
+
.catch(function () {
|
|
15
|
+
})
|
|
16
|
+
.finally(function () {
|
|
17
|
+
entry.fulfilled = true;
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
map.set(variablesKey, entry);
|
|
21
|
+
this.queries.set(query, map);
|
|
22
|
+
return entry;
|
|
23
|
+
};
|
|
24
|
+
SuspenseCache.prototype.lookup = function (query, variables) {
|
|
25
|
+
var _a;
|
|
26
|
+
return (_a = this.queries
|
|
27
|
+
.get(query)) === null || _a === void 0 ? void 0 : _a.get(this.getVariablesKey(variables));
|
|
28
|
+
};
|
|
29
|
+
SuspenseCache.prototype.remove = function (query, variables) {
|
|
30
|
+
var map = this.queries.get(query);
|
|
31
|
+
if (!map) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
var key = this.getVariablesKey(variables);
|
|
35
|
+
var entry = map.get(key);
|
|
36
|
+
if (entry && !entry.observable.hasObservers()) {
|
|
37
|
+
map.delete(key);
|
|
38
|
+
}
|
|
39
|
+
if (map.size === 0) {
|
|
40
|
+
this.queries.delete(query);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
SuspenseCache.prototype.getVariablesKey = function (variables) {
|
|
44
|
+
return canonicalStringify(variables || Object.create(null));
|
|
45
|
+
};
|
|
46
|
+
return SuspenseCache;
|
|
47
|
+
}());
|
|
48
|
+
export { SuspenseCache };
|
|
49
|
+
//# sourceMappingURL=SuspenseCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseCache.js","sourceRoot":"","sources":["../../../src/react/cache/SuspenseCache.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQjD;IAAA;QACU,YAAO,GAAG,IAAI,GAAG,EAGtB,CAAC;IAmEN,CAAC;IAjEC,2BAAG,GAAH,UACE,KAA0D,EAC1D,SAAiC,EACjC,EAG4E;YAF1E,OAAO,aAAA,EACP,UAAU,gBAAA;QAGZ,IAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACrD,IAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;QAEjD,IAAM,KAAK,GAAkC;YAC3C,UAAU,YAAA;YACV,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,OAAO;iBACb,KAAK,CAAC;YAGP,CAAC,CAAC;iBACD,OAAO,CAAC;gBACP,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACzB,CAAC,CAAC;SACL,CAAC;QAEF,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,8BAAM,GAAN,UAIE,KAA0D,EAC1D,SAAiC;;QAEjC,OAAO,MAAA,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,KAAK,CAAC,0CACT,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAkC,CAAC;IAC5E,CAAC;IAED,8BAAM,GAAN,UAAO,KAAmB,EAAE,SAAyC;QACnE,IAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,CAAC,GAAG,EAAE;YACR,OAAO;SACR;QAED,IAAM,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE3B,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE;YAC7C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjB;QAED,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAC5B;IACH,CAAC;IAEO,uCAAe,GAAvB,UAAwB,SAAyC;QAC/D,OAAO,kBAAkB,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;IACH,oBAAC;AAAD,CAAC,AAvED,IAuEC","sourcesContent":["import {\n ApolloQueryResult,\n DocumentNode,\n ObservableQuery,\n OperationVariables,\n TypedDocumentNode,\n} from '../../core';\nimport { canonicalStringify } from '../../cache';\n\ninterface CacheEntry<TData, TVariables extends OperationVariables> {\n observable: ObservableQuery<TData, TVariables>;\n fulfilled: boolean;\n promise: Promise<ApolloQueryResult<TData>>;\n}\n\nexport class SuspenseCache {\n private queries = new Map<\n DocumentNode,\n Map<string, CacheEntry<unknown, any>>\n >();\n\n add<TData = any, TVariables extends OperationVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n variables: TVariables | undefined,\n {\n promise,\n observable,\n }: { promise: Promise<any>; observable: ObservableQuery<TData, TVariables> }\n ) {\n const variablesKey = this.getVariablesKey(variables);\n const map = this.queries.get(query) || new Map();\n\n const entry: CacheEntry<TData, TVariables> = {\n observable,\n fulfilled: false,\n promise: promise\n .catch(() => {\n // Throw away the error as we only care to track when the promise has\n // been fulfilled\n })\n .finally(() => {\n entry.fulfilled = true;\n }),\n };\n\n map.set(variablesKey, entry);\n\n this.queries.set(query, map);\n\n return entry;\n }\n\n lookup<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n >(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n variables: TVariables | undefined\n ): CacheEntry<TData, TVariables> | undefined {\n return this.queries\n .get(query)\n ?.get(this.getVariablesKey(variables)) as CacheEntry<TData, TVariables>;\n }\n\n remove(query: DocumentNode, variables: OperationVariables | undefined) {\n const map = this.queries.get(query);\n\n if (!map) {\n return;\n }\n\n const key = this.getVariablesKey(variables);\n const entry = map.get(key);\n\n if (entry && !entry.observable.hasObservers()) {\n map.delete(key);\n }\n\n if (map.size === 0) {\n this.queries.delete(query);\n }\n }\n\n private getVariablesKey(variables: OperationVariables | undefined) {\n return canonicalStringify(variables || Object.create(null));\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { SuspenseCache } from './SuspenseCache';\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import { OperationVariables } from '../../core';
|
|
4
|
+
import { MutationComponentOptions } from './types';
|
|
5
|
+
export declare function Mutation<TData = any, TVariables = OperationVariables>(props: MutationComponentOptions<TData, TVariables>): JSX.Element | null;
|
|
6
|
+
export declare namespace Mutation {
|
|
7
|
+
var propTypes: PropTypes.InferProps<MutationComponentOptions<any, any, import("../../core").DefaultContext, import("../../core").ApolloCache<any>>>;
|
|
8
|
+
}
|
|
9
|
+
export interface Mutation<TData, TVariables> {
|
|
10
|
+
propTypes: PropTypes.InferProps<MutationComponentOptions<TData, TVariables>>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mutation.d.ts","sourceRoot":"","sources":["../../../src/react/components/Mutation.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGnD,wBAAgB,QAAQ,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,kBAAkB,EACnE,KAAK,EAAE,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC,sBAInD;yBALe,QAAQ;;;AAOxB,MAAM,WAAW,QAAQ,CAAC,KAAK,EAAE,UAAU;IACzC,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;CAC9E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as PropTypes from 'prop-types';
|
|
2
|
+
import { useMutation } from "../hooks/index.js";
|
|
3
|
+
export function Mutation(props) {
|
|
4
|
+
var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
5
|
+
return props.children ? props.children(runMutation, result) : null;
|
|
6
|
+
}
|
|
7
|
+
Mutation.propTypes = {
|
|
8
|
+
mutation: PropTypes.object.isRequired,
|
|
9
|
+
variables: PropTypes.object,
|
|
10
|
+
optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
|
11
|
+
refetchQueries: PropTypes.oneOfType([
|
|
12
|
+
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
|
|
13
|
+
PropTypes.func
|
|
14
|
+
]),
|
|
15
|
+
awaitRefetchQueries: PropTypes.bool,
|
|
16
|
+
update: PropTypes.func,
|
|
17
|
+
children: PropTypes.func.isRequired,
|
|
18
|
+
onCompleted: PropTypes.func,
|
|
19
|
+
onError: PropTypes.func,
|
|
20
|
+
fetchPolicy: PropTypes.string,
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../../../src/react/components/Mutation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,UAAU,QAAQ,CACtB,KAAkD;IAE5C,IAAA,KAAwB,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAzD,WAAW,QAAA,EAAE,MAAM,QAAsC,CAAC;IACjE,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC;AAMD,QAAQ,CAAC,SAAS,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACrC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,kBAAkB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAC3E,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC;QAClC,SAAS,CAAC,OAAO,CACf,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAC1D;QACD,SAAS,CAAC,IAAI;KACf,CAAC;IACF,mBAAmB,EAAE,SAAS,CAAC,IAAI;IACnC,MAAM,EAAE,SAAS,CAAC,IAAI;IACtB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,WAAW,EAAE,SAAS,CAAC,MAAM;CACK,CAAC","sourcesContent":["import * as PropTypes from 'prop-types';\n\nimport { OperationVariables } from '../../core';\nimport { MutationComponentOptions } from './types';\nimport { useMutation } from '../hooks';\n\nexport function Mutation<TData = any, TVariables = OperationVariables>(\n props: MutationComponentOptions<TData, TVariables>\n) {\n const [runMutation, result] = useMutation(props.mutation, props);\n return props.children ? props.children(runMutation, result) : null;\n}\n\nexport interface Mutation<TData, TVariables> {\n propTypes: PropTypes.InferProps<MutationComponentOptions<TData, TVariables>>;\n}\n\nMutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n ),\n PropTypes.func\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n} as Mutation<any, any>[\"propTypes\"];\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import { OperationVariables } from '../../core';
|
|
4
|
+
import { QueryComponentOptions } from './types';
|
|
5
|
+
export declare function Query<TData = any, TVariables extends OperationVariables = OperationVariables>(props: QueryComponentOptions<TData, TVariables>): JSX.Element | null;
|
|
6
|
+
export declare namespace Query {
|
|
7
|
+
var propTypes: PropTypes.InferProps<QueryComponentOptions<any, any>>;
|
|
8
|
+
}
|
|
9
|
+
export interface Query<TData, TVariables extends OperationVariables> {
|
|
10
|
+
propTypes: PropTypes.InferProps<QueryComponentOptions<TData, TVariables>>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../src/react/components/Query.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,wBAAgB,KAAK,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,EAC3F,KAAK,EAAE,qBAAqB,CAAC,KAAK,EAAE,UAAU,CAAC,sBAKhD;yBANe,KAAK;;;AAQrB,MAAM,WAAW,KAAK,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB;IACjE,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,qBAAqB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;CAC3E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import { useQuery } from "../hooks/index.js";
|
|
4
|
+
export function Query(props) {
|
|
5
|
+
var children = props.children, query = props.query, options = __rest(props, ["children", "query"]);
|
|
6
|
+
var result = useQuery(query, options);
|
|
7
|
+
return result ? children(result) : null;
|
|
8
|
+
}
|
|
9
|
+
Query.propTypes = {
|
|
10
|
+
client: PropTypes.object,
|
|
11
|
+
children: PropTypes.func.isRequired,
|
|
12
|
+
fetchPolicy: PropTypes.string,
|
|
13
|
+
notifyOnNetworkStatusChange: PropTypes.bool,
|
|
14
|
+
onCompleted: PropTypes.func,
|
|
15
|
+
onError: PropTypes.func,
|
|
16
|
+
pollInterval: PropTypes.number,
|
|
17
|
+
query: PropTypes.object.isRequired,
|
|
18
|
+
variables: PropTypes.object,
|
|
19
|
+
ssr: PropTypes.bool,
|
|
20
|
+
partialRefetch: PropTypes.bool,
|
|
21
|
+
returnPartialData: PropTypes.bool
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../src/react/components/Query.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,UAAU,KAAK,CACnB,KAA+C;IAEvC,IAAA,QAAQ,GAAwB,KAAK,SAA7B,EAAE,KAAK,GAAiB,KAAK,MAAtB,EAAK,OAAO,UAAK,KAAK,EAAvC,qBAA+B,CAAF,CAAW;IAC9C,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAMD,KAAK,CAAC,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,2BAA2B,EAAE,SAAS,CAAC,IAAI;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,GAAG,EAAE,SAAS,CAAC,IAAI;IACnB,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,iBAAiB,EAAE,SAAS,CAAC,IAAI;CACF,CAAC","sourcesContent":["import * as PropTypes from 'prop-types';\n\nimport { OperationVariables } from '../../core';\nimport { QueryComponentOptions } from './types';\nimport { useQuery } from '../hooks';\n\nexport function Query<TData = any, TVariables extends OperationVariables = OperationVariables>(\n props: QueryComponentOptions<TData, TVariables>\n) {\n const { children, query, ...options } = props;\n const result = useQuery(query, options);\n return result ? children(result as any) : null;\n}\n\nexport interface Query<TData, TVariables extends OperationVariables> {\n propTypes: PropTypes.InferProps<QueryComponentOptions<TData, TVariables>>;\n}\n\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool\n} as Query<any, any>[\"propTypes\"];\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import { OperationVariables } from '../../core';
|
|
4
|
+
import { SubscriptionComponentOptions } from './types';
|
|
5
|
+
export declare function Subscription<TData = any, TVariables extends OperationVariables = OperationVariables>(props: SubscriptionComponentOptions<TData, TVariables>): JSX.Element | null;
|
|
6
|
+
export declare namespace Subscription {
|
|
7
|
+
var propTypes: PropTypes.InferProps<SubscriptionComponentOptions<any, any>>;
|
|
8
|
+
}
|
|
9
|
+
export interface Subscription<TData, TVariables extends OperationVariables> {
|
|
10
|
+
propTypes: PropTypes.InferProps<SubscriptionComponentOptions<TData, TVariables>>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../../src/react/components/Subscription.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAGvD,wBAAgB,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,EAClG,KAAK,EAAE,4BAA4B,CAAC,KAAK,EAAE,UAAU,CAAC,sBAIvD;yBALe,YAAY;;;AAO5B,MAAM,WAAW,YAAY,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB;IACxE,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,4BAA4B,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;CAClF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as PropTypes from 'prop-types';
|
|
2
|
+
import { useSubscription } from "../hooks/index.js";
|
|
3
|
+
export function Subscription(props) {
|
|
4
|
+
var result = useSubscription(props.subscription, props);
|
|
5
|
+
return props.children && result ? props.children(result) : null;
|
|
6
|
+
}
|
|
7
|
+
Subscription.propTypes = {
|
|
8
|
+
subscription: PropTypes.object.isRequired,
|
|
9
|
+
variables: PropTypes.object,
|
|
10
|
+
children: PropTypes.func,
|
|
11
|
+
onSubscriptionData: PropTypes.func,
|
|
12
|
+
onData: PropTypes.func,
|
|
13
|
+
onSubscriptionComplete: PropTypes.func,
|
|
14
|
+
onComplete: PropTypes.func,
|
|
15
|
+
shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool])
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../src/react/components/Subscription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,UAAU,YAAY,CAC1B,KAAsD;IAEtD,IAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC;AAMD,YAAY,CAAC,SAAS,GAAG;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACzC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,kBAAkB,EAAE,SAAS,CAAC,IAAI;IAClC,MAAM,EAAE,SAAS,CAAC,IAAI;IACtB,sBAAsB,EAAE,SAAS,CAAC,IAAI;IACtC,UAAU,EAAE,SAAS,CAAC,IAAI;IAC1B,iBAAiB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CAClC,CAAC","sourcesContent":["import * as PropTypes from 'prop-types';\n\nimport { OperationVariables } from '../../core';\nimport { SubscriptionComponentOptions } from './types';\nimport { useSubscription } from '../hooks';\n\nexport function Subscription<TData = any, TVariables extends OperationVariables = OperationVariables>(\n props: SubscriptionComponentOptions<TData, TVariables>\n) {\n const result = useSubscription(props.subscription, props);\n return props.children && result ? props.children(result) : null;\n}\n\nexport interface Subscription<TData, TVariables extends OperationVariables> {\n propTypes: PropTypes.InferProps<SubscriptionComponentOptions<TData, TVariables>>;\n}\n\nSubscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n onComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool])\n} as Subscription<any, any>[\"propTypes\"];\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var PropTypes = require('prop-types');
|
|
7
|
+
var hooks = require('../hooks');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
for (var k in e) {
|
|
14
|
+
n[k] = e[k];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n["default"] = e;
|
|
18
|
+
return Object.freeze(n);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var PropTypes__namespace = /*#__PURE__*/_interopNamespace(PropTypes);
|
|
22
|
+
|
|
23
|
+
function Query(props) {
|
|
24
|
+
var children = props.children, query = props.query, options = tslib.__rest(props, ["children", "query"]);
|
|
25
|
+
var result = hooks.useQuery(query, options);
|
|
26
|
+
return result ? children(result) : null;
|
|
27
|
+
}
|
|
28
|
+
Query.propTypes = {
|
|
29
|
+
client: PropTypes__namespace.object,
|
|
30
|
+
children: PropTypes__namespace.func.isRequired,
|
|
31
|
+
fetchPolicy: PropTypes__namespace.string,
|
|
32
|
+
notifyOnNetworkStatusChange: PropTypes__namespace.bool,
|
|
33
|
+
onCompleted: PropTypes__namespace.func,
|
|
34
|
+
onError: PropTypes__namespace.func,
|
|
35
|
+
pollInterval: PropTypes__namespace.number,
|
|
36
|
+
query: PropTypes__namespace.object.isRequired,
|
|
37
|
+
variables: PropTypes__namespace.object,
|
|
38
|
+
ssr: PropTypes__namespace.bool,
|
|
39
|
+
partialRefetch: PropTypes__namespace.bool,
|
|
40
|
+
returnPartialData: PropTypes__namespace.bool
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function Mutation(props) {
|
|
44
|
+
var _a = hooks.useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
45
|
+
return props.children ? props.children(runMutation, result) : null;
|
|
46
|
+
}
|
|
47
|
+
Mutation.propTypes = {
|
|
48
|
+
mutation: PropTypes__namespace.object.isRequired,
|
|
49
|
+
variables: PropTypes__namespace.object,
|
|
50
|
+
optimisticResponse: PropTypes__namespace.oneOfType([PropTypes__namespace.object, PropTypes__namespace.func]),
|
|
51
|
+
refetchQueries: PropTypes__namespace.oneOfType([
|
|
52
|
+
PropTypes__namespace.arrayOf(PropTypes__namespace.oneOfType([PropTypes__namespace.string, PropTypes__namespace.object])),
|
|
53
|
+
PropTypes__namespace.func
|
|
54
|
+
]),
|
|
55
|
+
awaitRefetchQueries: PropTypes__namespace.bool,
|
|
56
|
+
update: PropTypes__namespace.func,
|
|
57
|
+
children: PropTypes__namespace.func.isRequired,
|
|
58
|
+
onCompleted: PropTypes__namespace.func,
|
|
59
|
+
onError: PropTypes__namespace.func,
|
|
60
|
+
fetchPolicy: PropTypes__namespace.string,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
function Subscription(props) {
|
|
64
|
+
var result = hooks.useSubscription(props.subscription, props);
|
|
65
|
+
return props.children && result ? props.children(result) : null;
|
|
66
|
+
}
|
|
67
|
+
Subscription.propTypes = {
|
|
68
|
+
subscription: PropTypes__namespace.object.isRequired,
|
|
69
|
+
variables: PropTypes__namespace.object,
|
|
70
|
+
children: PropTypes__namespace.func,
|
|
71
|
+
onSubscriptionData: PropTypes__namespace.func,
|
|
72
|
+
onData: PropTypes__namespace.func,
|
|
73
|
+
onSubscriptionComplete: PropTypes__namespace.func,
|
|
74
|
+
onComplete: PropTypes__namespace.func,
|
|
75
|
+
shouldResubscribe: PropTypes__namespace.oneOfType([PropTypes__namespace.func, PropTypes__namespace.bool])
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.Mutation = Mutation;
|
|
79
|
+
exports.Query = Query;
|
|
80
|
+
exports.Subscription = Subscription;
|
|
81
|
+
//# sourceMappingURL=components.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.cjs","sources":["Query.js","Mutation.js","Subscription.js"],"sourcesContent":["import { __rest } from \"tslib\";\nimport * as PropTypes from 'prop-types';\nimport { useQuery } from '../hooks';\nexport function Query(props) {\n var children = props.children, query = props.query, options = __rest(props, [\"children\", \"query\"]);\n var result = useQuery(query, options);\n return result ? children(result) : null;\n}\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool\n};\n//# sourceMappingURL=Query.js.map","import * as PropTypes from 'prop-types';\nimport { useMutation } from '../hooks';\nexport function Mutation(props) {\n var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];\n return props.children ? props.children(runMutation, result) : null;\n}\nMutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),\n PropTypes.func\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n};\n//# sourceMappingURL=Mutation.js.map","import * as PropTypes from 'prop-types';\nimport { useSubscription } from '../hooks';\nexport function Subscription(props) {\n var result = useSubscription(props.subscription, props);\n return props.children && result ? props.children(result) : null;\n}\nSubscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n onComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool])\n};\n//# sourceMappingURL=Subscription.js.map"],"names":["__rest","useQuery","PropTypes","useMutation","useSubscription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,GAAGA,YAAM,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AACvG,IAAI,IAAI,MAAM,GAAGC,cAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1C,IAAI,OAAO,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAC5C,CAAC;AACD,KAAK,CAAC,SAAS,GAAG;AAClB,IAAI,MAAM,EAAEC,oBAAS,CAAC,MAAM;AAC5B,IAAI,QAAQ,EAAEA,oBAAS,CAAC,IAAI,CAAC,UAAU;AACvC,IAAI,WAAW,EAAEA,oBAAS,CAAC,MAAM;AACjC,IAAI,2BAA2B,EAAEA,oBAAS,CAAC,IAAI;AAC/C,IAAI,WAAW,EAAEA,oBAAS,CAAC,IAAI;AAC/B,IAAI,OAAO,EAAEA,oBAAS,CAAC,IAAI;AAC3B,IAAI,YAAY,EAAEA,oBAAS,CAAC,MAAM;AAClC,IAAI,KAAK,EAAEA,oBAAS,CAAC,MAAM,CAAC,UAAU;AACtC,IAAI,SAAS,EAAEA,oBAAS,CAAC,MAAM;AAC/B,IAAI,GAAG,EAAEA,oBAAS,CAAC,IAAI;AACvB,IAAI,cAAc,EAAEA,oBAAS,CAAC,IAAI;AAClC,IAAI,iBAAiB,EAAEA,oBAAS,CAAC,IAAI;AACrC,CAAC;;ACnBM,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,IAAI,EAAE,GAAGC,iBAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACrF,IAAI,OAAO,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;AACvE,CAAC;AACD,QAAQ,CAAC,SAAS,GAAG;AACrB,IAAI,QAAQ,EAAED,oBAAS,CAAC,MAAM,CAAC,UAAU;AACzC,IAAI,SAAS,EAAEA,oBAAS,CAAC,MAAM;AAC/B,IAAI,kBAAkB,EAAEA,oBAAS,CAAC,SAAS,CAAC,CAACA,oBAAS,CAAC,MAAM,EAAEA,oBAAS,CAAC,IAAI,CAAC,CAAC;AAC/E,IAAI,cAAc,EAAEA,oBAAS,CAAC,SAAS,CAAC;AACxC,QAAQA,oBAAS,CAAC,OAAO,CAACA,oBAAS,CAAC,SAAS,CAAC,CAACA,oBAAS,CAAC,MAAM,EAAEA,oBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACpF,QAAQA,oBAAS,CAAC,IAAI;AACtB,KAAK,CAAC;AACN,IAAI,mBAAmB,EAAEA,oBAAS,CAAC,IAAI;AACvC,IAAI,MAAM,EAAEA,oBAAS,CAAC,IAAI;AAC1B,IAAI,QAAQ,EAAEA,oBAAS,CAAC,IAAI,CAAC,UAAU;AACvC,IAAI,WAAW,EAAEA,oBAAS,CAAC,IAAI;AAC/B,IAAI,OAAO,EAAEA,oBAAS,CAAC,IAAI;AAC3B,IAAI,WAAW,EAAEA,oBAAS,CAAC,MAAM;AACjC,CAAC;;AClBM,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,IAAI,MAAM,GAAGE,qBAAe,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAC5D,IAAI,OAAO,KAAK,CAAC,QAAQ,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AACpE,CAAC;AACD,YAAY,CAAC,SAAS,GAAG;AACzB,IAAI,YAAY,EAAEF,oBAAS,CAAC,MAAM,CAAC,UAAU;AAC7C,IAAI,SAAS,EAAEA,oBAAS,CAAC,MAAM;AAC/B,IAAI,QAAQ,EAAEA,oBAAS,CAAC,IAAI;AAC5B,IAAI,kBAAkB,EAAEA,oBAAS,CAAC,IAAI;AACtC,IAAI,MAAM,EAAEA,oBAAS,CAAC,IAAI;AAC1B,IAAI,sBAAsB,EAAEA,oBAAS,CAAC,IAAI;AAC1C,IAAI,UAAU,EAAEA,oBAAS,CAAC,IAAI;AAC9B,IAAI,iBAAiB,EAAEA,oBAAS,CAAC,SAAS,CAAC,CAACA,oBAAS,CAAC,IAAI,EAAEA,oBAAS,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;;;;;;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var PropTypes = require('prop-types');
|
|
7
|
+
var hooks = require('../hooks');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
for (var k in e) {
|
|
14
|
+
n[k] = e[k];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n["default"] = e;
|
|
18
|
+
return Object.freeze(n);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var PropTypes__namespace = /*#__PURE__*/_interopNamespace(PropTypes);
|
|
22
|
+
|
|
23
|
+
function Query(props) {
|
|
24
|
+
var children = props.children, query = props.query, options = tslib.__rest(props, ["children", "query"]);
|
|
25
|
+
var result = hooks.useQuery(query, options);
|
|
26
|
+
return result ? children(result) : null;
|
|
27
|
+
}
|
|
28
|
+
Query.propTypes = {
|
|
29
|
+
client: PropTypes__namespace.object,
|
|
30
|
+
children: PropTypes__namespace.func.isRequired,
|
|
31
|
+
fetchPolicy: PropTypes__namespace.string,
|
|
32
|
+
notifyOnNetworkStatusChange: PropTypes__namespace.bool,
|
|
33
|
+
onCompleted: PropTypes__namespace.func,
|
|
34
|
+
onError: PropTypes__namespace.func,
|
|
35
|
+
pollInterval: PropTypes__namespace.number,
|
|
36
|
+
query: PropTypes__namespace.object.isRequired,
|
|
37
|
+
variables: PropTypes__namespace.object,
|
|
38
|
+
ssr: PropTypes__namespace.bool,
|
|
39
|
+
partialRefetch: PropTypes__namespace.bool,
|
|
40
|
+
returnPartialData: PropTypes__namespace.bool
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function Mutation(props) {
|
|
44
|
+
var _a = hooks.useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
|
45
|
+
return props.children ? props.children(runMutation, result) : null;
|
|
46
|
+
}
|
|
47
|
+
Mutation.propTypes = {
|
|
48
|
+
mutation: PropTypes__namespace.object.isRequired,
|
|
49
|
+
variables: PropTypes__namespace.object,
|
|
50
|
+
optimisticResponse: PropTypes__namespace.oneOfType([PropTypes__namespace.object, PropTypes__namespace.func]),
|
|
51
|
+
refetchQueries: PropTypes__namespace.oneOfType([
|
|
52
|
+
PropTypes__namespace.arrayOf(PropTypes__namespace.oneOfType([PropTypes__namespace.string, PropTypes__namespace.object])),
|
|
53
|
+
PropTypes__namespace.func
|
|
54
|
+
]),
|
|
55
|
+
awaitRefetchQueries: PropTypes__namespace.bool,
|
|
56
|
+
update: PropTypes__namespace.func,
|
|
57
|
+
children: PropTypes__namespace.func.isRequired,
|
|
58
|
+
onCompleted: PropTypes__namespace.func,
|
|
59
|
+
onError: PropTypes__namespace.func,
|
|
60
|
+
fetchPolicy: PropTypes__namespace.string,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
function Subscription(props) {
|
|
64
|
+
var result = hooks.useSubscription(props.subscription, props);
|
|
65
|
+
return props.children && result ? props.children(result) : null;
|
|
66
|
+
}
|
|
67
|
+
Subscription.propTypes = {
|
|
68
|
+
subscription: PropTypes__namespace.object.isRequired,
|
|
69
|
+
variables: PropTypes__namespace.object,
|
|
70
|
+
children: PropTypes__namespace.func,
|
|
71
|
+
onSubscriptionData: PropTypes__namespace.func,
|
|
72
|
+
onData: PropTypes__namespace.func,
|
|
73
|
+
onSubscriptionComplete: PropTypes__namespace.func,
|
|
74
|
+
onComplete: PropTypes__namespace.func,
|
|
75
|
+
shouldResubscribe: PropTypes__namespace.oneOfType([PropTypes__namespace.func, PropTypes__namespace.bool])
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.Mutation = Mutation;
|
|
79
|
+
exports.Query = Query;
|
|
80
|
+
exports.Subscription = Subscription;
|
|
81
|
+
//# sourceMappingURL=components.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,SAAS,CAAC","sourcesContent":["export { Query } from './Query';\nexport { Mutation } from './Mutation';\nexport { Subscription } from './Subscription';\n\nexport * from './types';\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DocumentNode } from 'graphql';
|
|
3
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
4
|
+
import { OperationVariables, DefaultContext, ApolloCache } from '../../core';
|
|
5
|
+
import { QueryFunctionOptions, QueryResult, BaseMutationOptions, MutationFunction, MutationResult, BaseSubscriptionOptions, SubscriptionResult } from '../types/types';
|
|
6
|
+
export interface QueryComponentOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends QueryFunctionOptions<TData, TVariables> {
|
|
7
|
+
children: (result: QueryResult<TData, TVariables>) => JSX.Element | null;
|
|
8
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
9
|
+
}
|
|
10
|
+
export interface MutationComponentOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
|
|
11
|
+
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
12
|
+
children: (mutateFunction: MutationFunction<TData, TVariables, TContext>, result: MutationResult<TData>) => JSX.Element | null;
|
|
13
|
+
}
|
|
14
|
+
export interface SubscriptionComponentOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseSubscriptionOptions<TData, TVariables> {
|
|
15
|
+
subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
16
|
+
children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react/components/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,qBAAqB,CACpC,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,CAC1D,SAAQ,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC;IAC/C,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IACzE,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,wBAAwB,CACvC,KAAK,GAAG,GAAG,EACX,UAAU,GAAG,kBAAkB,EAC/B,QAAQ,GAAG,cAAc,EACzB,MAAM,SAAS,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAClD,SAAQ,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC;IAChE,QAAQ,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC9D,QAAQ,EAAE,CACR,cAAc,EAAE,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,EAC7D,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,KAC1B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B,CAC3C,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,CAC1D,SAAQ,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC;IAClD,YAAY,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAClE,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;CAC/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { OperationVariables, DefaultContext, ApolloCache } from '../../core';\nimport {\n QueryFunctionOptions,\n QueryResult,\n BaseMutationOptions,\n MutationFunction,\n MutationResult,\n BaseSubscriptionOptions,\n SubscriptionResult\n} from '../types/types';\n\nexport interface QueryComponentOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends QueryFunctionOptions<TData, TVariables> {\n children: (result: QueryResult<TData, TVariables>) => JSX.Element | null;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationComponentOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children: (\n mutateFunction: MutationFunction<TData, TVariables, TContext>,\n result: MutationResult<TData>\n ) => JSX.Element | null;\n}\n\nexport interface SubscriptionComponentOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ApolloClient } from '../../core';
|
|
3
|
+
export interface ApolloConsumerProps {
|
|
4
|
+
children: (client: ApolloClient<object>) => React.ReactChild | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const ApolloConsumer: React.FC<ApolloConsumerProps>;
|
|
7
|
+
//# sourceMappingURL=ApolloConsumer.d.ts.map
|