@apollo/client 3.8.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apollo-client.cjs +715 -587
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +253 -191
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +253 -191
- package/cache/core/cache.d.ts +4 -4
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js +10 -7
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +3 -3
- package/cache/core/types/Cache.d.ts.map +1 -1
- package/cache/core/types/Cache.js +0 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +6 -6
- package/cache/core/types/DataProxy.d.ts.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.d.ts +3 -3
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/index.d.ts +20 -20
- package/cache/index.d.ts.map +1 -1
- package/cache/index.js +13 -13
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +6 -6
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +38 -30
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fixPolyfills.native.d.ts.map +1 -1
- package/cache/inmemory/fixPolyfills.native.js +10 -9
- package/cache/inmemory/fixPolyfills.native.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts.map +1 -1
- package/cache/inmemory/fragmentRegistry.js +6 -4
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +6 -6
- package/cache/inmemory/helpers.d.ts.map +1 -1
- package/cache/inmemory/helpers.js +16 -14
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +9 -9
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +29 -33
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.d.ts.map +1 -1
- package/cache/inmemory/key-extractor.js +55 -49
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +5 -5
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts +6 -6
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +74 -45
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.d.ts.map +1 -1
- package/cache/inmemory/reactiveVars.js +5 -5
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +7 -7
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +21 -17
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +7 -7
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/types.js +0 -2
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +7 -7
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +40 -30
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/config/jest/setup.d.ts +2 -2
- package/config/jest/setup.js +5 -5
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +11 -11
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +64 -50
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts +6 -6
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +17 -16
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +12 -10
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +57 -38
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +11 -11
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +28 -34
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +10 -10
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +117 -93
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +255 -199
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +255 -199
- package/core/networkStatus.js.map +1 -1
- package/core/types.d.ts +13 -13
- package/core/types.d.ts.map +1 -1
- package/core/types.js +0 -1
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +11 -11
- package/core/watchQueryOptions.d.ts.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +44 -40
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +44 -40
- package/errors/errors.cjs +7 -5
- package/errors/errors.cjs.map +1 -1
- package/errors/errors.cjs.native.js +7 -5
- package/errors/index.d.ts +4 -4
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +9 -7
- package/errors/index.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/invariantErrorCodes.d.ts.map +1 -1
- package/invariantErrorCodes.js +36 -36
- package/invariantErrorCodes.js.map +1 -1
- package/link/batch/batch.cjs +4 -4
- package/link/batch/batch.cjs.map +1 -1
- package/link/batch/batch.cjs.native.js +4 -4
- package/link/batch/batchLink.d.ts +6 -6
- package/link/batch/batchLink.d.ts.map +1 -1
- package/link/batch/batchLink.js +4 -4
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.d.ts +2 -2
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js +4 -4
- 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/batch-http.cjs +13 -11
- package/link/batch-http/batch-http.cjs.map +1 -1
- package/link/batch-http/batch-http.cjs.native.js +13 -11
- package/link/batch-http/batchHttpLink.d.ts +6 -6
- package/link/batch-http/batchHttpLink.d.ts.map +1 -1
- package/link/batch-http/batchHttpLink.js +17 -15
- 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/context/context.cjs.map +1 -1
- package/link/context/index.d.ts +3 -3
- package/link/context/index.js +2 -2
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.d.ts +3 -3
- package/link/core/ApolloLink.js +4 -4
- package/link/core/ApolloLink.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/core.cjs +1 -1
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +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/index.d.ts +8 -8
- package/link/core/index.js +8 -8
- package/link/core/index.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.js.map +1 -1
- package/link/error/error.cjs.map +1 -1
- package/link/error/index.d.ts +5 -5
- package/link/error/index.js +2 -2
- package/link/error/index.js.map +1 -1
- package/link/http/HttpLink.d.ts +3 -3
- package/link/http/HttpLink.js +2 -2
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.d.ts +1 -1
- package/link/http/checkFetcher.d.ts.map +1 -1
- package/link/http/checkFetcher.js +2 -2
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.d.ts +2 -2
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +27 -26
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/createSignalIfSupported.js +1 -1
- package/link/http/createSignalIfSupported.js.map +1 -1
- package/link/http/http.cjs +64 -41
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +64 -41
- package/link/http/index.d.ts +13 -13
- package/link/http/index.js +10 -10
- package/link/http/index.js.map +1 -1
- package/link/http/iterators/nodeStream.d.ts.map +1 -1
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js +2 -2
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/responseIterator.d.ts.map +1 -1
- package/link/http/responseIterator.js +20 -1
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/rewriteURIForGET.d.ts +1 -1
- package/link/http/rewriteURIForGET.js +12 -12
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +5 -5
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +8 -7
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.d.ts +1 -1
- package/link/http/selectURI.js +2 -2
- package/link/http/selectURI.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.d.ts +4 -4
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +26 -25
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs +22 -17
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +22 -17
- package/link/retry/delayFunction.d.ts +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/retry.cjs +2 -2
- package/link/retry/retry.cjs.map +1 -1
- package/link/retry/retry.cjs.native.js +2 -2
- package/link/retry/retryFunction.d.ts +1 -1
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.d.ts +5 -5
- package/link/retry/retryLink.d.ts.map +1 -1
- package/link/retry/retryLink.js +6 -6
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +4 -4
- package/link/schema/index.d.ts.map +1 -1
- package/link/schema/index.js +13 -8
- package/link/schema/index.js.map +1 -1
- package/link/schema/schema.cjs +10 -5
- package/link/schema/schema.cjs.map +1 -1
- package/link/schema/schema.cjs.native.js +10 -5
- package/link/subscriptions/index.js +1 -1
- package/link/subscriptions/index.js.map +1 -1
- package/link/subscriptions/subscriptions.cjs.map +1 -1
- package/link/utils/createOperation.d.ts +1 -1
- package/link/utils/createOperation.js +3 -3
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/filterOperationVariables.d.ts +1 -1
- package/link/utils/filterOperationVariables.js +2 -2
- package/link/utils/filterOperationVariables.js.map +1 -1
- package/link/utils/fromError.d.ts +1 -1
- package/link/utils/fromError.js +1 -1
- package/link/utils/fromError.js.map +1 -1
- package/link/utils/fromPromise.d.ts +1 -1
- package/link/utils/fromPromise.js +1 -1
- package/link/utils/fromPromise.js.map +1 -1
- package/link/utils/index.d.ts +10 -10
- package/link/utils/index.js +9 -9
- package/link/utils/index.js.map +1 -1
- package/link/utils/throwServerError.js +1 -1
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.d.ts +1 -1
- package/link/utils/toPromise.js +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/transformOperation.d.ts +1 -1
- package/link/utils/transformOperation.js +3 -3
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/utils.cjs +12 -12
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +12 -12
- package/link/utils/validateOperation.d.ts +1 -1
- package/link/utils/validateOperation.js +6 -6
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.d.ts +5 -5
- package/link/ws/index.js +2 -2
- package/link/ws/index.js.map +1 -1
- package/link/ws/ws.cjs.map +1 -1
- package/package.json +27 -27
- package/react/cache/QueryReference.d.ts +1 -1
- package/react/cache/QueryReference.d.ts.map +1 -1
- package/react/cache/QueryReference.js +2 -0
- package/react/cache/QueryReference.js.map +1 -1
- package/react/hooks/constants.js +1 -1
- package/react/hooks/constants.js.map +1 -1
- package/react/hooks/hooks.cjs +10 -21
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +10 -21
- package/react/hooks/useBackgroundQuery.d.ts +1 -1
- package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +1 -8
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts.map +1 -1
- package/react/hooks/useReactiveVar.js +7 -12
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +1 -1
- package/react/hooks/useReadQuery.d.ts.map +1 -1
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +1 -1
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/react.cjs +2 -0
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +2 -0
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +37 -28
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +37 -28
- package/testing/core/itAsync.d.ts.map +1 -1
- package/testing/core/itAsync.js +8 -4
- package/testing/core/itAsync.js.map +1 -1
- package/testing/core/mocking/mockClient.d.ts +3 -3
- package/testing/core/mocking/mockClient.d.ts.map +1 -1
- package/testing/core/mocking/mockClient.js +6 -4
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockFetch.d.ts +1 -1
- package/testing/core/mocking/mockFetch.d.ts.map +1 -1
- package/testing/core/mocking/mockFetch.js +3 -3
- package/testing/core/mocking/mockFetch.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +3 -3
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +24 -23
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +2 -2
- package/testing/core/mocking/mockQueryManager.js +3 -3
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -3
- package/testing/core/mocking/mockSubscriptionLink.js +4 -4
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
- package/testing/core/mocking/mockWatchQuery.js +2 -2
- package/testing/core/mocking/mockWatchQuery.js.map +1 -1
- package/testing/core/observableToPromise.d.ts +3 -3
- package/testing/core/observableToPromise.d.ts.map +1 -1
- package/testing/core/observableToPromise.js +8 -4
- package/testing/core/observableToPromise.js.map +1 -1
- package/testing/core/subscribeAndCount.d.ts +1 -1
- package/testing/core/subscribeAndCount.d.ts.map +1 -1
- package/testing/core/subscribeAndCount.js +5 -3
- package/testing/core/subscribeAndCount.js.map +1 -1
- package/testing/core/wait.js.map +1 -1
- package/testing/core/withConsoleSpy.d.ts.map +1 -1
- package/testing/core/withConsoleSpy.js.map +1 -1
- package/testing/core/wrap.d.ts.map +1 -1
- package/testing/core/wrap.js +14 -12
- package/testing/core/wrap.js.map +1 -1
- package/testing/index.d.ts +4 -4
- package/testing/index.js +3 -3
- package/testing/index.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +7 -7
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +10 -11
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +3 -5
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +3 -5
- package/utilities/common/canUse.d.ts.map +1 -1
- package/utilities/common/canUse.js +4 -5
- package/utilities/common/canUse.js.map +1 -1
- package/utilities/common/cloneDeep.js +2 -2
- package/utilities/common/cloneDeep.js.map +1 -1
- package/utilities/common/compact.d.ts +1 -1
- package/utilities/common/compact.js.map +1 -1
- package/utilities/common/filterInPlace.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.js +1 -1
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeDeep.d.ts.map +1 -1
- package/utilities/common/mergeDeep.js +3 -1
- package/utilities/common/mergeDeep.js.map +1 -1
- package/utilities/common/mergeOptions.d.ts.map +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/common/objects.js +2 -2
- package/utilities/common/objects.js.map +1 -1
- package/utilities/common/stringifyForDisplay.d.ts.map +1 -1
- package/utilities/common/stringifyForDisplay.js +3 -1
- package/utilities/common/stringifyForDisplay.js.map +1 -1
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js +3 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/globals.cjs +8 -4
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +8 -4
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +1 -1
- package/utilities/globals/index.js.map +1 -1
- package/utilities/globals/invariantWrappers.js +1 -1
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/utilities/globals/maybe.d.ts.map +1 -1
- package/utilities/globals/maybe.js.map +1 -1
- package/utilities/graphql/directives.d.ts +1 -1
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +17 -13
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts +1 -1
- package/utilities/graphql/fragments.d.ts.map +1 -1
- package/utilities/graphql/fragments.js +12 -12
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts +1 -1
- package/utilities/graphql/getFromAST.js +16 -16
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/storeUtils.d.ts +2 -2
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +36 -34
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts +1 -1
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +48 -32
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +0 -1
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +0 -1
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/Concast.js +5 -9
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/Observable.d.ts +4 -4
- package/utilities/observables/Observable.d.ts.map +1 -1
- package/utilities/observables/Observable.js +6 -4
- package/utilities/observables/Observable.js.map +1 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js +5 -2
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/policies/pagination.d.ts +1 -1
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js +9 -7
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/types/IsStrictlyAny.d.ts +2 -2
- package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
- package/utilities/types/IsStrictlyAny.js.map +1 -1
- package/utilities/utilities.cjs +147 -147
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +147 -147
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/utilities/common/responseIterator.d.ts +0 -10
- package/utilities/common/responseIterator.d.ts.map +0 -1
- package/utilities/common/responseIterator.js +0 -21
- package/utilities/common/responseIterator.js.map +0 -1
|
@@ -17,14 +17,15 @@ function shouldInclude(_a, variables) {
|
|
|
17
17
|
return getInclusionDirectives(directives).every(function (_a) {
|
|
18
18
|
var directive = _a.directive, ifArgument = _a.ifArgument;
|
|
19
19
|
var evaledValue = false;
|
|
20
|
-
if (ifArgument.value.kind ===
|
|
21
|
-
evaledValue =
|
|
20
|
+
if (ifArgument.value.kind === "Variable") {
|
|
21
|
+
evaledValue =
|
|
22
|
+
variables && variables[ifArgument.value.name.value];
|
|
22
23
|
globals.invariant(evaledValue !== void 0, 64, directive.name.value);
|
|
23
24
|
}
|
|
24
25
|
else {
|
|
25
26
|
evaledValue = ifArgument.value.value;
|
|
26
27
|
}
|
|
27
|
-
return directive.name.value ===
|
|
28
|
+
return directive.name.value === "skip" ? !evaledValue : evaledValue;
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
function getDirectiveNames(root) {
|
|
@@ -36,15 +37,18 @@ function getDirectiveNames(root) {
|
|
|
36
37
|
});
|
|
37
38
|
return names;
|
|
38
39
|
}
|
|
39
|
-
var hasAnyDirectives = function (names, root) {
|
|
40
|
-
|
|
40
|
+
var hasAnyDirectives = function (names, root) {
|
|
41
|
+
return hasDirectives(names, root, false);
|
|
42
|
+
};
|
|
43
|
+
var hasAllDirectives = function (names, root) {
|
|
44
|
+
return hasDirectives(names, root, true);
|
|
45
|
+
};
|
|
41
46
|
function hasDirectives(names, root, all) {
|
|
42
47
|
var nameSet = new Set(names);
|
|
43
48
|
var uniqueCount = nameSet.size;
|
|
44
49
|
graphql.visit(root, {
|
|
45
50
|
Directive: function (node) {
|
|
46
|
-
if (nameSet.delete(node.name.value) &&
|
|
47
|
-
(!all || !nameSet.size)) {
|
|
51
|
+
if (nameSet.delete(node.name.value) && (!all || !nameSet.size)) {
|
|
48
52
|
return graphql.BREAK;
|
|
49
53
|
}
|
|
50
54
|
},
|
|
@@ -52,11 +56,11 @@ function hasDirectives(names, root, all) {
|
|
|
52
56
|
return all ? !nameSet.size : nameSet.size < uniqueCount;
|
|
53
57
|
}
|
|
54
58
|
function hasClientExports(document) {
|
|
55
|
-
return document && hasDirectives([
|
|
59
|
+
return document && hasDirectives(["client", "export"], document, true);
|
|
56
60
|
}
|
|
57
61
|
function isInclusionDirective(_a) {
|
|
58
62
|
var value = _a.name.value;
|
|
59
|
-
return value ===
|
|
63
|
+
return value === "skip" || value === "include";
|
|
60
64
|
}
|
|
61
65
|
function getInclusionDirectives(directives) {
|
|
62
66
|
var result = [];
|
|
@@ -68,32 +72,31 @@ function getInclusionDirectives(directives) {
|
|
|
68
72
|
var directiveName = directive.name.value;
|
|
69
73
|
globals.invariant(directiveArguments && directiveArguments.length === 1, 65, directiveName);
|
|
70
74
|
var ifArgument = directiveArguments[0];
|
|
71
|
-
globals.invariant(ifArgument.name && ifArgument.name.value ===
|
|
75
|
+
globals.invariant(ifArgument.name && ifArgument.name.value === "if", 66, directiveName);
|
|
72
76
|
var ifValue = ifArgument.value;
|
|
73
77
|
globals.invariant(ifValue &&
|
|
74
|
-
(ifValue.kind ===
|
|
78
|
+
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 67, directiveName);
|
|
75
79
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
76
80
|
});
|
|
77
81
|
}
|
|
78
82
|
return result;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
var canUseWeakMap = typeof WeakMap ===
|
|
82
|
-
globals.maybe(function () { return navigator.product; }) !==
|
|
83
|
-
var canUseWeakSet = typeof WeakSet ===
|
|
84
|
-
var canUseSymbol = typeof Symbol ===
|
|
85
|
-
typeof Symbol.for === 'function';
|
|
85
|
+
var canUseWeakMap = typeof WeakMap === "function" &&
|
|
86
|
+
globals.maybe(function () { return navigator.product; }) !== "ReactNative";
|
|
87
|
+
var canUseWeakSet = typeof WeakSet === "function";
|
|
88
|
+
var canUseSymbol = typeof Symbol === "function" && typeof Symbol.for === "function";
|
|
86
89
|
var canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;
|
|
87
90
|
var canUseDOM = typeof globals.maybe(function () { return window.document.createElement; }) === "function";
|
|
88
91
|
var usingJSDOM = globals.maybe(function () { return navigator.userAgent.indexOf("jsdom") >= 0; }) || false;
|
|
89
92
|
var canUseLayoutEffect = canUseDOM && !usingJSDOM;
|
|
90
93
|
|
|
91
94
|
function isNonNullObject(obj) {
|
|
92
|
-
return obj !== null && typeof obj ===
|
|
95
|
+
return obj !== null && typeof obj === "object";
|
|
93
96
|
}
|
|
94
97
|
function isPlainObject(obj) {
|
|
95
98
|
return (obj !== null &&
|
|
96
|
-
typeof obj ===
|
|
99
|
+
typeof obj === "object" &&
|
|
97
100
|
(Object.getPrototypeOf(obj) === Object.prototype ||
|
|
98
101
|
Object.getPrototypeOf(obj) === null));
|
|
99
102
|
}
|
|
@@ -102,32 +105,32 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
102
105
|
var actualFragmentName = fragmentName;
|
|
103
106
|
var fragments = [];
|
|
104
107
|
document.definitions.forEach(function (definition) {
|
|
105
|
-
if (definition.kind ===
|
|
108
|
+
if (definition.kind === "OperationDefinition") {
|
|
106
109
|
throw globals.newInvariantError(
|
|
107
110
|
68,
|
|
108
111
|
definition.operation,
|
|
109
|
-
definition.name ? " named '".concat(definition.name.value, "'") :
|
|
112
|
+
definition.name ? " named '".concat(definition.name.value, "'") : ""
|
|
110
113
|
);
|
|
111
114
|
}
|
|
112
|
-
if (definition.kind ===
|
|
115
|
+
if (definition.kind === "FragmentDefinition") {
|
|
113
116
|
fragments.push(definition);
|
|
114
117
|
}
|
|
115
118
|
});
|
|
116
|
-
if (typeof actualFragmentName ===
|
|
119
|
+
if (typeof actualFragmentName === "undefined") {
|
|
117
120
|
globals.invariant(fragments.length === 1, 69, fragments.length);
|
|
118
121
|
actualFragmentName = fragments[0].name.value;
|
|
119
122
|
}
|
|
120
123
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
121
124
|
{
|
|
122
|
-
kind:
|
|
123
|
-
operation:
|
|
125
|
+
kind: "OperationDefinition",
|
|
126
|
+
operation: "query",
|
|
124
127
|
selectionSet: {
|
|
125
|
-
kind:
|
|
128
|
+
kind: "SelectionSet",
|
|
126
129
|
selections: [
|
|
127
130
|
{
|
|
128
|
-
kind:
|
|
131
|
+
kind: "FragmentSpread",
|
|
129
132
|
name: {
|
|
130
|
-
kind:
|
|
133
|
+
kind: "Name",
|
|
131
134
|
value: actualFragmentName,
|
|
132
135
|
},
|
|
133
136
|
},
|
|
@@ -147,9 +150,9 @@ function createFragmentMap(fragments) {
|
|
|
147
150
|
}
|
|
148
151
|
function getFragmentFromSelection(selection, fragmentMap) {
|
|
149
152
|
switch (selection.kind) {
|
|
150
|
-
case
|
|
153
|
+
case "InlineFragment":
|
|
151
154
|
return selection;
|
|
152
|
-
case
|
|
155
|
+
case "FragmentSpread": {
|
|
153
156
|
var fragmentName = selection.name.value;
|
|
154
157
|
if (typeof fragmentMap === "function") {
|
|
155
158
|
return fragmentMap(fragmentName);
|
|
@@ -167,7 +170,7 @@ function makeReference(id) {
|
|
|
167
170
|
return { __ref: String(id) };
|
|
168
171
|
}
|
|
169
172
|
function isReference(obj) {
|
|
170
|
-
return Boolean(obj && typeof obj ===
|
|
173
|
+
return Boolean(obj && typeof obj === "object" && typeof obj.__ref === "string");
|
|
171
174
|
}
|
|
172
175
|
function isDocumentNode(value) {
|
|
173
176
|
return (isNonNullObject(value) &&
|
|
@@ -175,31 +178,31 @@ function isDocumentNode(value) {
|
|
|
175
178
|
Array.isArray(value.definitions));
|
|
176
179
|
}
|
|
177
180
|
function isStringValue(value) {
|
|
178
|
-
return value.kind ===
|
|
181
|
+
return value.kind === "StringValue";
|
|
179
182
|
}
|
|
180
183
|
function isBooleanValue(value) {
|
|
181
|
-
return value.kind ===
|
|
184
|
+
return value.kind === "BooleanValue";
|
|
182
185
|
}
|
|
183
186
|
function isIntValue(value) {
|
|
184
|
-
return value.kind ===
|
|
187
|
+
return value.kind === "IntValue";
|
|
185
188
|
}
|
|
186
189
|
function isFloatValue(value) {
|
|
187
|
-
return value.kind ===
|
|
190
|
+
return value.kind === "FloatValue";
|
|
188
191
|
}
|
|
189
192
|
function isVariable(value) {
|
|
190
|
-
return value.kind ===
|
|
193
|
+
return value.kind === "Variable";
|
|
191
194
|
}
|
|
192
195
|
function isObjectValue(value) {
|
|
193
|
-
return value.kind ===
|
|
196
|
+
return value.kind === "ObjectValue";
|
|
194
197
|
}
|
|
195
198
|
function isListValue(value) {
|
|
196
|
-
return value.kind ===
|
|
199
|
+
return value.kind === "ListValue";
|
|
197
200
|
}
|
|
198
201
|
function isEnumValue(value) {
|
|
199
|
-
return value.kind ===
|
|
202
|
+
return value.kind === "EnumValue";
|
|
200
203
|
}
|
|
201
204
|
function isNullValue(value) {
|
|
202
|
-
return value.kind ===
|
|
205
|
+
return value.kind === "NullValue";
|
|
203
206
|
}
|
|
204
207
|
function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
205
208
|
if (isIntValue(value) || isFloatValue(value)) {
|
|
@@ -261,33 +264,33 @@ function storeKeyNameFromField(field, variables) {
|
|
|
261
264
|
return getStoreKeyName(field.name.value, argObj, directivesObj);
|
|
262
265
|
}
|
|
263
266
|
var KNOWN_DIRECTIVES = [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
"connection",
|
|
268
|
+
"include",
|
|
269
|
+
"skip",
|
|
270
|
+
"client",
|
|
271
|
+
"rest",
|
|
272
|
+
"export",
|
|
273
|
+
"nonreactive",
|
|
271
274
|
];
|
|
272
275
|
var getStoreKeyName = Object.assign(function (fieldName, args, directives) {
|
|
273
276
|
if (args &&
|
|
274
277
|
directives &&
|
|
275
|
-
directives[
|
|
276
|
-
directives[
|
|
277
|
-
if (directives[
|
|
278
|
-
directives[
|
|
279
|
-
var filterKeys = directives[
|
|
280
|
-
? directives[
|
|
278
|
+
directives["connection"] &&
|
|
279
|
+
directives["connection"]["key"]) {
|
|
280
|
+
if (directives["connection"]["filter"] &&
|
|
281
|
+
directives["connection"]["filter"].length > 0) {
|
|
282
|
+
var filterKeys = directives["connection"]["filter"]
|
|
283
|
+
? directives["connection"]["filter"]
|
|
281
284
|
: [];
|
|
282
285
|
filterKeys.sort();
|
|
283
286
|
var filteredArgs_1 = {};
|
|
284
287
|
filterKeys.forEach(function (key) {
|
|
285
288
|
filteredArgs_1[key] = args[key];
|
|
286
289
|
});
|
|
287
|
-
return "".concat(directives[
|
|
290
|
+
return "".concat(directives["connection"]["key"], "(").concat(stringify(filteredArgs_1), ")");
|
|
288
291
|
}
|
|
289
292
|
else {
|
|
290
|
-
return directives[
|
|
293
|
+
return directives["connection"]["key"];
|
|
291
294
|
}
|
|
292
295
|
}
|
|
293
296
|
var completeFieldName = fieldName;
|
|
@@ -320,7 +323,9 @@ var stringify = function defaultStringify(value) {
|
|
|
320
323
|
};
|
|
321
324
|
function stringifyReplacer(_key, value) {
|
|
322
325
|
if (isNonNullObject(value) && !Array.isArray(value)) {
|
|
323
|
-
value = Object.keys(value)
|
|
326
|
+
value = Object.keys(value)
|
|
327
|
+
.sort()
|
|
328
|
+
.reduce(function (copy, key) {
|
|
324
329
|
copy[key] = value[key];
|
|
325
330
|
return copy;
|
|
326
331
|
}, {});
|
|
@@ -346,7 +351,7 @@ function getTypenameFromResult(result, selectionSet, fragmentMap) {
|
|
|
346
351
|
for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {
|
|
347
352
|
var selection = _a[_i];
|
|
348
353
|
if (isField(selection)) {
|
|
349
|
-
if (selection.name.value ===
|
|
354
|
+
if (selection.name.value === "__typename") {
|
|
350
355
|
return result[resultKeyNameFromField(selection)];
|
|
351
356
|
}
|
|
352
357
|
}
|
|
@@ -357,32 +362,32 @@ function getTypenameFromResult(result, selectionSet, fragmentMap) {
|
|
|
357
362
|
fragments = [selection];
|
|
358
363
|
}
|
|
359
364
|
}
|
|
360
|
-
if (typeof result.__typename ===
|
|
365
|
+
if (typeof result.__typename === "string") {
|
|
361
366
|
return result.__typename;
|
|
362
367
|
}
|
|
363
368
|
if (fragments) {
|
|
364
369
|
for (var _b = 0, fragments_1 = fragments; _b < fragments_1.length; _b++) {
|
|
365
370
|
var selection = fragments_1[_b];
|
|
366
371
|
var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);
|
|
367
|
-
if (typeof typename ===
|
|
372
|
+
if (typeof typename === "string") {
|
|
368
373
|
return typename;
|
|
369
374
|
}
|
|
370
375
|
}
|
|
371
376
|
}
|
|
372
377
|
}
|
|
373
378
|
function isField(selection) {
|
|
374
|
-
return selection.kind ===
|
|
379
|
+
return selection.kind === "Field";
|
|
375
380
|
}
|
|
376
381
|
function isInlineFragment(selection) {
|
|
377
|
-
return selection.kind ===
|
|
382
|
+
return selection.kind === "InlineFragment";
|
|
378
383
|
}
|
|
379
384
|
|
|
380
385
|
function checkDocument(doc) {
|
|
381
|
-
globals.invariant(doc && doc.kind ===
|
|
386
|
+
globals.invariant(doc && doc.kind === "Document", 71);
|
|
382
387
|
var operations = doc.definitions
|
|
383
|
-
.filter(function (d) { return d.kind !==
|
|
388
|
+
.filter(function (d) { return d.kind !== "FragmentDefinition"; })
|
|
384
389
|
.map(function (definition) {
|
|
385
|
-
if (definition.kind !==
|
|
390
|
+
if (definition.kind !== "OperationDefinition") {
|
|
386
391
|
throw globals.newInvariantError(72, definition.kind);
|
|
387
392
|
}
|
|
388
393
|
return definition;
|
|
@@ -393,31 +398,31 @@ function checkDocument(doc) {
|
|
|
393
398
|
function getOperationDefinition(doc) {
|
|
394
399
|
checkDocument(doc);
|
|
395
400
|
return doc.definitions.filter(function (definition) {
|
|
396
|
-
return definition.kind ===
|
|
401
|
+
return definition.kind === "OperationDefinition";
|
|
397
402
|
})[0];
|
|
398
403
|
}
|
|
399
404
|
function getOperationName(doc) {
|
|
400
405
|
return (doc.definitions
|
|
401
406
|
.filter(function (definition) {
|
|
402
|
-
return definition.kind ===
|
|
407
|
+
return definition.kind === "OperationDefinition" && !!definition.name;
|
|
403
408
|
})
|
|
404
409
|
.map(function (x) { return x.name.value; })[0] || null);
|
|
405
410
|
}
|
|
406
411
|
function getFragmentDefinitions(doc) {
|
|
407
412
|
return doc.definitions.filter(function (definition) {
|
|
408
|
-
return definition.kind ===
|
|
413
|
+
return definition.kind === "FragmentDefinition";
|
|
409
414
|
});
|
|
410
415
|
}
|
|
411
416
|
function getQueryDefinition(doc) {
|
|
412
417
|
var queryDef = getOperationDefinition(doc);
|
|
413
|
-
globals.invariant(queryDef && queryDef.operation ===
|
|
418
|
+
globals.invariant(queryDef && queryDef.operation === "query", 74);
|
|
414
419
|
return queryDef;
|
|
415
420
|
}
|
|
416
421
|
function getFragmentDefinition(doc) {
|
|
417
|
-
globals.invariant(doc.kind ===
|
|
422
|
+
globals.invariant(doc.kind === "Document", 75);
|
|
418
423
|
globals.invariant(doc.definitions.length <= 1, 76);
|
|
419
424
|
var fragmentDef = doc.definitions[0];
|
|
420
|
-
globals.invariant(fragmentDef.kind ===
|
|
425
|
+
globals.invariant(fragmentDef.kind === "FragmentDefinition", 77);
|
|
421
426
|
return fragmentDef;
|
|
422
427
|
}
|
|
423
428
|
function getMainDefinition(queryDoc) {
|
|
@@ -425,15 +430,15 @@ function getMainDefinition(queryDoc) {
|
|
|
425
430
|
var fragmentDefinition;
|
|
426
431
|
for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) {
|
|
427
432
|
var definition = _a[_i];
|
|
428
|
-
if (definition.kind ===
|
|
433
|
+
if (definition.kind === "OperationDefinition") {
|
|
429
434
|
var operation = definition.operation;
|
|
430
|
-
if (operation ===
|
|
431
|
-
operation ===
|
|
432
|
-
operation ===
|
|
435
|
+
if (operation === "query" ||
|
|
436
|
+
operation === "mutation" ||
|
|
437
|
+
operation === "subscription") {
|
|
433
438
|
return definition;
|
|
434
439
|
}
|
|
435
440
|
}
|
|
436
|
-
if (definition.kind ===
|
|
441
|
+
if (definition.kind === "FragmentDefinition" && !fragmentDefinition) {
|
|
437
442
|
fragmentDefinition = definition;
|
|
438
443
|
}
|
|
439
444
|
}
|
|
@@ -539,12 +544,15 @@ var TYPENAME_FIELD = {
|
|
|
539
544
|
kind: graphql.Kind.FIELD,
|
|
540
545
|
name: {
|
|
541
546
|
kind: graphql.Kind.NAME,
|
|
542
|
-
value:
|
|
547
|
+
value: "__typename",
|
|
543
548
|
},
|
|
544
549
|
};
|
|
545
550
|
function isEmpty(op, fragmentMap) {
|
|
546
|
-
return !op ||
|
|
547
|
-
|
|
551
|
+
return (!op ||
|
|
552
|
+
op.selectionSet.selections.every(function (selection) {
|
|
553
|
+
return selection.kind === graphql.Kind.FRAGMENT_SPREAD &&
|
|
554
|
+
isEmpty(fragmentMap[selection.name.value], fragmentMap);
|
|
555
|
+
}));
|
|
548
556
|
}
|
|
549
557
|
function nullIfDocIsEmpty(doc) {
|
|
550
558
|
return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))
|
|
@@ -582,10 +590,10 @@ function makeInUseGetterFunction(defaultKey) {
|
|
|
582
590
|
if (key === void 0) { key = defaultKey; }
|
|
583
591
|
var inUse = map.get(key);
|
|
584
592
|
if (!inUse) {
|
|
585
|
-
map.set(key, inUse = {
|
|
586
|
-
variables: new Set,
|
|
587
|
-
fragmentSpreads: new Set,
|
|
588
|
-
});
|
|
593
|
+
map.set(key, (inUse = {
|
|
594
|
+
variables: new Set(),
|
|
595
|
+
fragmentSpreads: new Set(),
|
|
596
|
+
}));
|
|
589
597
|
}
|
|
590
598
|
return inUse;
|
|
591
599
|
};
|
|
@@ -615,8 +623,12 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
615
623
|
}
|
|
616
624
|
}
|
|
617
625
|
var directiveMatcher = getDirectiveMatcher(directives);
|
|
618
|
-
var shouldRemoveField = function (nodeDirectives) {
|
|
619
|
-
|
|
626
|
+
var shouldRemoveField = function (nodeDirectives) {
|
|
627
|
+
return isNonEmptyArray(nodeDirectives) &&
|
|
628
|
+
nodeDirectives
|
|
629
|
+
.map(directiveMatcher)
|
|
630
|
+
.some(function (config) { return config && config.remove; });
|
|
631
|
+
};
|
|
620
632
|
var originalFragmentDefsByPath = new Map();
|
|
621
633
|
var firstVisitMadeChanges = false;
|
|
622
634
|
var fieldOrInlineFragmentVisitor = {
|
|
@@ -665,8 +677,10 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
665
677
|
return node;
|
|
666
678
|
}
|
|
667
679
|
if (operationCount > 0 &&
|
|
668
|
-
node.selectionSet.selections.every(function (selection) {
|
|
669
|
-
selection.
|
|
680
|
+
node.selectionSet.selections.every(function (selection) {
|
|
681
|
+
return selection.kind === graphql.Kind.FIELD &&
|
|
682
|
+
selection.name.value === "__typename";
|
|
683
|
+
})) {
|
|
670
684
|
getInUseByFragmentName(node.name.value).removed = true;
|
|
671
685
|
firstVisitMadeChanges = true;
|
|
672
686
|
return null;
|
|
@@ -716,8 +730,10 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
716
730
|
allFragmentNamesUsed.add(childFragmentName);
|
|
717
731
|
});
|
|
718
732
|
});
|
|
719
|
-
var fragmentWillBeRemoved = function (fragmentName) {
|
|
720
|
-
|
|
733
|
+
var fragmentWillBeRemoved = function (fragmentName) {
|
|
734
|
+
return !!((!allFragmentNamesUsed.has(fragmentName) ||
|
|
735
|
+
getInUseByFragmentName(fragmentName).removed));
|
|
736
|
+
};
|
|
721
737
|
var enterVisitor = {
|
|
722
738
|
enter: function (node) {
|
|
723
739
|
if (fragmentWillBeRemoved(node.name.value)) {
|
|
@@ -733,7 +749,9 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
733
749
|
if (node.variableDefinitions) {
|
|
734
750
|
var usedVariableNames_1 = populateTransitiveVars(getInUseByOperationName(node.name && node.name.value)).transitiveVars;
|
|
735
751
|
if (usedVariableNames_1.size < node.variableDefinitions.length) {
|
|
736
|
-
return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) {
|
|
752
|
+
return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) {
|
|
753
|
+
return usedVariableNames_1.has(varDef.variable.name.value);
|
|
754
|
+
}) });
|
|
737
755
|
}
|
|
738
756
|
}
|
|
739
757
|
},
|
|
@@ -745,7 +763,8 @@ var addTypenameToDocument = Object.assign(function (doc) {
|
|
|
745
763
|
SelectionSet: {
|
|
746
764
|
enter: function (node, _key, parent) {
|
|
747
765
|
if (parent &&
|
|
748
|
-
parent.kind ===
|
|
766
|
+
parent.kind ===
|
|
767
|
+
graphql.Kind.OPERATION_DEFINITION) {
|
|
749
768
|
return;
|
|
750
769
|
}
|
|
751
770
|
var selections = node.selections;
|
|
@@ -754,8 +773,8 @@ var addTypenameToDocument = Object.assign(function (doc) {
|
|
|
754
773
|
}
|
|
755
774
|
var skip = selections.some(function (selection) {
|
|
756
775
|
return (isField(selection) &&
|
|
757
|
-
(selection.name.value ===
|
|
758
|
-
selection.name.value.lastIndexOf(
|
|
776
|
+
(selection.name.value === "__typename" ||
|
|
777
|
+
selection.name.value.lastIndexOf("__", 0) === 0));
|
|
759
778
|
});
|
|
760
779
|
if (skip) {
|
|
761
780
|
return;
|
|
@@ -763,7 +782,7 @@ var addTypenameToDocument = Object.assign(function (doc) {
|
|
|
763
782
|
var field = parent;
|
|
764
783
|
if (isField(field) &&
|
|
765
784
|
field.directives &&
|
|
766
|
-
field.directives.some(function (d) { return d.name.value ===
|
|
785
|
+
field.directives.some(function (d) { return d.name.value === "export"; })) {
|
|
767
786
|
return;
|
|
768
787
|
}
|
|
769
788
|
return tslib.__assign(tslib.__assign({}, node), { selections: tslib.__spreadArray(tslib.__spreadArray([], selections, true), [TYPENAME_FIELD], false) });
|
|
@@ -777,10 +796,10 @@ var addTypenameToDocument = Object.assign(function (doc) {
|
|
|
777
796
|
});
|
|
778
797
|
var connectionRemoveConfig = {
|
|
779
798
|
test: function (directive) {
|
|
780
|
-
var willRemove = directive.name.value ===
|
|
799
|
+
var willRemove = directive.name.value === "connection";
|
|
781
800
|
if (willRemove) {
|
|
782
801
|
if (!directive.arguments ||
|
|
783
|
-
!directive.arguments.some(function (arg) { return arg.name.value ===
|
|
802
|
+
!directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
|
|
784
803
|
globalThis.__DEV__ !== false && globals.invariant.warn(81);
|
|
785
804
|
}
|
|
786
805
|
}
|
|
@@ -806,9 +825,11 @@ function removeArgumentsFromDocument(config, doc) {
|
|
|
806
825
|
return nullIfDocIsEmpty(graphql.visit(doc, {
|
|
807
826
|
OperationDefinition: {
|
|
808
827
|
enter: function (node) {
|
|
809
|
-
return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions
|
|
810
|
-
|
|
811
|
-
|
|
828
|
+
return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions
|
|
829
|
+
? node.variableDefinitions.filter(function (varDef) {
|
|
830
|
+
return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });
|
|
831
|
+
})
|
|
832
|
+
: [] });
|
|
812
833
|
},
|
|
813
834
|
},
|
|
814
835
|
Field: {
|
|
@@ -852,13 +873,13 @@ function removeFragmentSpreadFromDocument(config, doc) {
|
|
|
852
873
|
function buildQueryFromSelectionSet(document) {
|
|
853
874
|
var definition = getMainDefinition(document);
|
|
854
875
|
var definitionOperation = definition.operation;
|
|
855
|
-
if (definitionOperation ===
|
|
876
|
+
if (definitionOperation === "query") {
|
|
856
877
|
return document;
|
|
857
878
|
}
|
|
858
879
|
var modifiedDoc = graphql.visit(document, {
|
|
859
880
|
OperationDefinition: {
|
|
860
881
|
enter: function (node) {
|
|
861
|
-
return tslib.__assign(tslib.__assign({}, node), { operation:
|
|
882
|
+
return tslib.__assign(tslib.__assign({}, node), { operation: "query" });
|
|
862
883
|
},
|
|
863
884
|
},
|
|
864
885
|
});
|
|
@@ -868,7 +889,7 @@ function removeClientSetsFromDocument(document) {
|
|
|
868
889
|
checkDocument(document);
|
|
869
890
|
var modifiedDoc = removeDirectivesFromDocument([
|
|
870
891
|
{
|
|
871
|
-
test: function (directive) { return directive.name.value ===
|
|
892
|
+
test: function (directive) { return directive.name.value === "client"; },
|
|
872
893
|
remove: true,
|
|
873
894
|
},
|
|
874
895
|
], document);
|
|
@@ -929,7 +950,9 @@ var DeepMerger = (function () {
|
|
|
929
950
|
if (hasOwnProperty.call(target, sourceKey)) {
|
|
930
951
|
var targetValue = target[sourceKey];
|
|
931
952
|
if (source[sourceKey] !== targetValue) {
|
|
932
|
-
var result = _this.reconciler.apply(_this, tslib.__spreadArray([target,
|
|
953
|
+
var result = _this.reconciler.apply(_this, tslib.__spreadArray([target,
|
|
954
|
+
source,
|
|
955
|
+
sourceKey], context, false));
|
|
933
956
|
if (result !== targetValue) {
|
|
934
957
|
target = _this.shallowCopyForMerge(target);
|
|
935
958
|
target[sourceKey] = result;
|
|
@@ -1027,12 +1050,14 @@ function relayStylePagination(keyArgs) {
|
|
|
1027
1050
|
if (!incoming) {
|
|
1028
1051
|
return existing;
|
|
1029
1052
|
}
|
|
1030
|
-
var incomingEdges = incoming.edges
|
|
1031
|
-
|
|
1032
|
-
edge
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1053
|
+
var incomingEdges = incoming.edges
|
|
1054
|
+
? incoming.edges.map(function (edge) {
|
|
1055
|
+
if (isReference((edge = tslib.__assign({}, edge)))) {
|
|
1056
|
+
edge.cursor = readField("cursor", edge);
|
|
1057
|
+
}
|
|
1058
|
+
return edge;
|
|
1059
|
+
})
|
|
1060
|
+
: [];
|
|
1036
1061
|
if (incoming.pageInfo) {
|
|
1037
1062
|
var pageInfo_1 = incoming.pageInfo;
|
|
1038
1063
|
var startCursor = pageInfo_1.startCursor, endCursor = pageInfo_1.endCursor;
|
|
@@ -1158,7 +1183,7 @@ function cloneDeep(value) {
|
|
|
1158
1183
|
function cloneDeepHelper(val, seen) {
|
|
1159
1184
|
switch (toString.call(val)) {
|
|
1160
1185
|
case "[object Array]": {
|
|
1161
|
-
seen = seen || new Map;
|
|
1186
|
+
seen = seen || new Map();
|
|
1162
1187
|
if (seen.has(val))
|
|
1163
1188
|
return seen.get(val);
|
|
1164
1189
|
var copy_1 = val.slice(0);
|
|
@@ -1169,7 +1194,7 @@ function cloneDeepHelper(val, seen) {
|
|
|
1169
1194
|
return copy_1;
|
|
1170
1195
|
}
|
|
1171
1196
|
case "[object Object]": {
|
|
1172
|
-
seen = seen || new Map;
|
|
1197
|
+
seen = seen || new Map();
|
|
1173
1198
|
if (seen.has(val))
|
|
1174
1199
|
return seen.get(val);
|
|
1175
1200
|
var copy_2 = Object.create(Object.getPrototypeOf(val));
|
|
@@ -1237,7 +1262,9 @@ function asyncMap(observable, mapFn, catchFn) {
|
|
|
1237
1262
|
return function (arg) {
|
|
1238
1263
|
++activeCallbackCount;
|
|
1239
1264
|
var both = function () { return examiner(arg); };
|
|
1240
|
-
promiseQueue = promiseQueue
|
|
1265
|
+
promiseQueue = promiseQueue
|
|
1266
|
+
.then(both, both)
|
|
1267
|
+
.then(function (result) {
|
|
1241
1268
|
--activeCallbackCount;
|
|
1242
1269
|
next && next.call(observer, result);
|
|
1243
1270
|
if (completed) {
|
|
@@ -1246,7 +1273,8 @@ function asyncMap(observable, mapFn, catchFn) {
|
|
|
1246
1273
|
}, function (error) {
|
|
1247
1274
|
--activeCallbackCount;
|
|
1248
1275
|
throw error;
|
|
1249
|
-
})
|
|
1276
|
+
})
|
|
1277
|
+
.catch(function (caught) {
|
|
1250
1278
|
error && error.call(observer, caught);
|
|
1251
1279
|
});
|
|
1252
1280
|
};
|
|
@@ -1324,8 +1352,7 @@ var Concast = (function (_super) {
|
|
|
1324
1352
|
if (sub)
|
|
1325
1353
|
setTimeout(function () { return sub.unsubscribe(); });
|
|
1326
1354
|
_this.sub = null;
|
|
1327
|
-
if (_this.latest &&
|
|
1328
|
-
_this.latest[0] === "next") {
|
|
1355
|
+
if (_this.latest && _this.latest[0] === "next") {
|
|
1329
1356
|
_this.resolve(_this.latest[1]);
|
|
1330
1357
|
}
|
|
1331
1358
|
else {
|
|
@@ -1335,7 +1362,7 @@ var Concast = (function (_super) {
|
|
|
1335
1362
|
iterateObserversSafely(_this.observers, "complete");
|
|
1336
1363
|
}
|
|
1337
1364
|
else if (isPromiseLike(value)) {
|
|
1338
|
-
value.then(function (obs) { return _this.sub = obs.subscribe(_this.handlers); });
|
|
1365
|
+
value.then(function (obs) { return (_this.sub = obs.subscribe(_this.handlers)); });
|
|
1339
1366
|
}
|
|
1340
1367
|
else {
|
|
1341
1368
|
_this.sub = value.subscribe(_this.handlers);
|
|
@@ -1374,9 +1401,7 @@ var Concast = (function (_super) {
|
|
|
1374
1401
|
if (method) {
|
|
1375
1402
|
method.call(observer, this.latest[1]);
|
|
1376
1403
|
}
|
|
1377
|
-
if (this.sub === null &&
|
|
1378
|
-
nextOrError === "next" &&
|
|
1379
|
-
observer.complete) {
|
|
1404
|
+
if (this.sub === null && nextOrError === "next" && observer.complete) {
|
|
1380
1405
|
observer.complete();
|
|
1381
1406
|
}
|
|
1382
1407
|
}
|
|
@@ -1388,15 +1413,14 @@ var Concast = (function (_super) {
|
|
|
1388
1413
|
}
|
|
1389
1414
|
};
|
|
1390
1415
|
Concast.prototype.removeObserver = function (observer) {
|
|
1391
|
-
if (this.observers.delete(observer) &&
|
|
1392
|
-
this.observers.size < 1) {
|
|
1416
|
+
if (this.observers.delete(observer) && this.observers.size < 1) {
|
|
1393
1417
|
this.handlers.complete();
|
|
1394
1418
|
}
|
|
1395
1419
|
};
|
|
1396
1420
|
Concast.prototype.notify = function (method, arg) {
|
|
1397
1421
|
var nextResultListeners = this.nextResultListeners;
|
|
1398
1422
|
if (nextResultListeners.size) {
|
|
1399
|
-
this.nextResultListeners = new Set;
|
|
1423
|
+
this.nextResultListeners = new Set();
|
|
1400
1424
|
nextResultListeners.forEach(function (listener) { return listener(method, arg); });
|
|
1401
1425
|
}
|
|
1402
1426
|
};
|
|
@@ -1496,7 +1520,9 @@ function stringifyForDisplay(value, space) {
|
|
|
1496
1520
|
var undefId = makeUniqueId("stringifyForDisplay");
|
|
1497
1521
|
return JSON.stringify(value, function (key, value) {
|
|
1498
1522
|
return value === void 0 ? undefId : value;
|
|
1499
|
-
}, space)
|
|
1523
|
+
}, space)
|
|
1524
|
+
.split(JSON.stringify(undefId))
|
|
1525
|
+
.join("<undefined>");
|
|
1500
1526
|
}
|
|
1501
1527
|
|
|
1502
1528
|
function mergeOptions(defaults, options) {
|
|
@@ -1505,26 +1531,6 @@ function mergeOptions(defaults, options) {
|
|
|
1505
1531
|
});
|
|
1506
1532
|
}
|
|
1507
1533
|
|
|
1508
|
-
function isNodeResponse(value) {
|
|
1509
|
-
return !!value.body;
|
|
1510
|
-
}
|
|
1511
|
-
function isReadableStream(value) {
|
|
1512
|
-
return !!value.getReader;
|
|
1513
|
-
}
|
|
1514
|
-
function isAsyncIterableIterator(value) {
|
|
1515
|
-
return !!(canUseAsyncIteratorSymbol &&
|
|
1516
|
-
value[Symbol.asyncIterator]);
|
|
1517
|
-
}
|
|
1518
|
-
function isStreamableBlob(value) {
|
|
1519
|
-
return !!value.stream;
|
|
1520
|
-
}
|
|
1521
|
-
function isBlob(value) {
|
|
1522
|
-
return !!value.arrayBuffer;
|
|
1523
|
-
}
|
|
1524
|
-
function isNodeReadableStream(value) {
|
|
1525
|
-
return !!value.pipe;
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
1534
|
function omitDeep(value, key) {
|
|
1529
1535
|
return __omitDeep(value, key);
|
|
1530
1536
|
}
|
|
@@ -1614,8 +1620,6 @@ exports.hasClientExports = hasClientExports;
|
|
|
1614
1620
|
exports.hasDirectives = hasDirectives;
|
|
1615
1621
|
exports.isApolloPayloadResult = isApolloPayloadResult;
|
|
1616
1622
|
exports.isArray = isArray;
|
|
1617
|
-
exports.isAsyncIterableIterator = isAsyncIterableIterator;
|
|
1618
|
-
exports.isBlob = isBlob;
|
|
1619
1623
|
exports.isDocumentNode = isDocumentNode;
|
|
1620
1624
|
exports.isExecutionPatchIncrementalResult = isExecutionPatchIncrementalResult;
|
|
1621
1625
|
exports.isExecutionPatchInitialResult = isExecutionPatchInitialResult;
|
|
@@ -1623,16 +1627,12 @@ exports.isExecutionPatchResult = isExecutionPatchResult;
|
|
|
1623
1627
|
exports.isField = isField;
|
|
1624
1628
|
exports.isInlineFragment = isInlineFragment;
|
|
1625
1629
|
exports.isMutationOperation = isMutationOperation;
|
|
1626
|
-
exports.isNodeReadableStream = isNodeReadableStream;
|
|
1627
|
-
exports.isNodeResponse = isNodeResponse;
|
|
1628
1630
|
exports.isNonEmptyArray = isNonEmptyArray;
|
|
1629
1631
|
exports.isNonNullObject = isNonNullObject;
|
|
1630
1632
|
exports.isPlainObject = isPlainObject;
|
|
1631
1633
|
exports.isQueryOperation = isQueryOperation;
|
|
1632
|
-
exports.isReadableStream = isReadableStream;
|
|
1633
1634
|
exports.isReference = isReference;
|
|
1634
1635
|
exports.isStatefulPromise = isStatefulPromise;
|
|
1635
|
-
exports.isStreamableBlob = isStreamableBlob;
|
|
1636
1636
|
exports.isSubscriptionOperation = isSubscriptionOperation;
|
|
1637
1637
|
exports.iterateObserversSafely = iterateObserversSafely;
|
|
1638
1638
|
exports.makeReference = makeReference;
|