@apollo/client 3.8.0-alpha.12 → 3.8.0-alpha.14
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 +272 -215
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +1 -1
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +1 -1
- package/cache/core/cache.d.ts +4 -4
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +2 -2
- package/cache/core/types/Cache.d.ts.map +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +4 -4
- package/cache/core/types/DataProxy.d.ts.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.d.ts +3 -3
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +5 -5
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts +1 -1
- package/cache/inmemory/fragmentRegistry.d.ts.map +1 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +6 -5
- package/cache/inmemory/helpers.d.ts.map +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +5 -5
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.d.ts +1 -1
- package/cache/inmemory/key-extractor.d.ts.map +1 -1
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/policies.d.ts +7 -6
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +1 -1
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.d.ts.map +1 -1
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +6 -6
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +6 -6
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +6 -6
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +10 -9
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +1 -1
- 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 +1 -1
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +9 -8
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +9 -9
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +6 -6
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +1 -1
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +1 -1
- package/core/equalByQuery.d.ts +2 -2
- package/core/equalByQuery.d.ts.map +1 -1
- package/core/equalByQuery.js.map +1 -1
- package/core/types.d.ts +11 -11
- package/core/types.d.ts.map +1 -1
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +6 -6
- package/core/watchQueryOptions.d.ts.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/errors/index.d.ts +4 -4
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +41 -29
- package/link/batch/batchLink.d.ts +4 -3
- package/link/batch/batchLink.d.ts.map +1 -1
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.d.ts +1 -1
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch-http/batchHttpLink.d.ts +3 -2
- package/link/batch-http/batchHttpLink.d.ts.map +1 -1
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/context/index.d.ts +3 -2
- package/link/context/index.d.ts.map +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.d.ts +3 -2
- package/link/core/ApolloLink.d.ts.map +1 -1
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/types.d.ts +4 -3
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +4 -3
- package/link/error/index.d.ts.map +1 -1
- package/link/error/index.js.map +1 -1
- package/link/http/HttpLink.d.ts +3 -2
- package/link/http/HttpLink.d.ts.map +1 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/createHttpLink.d.ts +1 -1
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +1 -1
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +1 -1
- package/link/http/iterators/nodeStream.d.ts +1 -1
- package/link/http/iterators/nodeStream.d.ts.map +1 -1
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/responseIterator.d.ts +1 -1
- package/link/http/responseIterator.d.ts.map +1 -1
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/rewriteURIForGET.d.ts +1 -1
- package/link/http/rewriteURIForGET.d.ts.map +1 -1
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +3 -2
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +1 -2
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.d.ts +1 -1
- package/link/http/selectURI.d.ts.map +1 -1
- package/link/http/selectURI.js.map +1 -1
- package/link/persisted-queries/index.d.ts +4 -3
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +12 -13
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs +12 -13
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +12 -13
- package/link/remove-typename/index.d.ts +2 -0
- package/link/remove-typename/index.d.ts.map +1 -0
- package/link/remove-typename/index.js +2 -0
- package/link/remove-typename/index.js.map +1 -0
- package/link/remove-typename/package.json +8 -0
- package/link/remove-typename/remove-typename.cjs +70 -0
- package/link/remove-typename/remove-typename.cjs.map +1 -0
- package/link/remove-typename/remove-typename.cjs.native.js +70 -0
- package/link/remove-typename/removeTypenameFromVariables.d.ts +11 -0
- package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -0
- package/link/remove-typename/removeTypenameFromVariables.js +62 -0
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -0
- package/link/retry/delayFunction.d.ts +1 -1
- package/link/retry/delayFunction.d.ts.map +1 -1
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/retryFunction.d.ts +1 -1
- package/link/retry/retryFunction.d.ts.map +1 -1
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.d.ts +4 -3
- package/link/retry/retryLink.d.ts.map +1 -1
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +3 -2
- package/link/schema/index.d.ts.map +1 -1
- package/link/schema/index.js.map +1 -1
- package/link/subscriptions/index.d.ts +2 -1
- package/link/subscriptions/index.d.ts.map +1 -1
- package/link/subscriptions/index.js +2 -2
- package/link/subscriptions/index.js.map +1 -1
- package/link/subscriptions/subscriptions.cjs +1 -1
- package/link/subscriptions/subscriptions.cjs.map +1 -1
- package/link/subscriptions/subscriptions.cjs.native.js +1 -1
- package/link/utils/createOperation.d.ts +1 -1
- package/link/utils/createOperation.d.ts.map +1 -1
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/filterOperationVariables.d.ts +1 -1
- package/link/utils/filterOperationVariables.d.ts.map +1 -1
- package/link/utils/filterOperationVariables.js.map +1 -1
- package/link/utils/throwServerError.d.ts +1 -1
- package/link/utils/throwServerError.d.ts.map +1 -1
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.d.ts +1 -1
- package/link/utils/toPromise.d.ts.map +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/transformOperation.d.ts +1 -1
- package/link/utils/transformOperation.d.ts.map +1 -1
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/validateOperation.d.ts +1 -1
- package/link/utils/validateOperation.d.ts.map +1 -1
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.d.ts +5 -3
- package/link/ws/index.d.ts.map +1 -1
- package/link/ws/index.js.map +1 -1
- package/package.json +26 -22
- package/react/cache/{QuerySubscription.d.ts → QueryReference.d.ts} +15 -7
- package/react/cache/QueryReference.d.ts.map +1 -0
- package/react/cache/QueryReference.js +107 -0
- package/react/cache/QueryReference.js.map +1 -0
- package/react/cache/SuspenseCache.d.ts +5 -5
- package/react/cache/SuspenseCache.d.ts.map +1 -1
- package/react/cache/SuspenseCache.js +8 -7
- package/react/cache/SuspenseCache.js.map +1 -1
- package/react/cache/types.d.ts +2 -0
- package/react/cache/types.d.ts.map +1 -0
- package/react/cache/types.js +2 -0
- package/react/cache/types.js.map +1 -0
- package/react/components/Mutation.d.ts +2 -2
- package/react/components/Mutation.d.ts.map +1 -1
- package/react/components/Mutation.js.map +1 -1
- package/react/components/Query.d.ts +2 -2
- package/react/components/Query.d.ts.map +1 -1
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.d.ts +2 -2
- package/react/components/Subscription.d.ts.map +1 -1
- package/react/components/Subscription.js.map +1 -1
- package/react/components/types.d.ts +4 -4
- package/react/components/types.d.ts.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.d.ts +1 -1
- package/react/context/ApolloConsumer.d.ts.map +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +10 -3
- package/react/context/ApolloContext.d.ts.map +1 -1
- package/react/context/ApolloContext.js +13 -8
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +2 -2
- package/react/context/ApolloProvider.d.ts.map +1 -1
- package/react/context/ApolloProvider.js +8 -12
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/context.cjs +22 -21
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +22 -21
- package/react/context/index.d.ts +1 -1
- package/react/context/index.d.ts.map +1 -1
- package/react/context/index.js +1 -1
- package/react/context/index.js.map +1 -1
- package/react/hoc/graphql.d.ts +3 -3
- package/react/hoc/graphql.d.ts.map +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +2 -2
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/mutation-hoc.d.ts +4 -4
- package/react/hoc/mutation-hoc.d.ts.map +1 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.d.ts +2 -2
- package/react/hoc/query-hoc.d.ts.map +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.d.ts +2 -2
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/types.d.ts +4 -4
- package/react/hoc/types.d.ts.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.d.ts +1 -1
- package/react/hoc/withApollo.d.ts.map +1 -1
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs +133 -69
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +133 -69
- package/react/hooks/index.d.ts +2 -1
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js +2 -1
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts.map +1 -1
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.d.ts.map +1 -1
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +18 -0
- package/react/hooks/useBackgroundQuery.d.ts.map +1 -0
- package/react/hooks/useBackgroundQuery.js +71 -0
- package/react/hooks/useBackgroundQuery.js.map +1 -0
- package/react/hooks/useFragment.d.ts +13 -8
- package/react/hooks/useFragment.d.ts.map +1 -1
- package/react/hooks/useFragment.js +1 -1
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +4 -4
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +4 -4
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +3 -3
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +2 -2
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -1
- package/react/hooks/useReactiveVar.d.ts.map +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +4 -4
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +25 -13
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseCache.d.ts +1 -1
- package/react/hooks/useSuspenseCache.d.ts.map +1 -1
- package/react/hooks/useSuspenseCache.js +1 -1
- package/react/hooks/useSuspenseCache.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +29 -7
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +44 -59
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/parser/index.d.ts +1 -1
- package/react/parser/index.d.ts.map +1 -1
- package/react/parser/index.js +5 -5
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/react/react.cjs +73 -51
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +73 -51
- package/react/ssr/RenderPromises.d.ts +2 -2
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/renderToStringWithData.d.ts +1 -1
- package/react/ssr/renderToStringWithData.d.ts.map +1 -1
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/types/types.d.ts +9 -11
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +1 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +1 -1
- package/testing/core/mocking/mockClient.d.ts +2 -2
- package/testing/core/mocking/mockClient.d.ts.map +1 -1
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +2 -1
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +2 -2
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +2 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
- package/testing/core/mocking/mockWatchQuery.js.map +1 -1
- package/testing/core/observableToPromise.d.ts +2 -2
- package/testing/core/observableToPromise.d.ts.map +1 -1
- package/testing/core/observableToPromise.js.map +1 -1
- package/testing/core/subscribeAndCount.d.ts +1 -1
- package/testing/core/subscribeAndCount.d.ts.map +1 -1
- package/testing/core/subscribeAndCount.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +7 -6
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js.map +1 -1
- package/utilities/common/compact.d.ts +1 -1
- package/utilities/common/compact.d.ts.map +1 -1
- package/utilities/common/compact.js.map +1 -1
- package/utilities/common/errorHandling.d.ts +1 -1
- package/utilities/common/errorHandling.d.ts.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/incrementalResult.d.ts +1 -1
- package/utilities/common/incrementalResult.d.ts.map +1 -1
- package/utilities/common/incrementalResult.js.map +1 -1
- package/utilities/common/omitDeep.d.ts +10 -2
- package/utilities/common/omitDeep.d.ts.map +1 -1
- package/utilities/common/omitDeep.js +22 -10
- package/utilities/common/omitDeep.js.map +1 -1
- package/utilities/common/responseIterator.d.ts +2 -2
- package/utilities/common/responseIterator.d.ts.map +1 -1
- package/utilities/common/responseIterator.js.map +1 -1
- package/utilities/common/stripTypename.d.ts +9 -1
- package/utilities/common/stripTypename.d.ts.map +1 -1
- package/utilities/common/stripTypename.js +3 -2
- package/utilities/common/stripTypename.js.map +1 -1
- package/utilities/globals/global.d.ts +6 -3
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/graphql/directives.d.ts +1 -1
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +4 -4
- 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 +3 -3
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts +1 -1
- package/utilities/graphql/getFromAST.d.ts.map +1 -1
- package/utilities/graphql/getFromAST.js +8 -8
- 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 +14 -4
- 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 +2 -2
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +3 -2
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.d.ts +2 -1
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/Observable.d.ts +2 -1
- package/utilities/observables/Observable.d.ts.map +1 -1
- package/utilities/observables/Observable.js +1 -1
- package/utilities/observables/Observable.js.map +1 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.d.ts +1 -1
- package/utilities/observables/iteration.d.ts.map +1 -1
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/policies/pagination.d.ts +1 -1
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/promises/decoration.d.ts +2 -0
- package/utilities/promises/decoration.d.ts.map +1 -1
- package/utilities/promises/decoration.js +12 -0
- package/utilities/promises/decoration.js.map +1 -1
- package/utilities/types/DeepOmit.d.ts +4 -3
- package/utilities/types/DeepOmit.d.ts.map +1 -1
- package/utilities/types/DeepOmit.js.map +1 -1
- package/utilities/types/DeepPartial.d.ts +12 -0
- package/utilities/types/DeepPartial.d.ts.map +1 -0
- package/utilities/types/DeepPartial.js +2 -0
- package/utilities/types/DeepPartial.js.map +1 -0
- package/utilities/types/Primitive.d.ts +2 -0
- package/utilities/types/Primitive.d.ts.map +1 -0
- package/utilities/types/Primitive.js +2 -0
- package/utilities/types/Primitive.js.map +1 -0
- package/utilities/utilities.cjs +68 -31
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +68 -31
- package/version.js +1 -1
- package/react/cache/QuerySubscription.d.ts.map +0 -1
- package/react/cache/QuerySubscription.js +0 -88
- package/react/cache/QuerySubscription.js.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
type Primitive
|
|
1
|
+
import type { Primitive } from './Primitive';
|
|
2
|
+
type DeepOmitPrimitive = Primitive | Function;
|
|
2
3
|
export type DeepOmitArray<T extends any[], K> = {
|
|
3
4
|
[P in keyof T]: DeepOmit<T[P], K>;
|
|
4
5
|
};
|
|
5
|
-
export type DeepOmit<T, K> = T extends
|
|
6
|
-
[P in Exclude<keyof T, K>]: T[P] extends infer TP ? TP extends
|
|
6
|
+
export type DeepOmit<T, K> = T extends DeepOmitPrimitive ? T : {
|
|
7
|
+
[P in Exclude<keyof T, K>]: T[P] extends infer TP ? TP extends DeepOmitPrimitive ? TP : TP extends any[] ? DeepOmitArray<TP, K> : DeepOmit<TP, K> : never;
|
|
7
8
|
};
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=DeepOmit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepOmit.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeepOmit.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,KAAK,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9C,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,IAAI;KAC7C,CAAC,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAClC,CAAC;AAcF,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,iBAAiB,GACpD,CAAC,GACD;KACG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,EAAE,GAC7C,EAAE,SAAS,iBAAiB,GAC1B,EAAE,GACF,EAAE,SAAS,GAAG,EAAE,GAChB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,GACpB,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,GACjB,KAAK;CACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepOmit.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"","sourcesContent":["// DeepOmit primitives include functions
|
|
1
|
+
{"version":3,"file":"DeepOmit.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"","sourcesContent":["import type { Primitive } from './Primitive';\n\n// DeepOmit primitives include functions since these are unmodified.\ntype DeepOmitPrimitive = Primitive | Function;\n\nexport type DeepOmitArray<T extends any[], K> = {\n [P in keyof T]: DeepOmit<T[P], K>;\n};\n\n// Unfortunately there is one major flaw in this type: This will omit properties\n// from class instances in the return type even though our omitDeep helper\n// ignores class instances, therefore resulting in a type mismatch between\n// the return value and the runtime value.\n//\n// It is not currently possible with TypeScript to distinguish between plain\n// objects and class instances.\n// https://github.com/microsoft/TypeScript/issues/29063\n//\n// This should be fine as of the time of this writing until omitDeep gets\n// broader use since this utility is only used to strip __typename from\n// `variables`; a case in which class instances are invalid anyways.\nexport type DeepOmit<T, K> = T extends DeepOmitPrimitive\n ? T\n : {\n [P in Exclude<keyof T, K>]: T[P] extends infer TP\n ? TP extends DeepOmitPrimitive\n ? TP\n : TP extends any[]\n ? DeepOmitArray<TP, K>\n : DeepOmit<TP, K>\n : never;\n };\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Primitive } from './Primitive';
|
|
2
|
+
type DeepPartialPrimitive = Primitive | Date | RegExp;
|
|
3
|
+
export type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends ReadonlyArray<infer TItem> ? TItem[] extends T ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;
|
|
4
|
+
type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;
|
|
5
|
+
type DeepPartialReadonlyMap<TKey, TValue> = {} & ReadonlyMap<DeepPartial<TKey>, DeepPartial<TValue>>;
|
|
6
|
+
type DeepPartialSet<T> = {} & Set<DeepPartial<T>>;
|
|
7
|
+
type DeepPartialReadonlySet<T> = {} & ReadonlySet<DeepPartial<T>>;
|
|
8
|
+
type DeepPartialObject<T extends object> = {
|
|
9
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=DeepPartial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeepPartial.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/DeepPartial.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,oBAAoB,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,oBAAoB,GACvD,CAAC,GACD,CAAC,SAAS,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,MAAM,CAAC,GACvC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,GAC5B,CAAC,SAAS,WAAW,CAAC,MAAM,IAAI,EAAE,MAAM,MAAM,CAAC,GAC/C,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,GACpC,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,GAC1B,cAAc,CAAC,KAAK,CAAC,GACrB,CAAC,SAAS,WAAW,CAAC,MAAM,KAAK,CAAC,GAClC,sBAAsB,CAAC,KAAK,CAAC,GAC7B,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,GACrC,CAAC,GAAG,SAAS,GACb,CAAC,SAAS,MAAM,GAChB,CAAC,SAAS,aAAa,CAAC,MAAM,KAAK,CAAC,GAClC,KAAK,EAAE,SAAS,CAAC,GACf,SAAS,KAAK,EAAE,SAAS,CAAC,GACxB,aAAa,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,GAC7C,KAAK,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,GACvC,iBAAiB,CAAC,CAAC,CAAC,GACtB,iBAAiB,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC;AAEZ,KAAK,cAAc,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,GAAG,GAAG,CAC1C,WAAW,CAAC,IAAI,CAAC,EACjB,WAAW,CAAC,MAAM,CAAC,CACpB,CAAC;AAEF,KAAK,sBAAsB,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,GAAG,WAAW,CAC1D,WAAW,CAAC,IAAI,CAAC,EACjB,WAAW,CAAC,MAAM,CAAC,CACpB,CAAC;AAEF,KAAK,cAAc,CAAC,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,KAAK,sBAAsB,CAAC,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAElE,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeepPartial.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepPartial.ts"],"names":[],"mappings":"","sourcesContent":["// Inspired by type-fest PartialDeep: https://github.com/sindresorhus/type-fest/blob/9feb8c89be9a0f2f688bf2f497230298a8e2472e/source/partial-deep.d.ts\n//\n// We're including the license to give credit to the original implementation.\n// https://github.com/sindresorhus/type-fest/blob/main/license-mit\n\n/*\n * MIT License\n *\n * Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nimport type { Primitive } from './Primitive';\n\ntype DeepPartialPrimitive = Primitive | Date | RegExp;\n\nexport type DeepPartial<T> = T extends DeepPartialPrimitive\n ? T\n : T extends Map<infer TKey, infer TValue>\n ? DeepPartialMap<TKey, TValue>\n : T extends ReadonlyMap<infer TKey, infer TValue>\n ? DeepPartialReadonlyMap<TKey, TValue>\n : T extends Set<infer TItem>\n ? DeepPartialSet<TItem>\n : T extends ReadonlySet<infer TItem>\n ? DeepPartialReadonlySet<TItem>\n : T extends (...args: any[]) => unknown\n ? T | undefined\n : T extends object\n ? T extends ReadonlyArray<infer TItem> // Test for arrays/tuples\n ? TItem[] extends T // Test for non-tuples\n ? readonly TItem[] extends T\n ? ReadonlyArray<DeepPartial<TItem | undefined>>\n : Array<DeepPartial<TItem | undefined>>\n : DeepPartialObject<T>\n : DeepPartialObject<T>\n : unknown;\n\ntype DeepPartialMap<TKey, TValue> = {} & Map<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialReadonlyMap<TKey, TValue> = {} & ReadonlyMap<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialSet<T> = {} & Set<DeepPartial<T>>;\ntype DeepPartialReadonlySet<T> = {} & ReadonlySet<DeepPartial<T>>;\n\ntype DeepPartialObject<T extends object> = {\n [K in keyof T]?: DeepPartial<T[K]>;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Primitive.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/Primitive.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Primitive.js","sourceRoot":"","sources":["../../../src/utilities/types/Primitive.ts"],"names":[],"mappings":"","sourcesContent":["// Matches any primitive value: https://developer.mozilla.org/en-US/docs/Glossary/Primitive.\nexport type Primitive =\n | null\n | undefined\n | string\n | number\n | boolean\n | symbol\n | bigint;\n"]}
|
package/utilities/utilities.cjs
CHANGED
|
@@ -18,7 +18,7 @@ function shouldInclude(_a, variables) {
|
|
|
18
18
|
var evaledValue = false;
|
|
19
19
|
if (ifArgument.value.kind === 'Variable') {
|
|
20
20
|
evaledValue = variables && variables[ifArgument.value.name.value];
|
|
21
|
-
globals.__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0,
|
|
21
|
+
globals.__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 43);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
evaledValue = ifArgument.value.value;
|
|
@@ -65,13 +65,13 @@ function getInclusionDirectives(directives) {
|
|
|
65
65
|
return;
|
|
66
66
|
var directiveArguments = directive.arguments;
|
|
67
67
|
var directiveName = directive.name.value;
|
|
68
|
-
globals.__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1,
|
|
68
|
+
globals.__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 44);
|
|
69
69
|
var ifArgument = directiveArguments[0];
|
|
70
|
-
globals.__DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if',
|
|
70
|
+
globals.__DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 45);
|
|
71
71
|
var ifValue = ifArgument.value;
|
|
72
72
|
globals.__DEV__ ? globals.invariant(ifValue &&
|
|
73
73
|
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @".concat(directiveName, " directive must be a variable or a boolean value.")) : globals.invariant(ifValue &&
|
|
74
|
-
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),
|
|
74
|
+
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 46);
|
|
75
75
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -84,14 +84,14 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
84
84
|
document.definitions.forEach(function (definition) {
|
|
85
85
|
if (definition.kind === 'OperationDefinition') {
|
|
86
86
|
throw globals.__DEV__ ? new globals.InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
|
|
87
|
-
'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(
|
|
87
|
+
'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(47);
|
|
88
88
|
}
|
|
89
89
|
if (definition.kind === 'FragmentDefinition') {
|
|
90
90
|
fragments.push(definition);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
if (typeof actualFragmentName === 'undefined') {
|
|
94
|
-
globals.__DEV__ ? globals.invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")) : globals.invariant(fragments.length === 1,
|
|
94
|
+
globals.__DEV__ ? globals.invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")) : globals.invariant(fragments.length === 1, 48);
|
|
95
95
|
actualFragmentName = fragments[0].name.value;
|
|
96
96
|
}
|
|
97
97
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
@@ -132,7 +132,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
132
132
|
return fragmentMap(fragmentName);
|
|
133
133
|
}
|
|
134
134
|
var fragment = fragmentMap && fragmentMap[fragmentName];
|
|
135
|
-
globals.__DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment,
|
|
135
|
+
globals.__DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 49);
|
|
136
136
|
return fragment || null;
|
|
137
137
|
}
|
|
138
138
|
default:
|
|
@@ -222,7 +222,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
222
222
|
else {
|
|
223
223
|
throw globals.__DEV__ ? new globals.InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
|
|
224
224
|
'is not supported. Use variables instead of inline arguments to ' +
|
|
225
|
-
'overcome this limitation.') : new globals.InvariantError(
|
|
225
|
+
'overcome this limitation.') : new globals.InvariantError(58);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
function storeKeyNameFromField(field, variables) {
|
|
@@ -331,9 +331,7 @@ function resultKeyNameFromField(field) {
|
|
|
331
331
|
return field.alias ? field.alias.value : field.name.value;
|
|
332
332
|
}
|
|
333
333
|
function getTypenameFromResult(result, selectionSet, fragmentMap) {
|
|
334
|
-
|
|
335
|
-
return result.__typename;
|
|
336
|
-
}
|
|
334
|
+
var fragments;
|
|
337
335
|
for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {
|
|
338
336
|
var selection = _a[_i];
|
|
339
337
|
if (isField(selection)) {
|
|
@@ -341,7 +339,19 @@ function getTypenameFromResult(result, selectionSet, fragmentMap) {
|
|
|
341
339
|
return result[resultKeyNameFromField(selection)];
|
|
342
340
|
}
|
|
343
341
|
}
|
|
342
|
+
else if (fragments) {
|
|
343
|
+
fragments.push(selection);
|
|
344
|
+
}
|
|
344
345
|
else {
|
|
346
|
+
fragments = [selection];
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (typeof result.__typename === 'string') {
|
|
350
|
+
return result.__typename;
|
|
351
|
+
}
|
|
352
|
+
if (fragments) {
|
|
353
|
+
for (var _b = 0, fragments_1 = fragments; _b < fragments_1.length; _b++) {
|
|
354
|
+
var selection = fragments_1[_b];
|
|
345
355
|
var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);
|
|
346
356
|
if (typeof typename === 'string') {
|
|
347
357
|
return typename;
|
|
@@ -357,16 +367,16 @@ function isInlineFragment(selection) {
|
|
|
357
367
|
}
|
|
358
368
|
|
|
359
369
|
function checkDocument(doc) {
|
|
360
|
-
globals.__DEV__ ? globals.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc && doc.kind === 'Document',
|
|
370
|
+
globals.__DEV__ ? globals.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc && doc.kind === 'Document', 50);
|
|
361
371
|
var operations = doc.definitions
|
|
362
372
|
.filter(function (d) { return d.kind !== 'FragmentDefinition'; })
|
|
363
373
|
.map(function (definition) {
|
|
364
374
|
if (definition.kind !== 'OperationDefinition') {
|
|
365
|
-
throw globals.__DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(
|
|
375
|
+
throw globals.__DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(51);
|
|
366
376
|
}
|
|
367
377
|
return definition;
|
|
368
378
|
});
|
|
369
|
-
globals.__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1,
|
|
379
|
+
globals.__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 52);
|
|
370
380
|
return doc;
|
|
371
381
|
}
|
|
372
382
|
function getOperationDefinition(doc) {
|
|
@@ -389,14 +399,14 @@ function getFragmentDefinitions(doc) {
|
|
|
389
399
|
}
|
|
390
400
|
function getQueryDefinition(doc) {
|
|
391
401
|
var queryDef = getOperationDefinition(doc);
|
|
392
|
-
globals.__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query',
|
|
402
|
+
globals.__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 53);
|
|
393
403
|
return queryDef;
|
|
394
404
|
}
|
|
395
405
|
function getFragmentDefinition(doc) {
|
|
396
|
-
globals.__DEV__ ? globals.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc.kind === 'Document',
|
|
397
|
-
globals.__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1,
|
|
406
|
+
globals.__DEV__ ? globals.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc.kind === 'Document', 54);
|
|
407
|
+
globals.__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 55);
|
|
398
408
|
var fragmentDef = doc.definitions[0];
|
|
399
|
-
globals.__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition',
|
|
409
|
+
globals.__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 56);
|
|
400
410
|
return fragmentDef;
|
|
401
411
|
}
|
|
402
412
|
function getMainDefinition(queryDoc) {
|
|
@@ -419,7 +429,7 @@ function getMainDefinition(queryDoc) {
|
|
|
419
429
|
if (fragmentDefinition) {
|
|
420
430
|
return fragmentDefinition;
|
|
421
431
|
}
|
|
422
|
-
throw globals.__DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(
|
|
432
|
+
throw globals.__DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(57);
|
|
423
433
|
}
|
|
424
434
|
function getDefaultValues(definition) {
|
|
425
435
|
var defaultValues = Object.create(null);
|
|
@@ -1001,6 +1011,18 @@ function makeEmptyData() {
|
|
|
1001
1011
|
};
|
|
1002
1012
|
}
|
|
1003
1013
|
|
|
1014
|
+
function createFulfilledPromise(value) {
|
|
1015
|
+
var promise = Promise.resolve(value);
|
|
1016
|
+
promise.status = 'fulfilled';
|
|
1017
|
+
promise.value = value;
|
|
1018
|
+
return promise;
|
|
1019
|
+
}
|
|
1020
|
+
function createRejectedPromise(reason) {
|
|
1021
|
+
var promise = Promise.reject(reason);
|
|
1022
|
+
promise.status = 'rejected';
|
|
1023
|
+
promise.reason = reason;
|
|
1024
|
+
return promise;
|
|
1025
|
+
}
|
|
1004
1026
|
function isStatefulPromise(promise) {
|
|
1005
1027
|
return 'status' in promise;
|
|
1006
1028
|
}
|
|
@@ -1409,11 +1431,15 @@ function isNodeReadableStream(value) {
|
|
|
1409
1431
|
return !!value.pipe;
|
|
1410
1432
|
}
|
|
1411
1433
|
|
|
1412
|
-
|
|
1413
|
-
|
|
1434
|
+
var BREAK = Symbol('BREAK');
|
|
1435
|
+
function omitDeep(value, key, options) {
|
|
1436
|
+
if (options === void 0) { options = Object.create(null); }
|
|
1437
|
+
return __omitDeep(value, key, options);
|
|
1414
1438
|
}
|
|
1415
|
-
|
|
1439
|
+
omitDeep.BREAK = BREAK;
|
|
1440
|
+
function __omitDeep(value, key, options, known, path) {
|
|
1416
1441
|
if (known === void 0) { known = new Map(); }
|
|
1442
|
+
if (path === void 0) { path = []; }
|
|
1417
1443
|
if (known.has(value)) {
|
|
1418
1444
|
return known.get(value);
|
|
1419
1445
|
}
|
|
@@ -1422,7 +1448,11 @@ function __omitDeep(value, key, known) {
|
|
|
1422
1448
|
var array_1 = [];
|
|
1423
1449
|
known.set(value, array_1);
|
|
1424
1450
|
value.forEach(function (value, index) {
|
|
1425
|
-
var
|
|
1451
|
+
var _a;
|
|
1452
|
+
var objectPath = path.concat(index);
|
|
1453
|
+
var result = ((_a = options.keep) === null || _a === void 0 ? void 0 : _a.call(options, objectPath)) === BREAK
|
|
1454
|
+
? value
|
|
1455
|
+
: __omitDeep(value, key, options, known, objectPath);
|
|
1426
1456
|
modified || (modified = result !== value);
|
|
1427
1457
|
array_1[index] = result;
|
|
1428
1458
|
});
|
|
@@ -1434,14 +1464,18 @@ function __omitDeep(value, key, known) {
|
|
|
1434
1464
|
var obj_1 = Object.create(Object.getPrototypeOf(value));
|
|
1435
1465
|
known.set(value, obj_1);
|
|
1436
1466
|
Object.keys(value).forEach(function (k) {
|
|
1437
|
-
|
|
1467
|
+
var _a;
|
|
1468
|
+
var objectPath = path.concat(k);
|
|
1469
|
+
var keep = (_a = options.keep) === null || _a === void 0 ? void 0 : _a.call(options, objectPath);
|
|
1470
|
+
if (k === key && keep !== true) {
|
|
1438
1471
|
modified = true;
|
|
1472
|
+
return;
|
|
1439
1473
|
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1474
|
+
var result = keep === BREAK
|
|
1475
|
+
? value[k]
|
|
1476
|
+
: __omitDeep(value[k], key, options, known, objectPath);
|
|
1477
|
+
modified || (modified = result !== value[k]);
|
|
1478
|
+
obj_1[k] = result;
|
|
1445
1479
|
});
|
|
1446
1480
|
if (modified) {
|
|
1447
1481
|
return obj_1;
|
|
@@ -1450,9 +1484,10 @@ function __omitDeep(value, key, known) {
|
|
|
1450
1484
|
return value;
|
|
1451
1485
|
}
|
|
1452
1486
|
|
|
1453
|
-
function stripTypename(value) {
|
|
1454
|
-
return omitDeep(value, '__typename');
|
|
1487
|
+
function stripTypename(value, options) {
|
|
1488
|
+
return omitDeep(value, '__typename', options);
|
|
1455
1489
|
}
|
|
1490
|
+
stripTypename.BREAK = omitDeep.BREAK;
|
|
1456
1491
|
|
|
1457
1492
|
exports.DEV = globals.DEV;
|
|
1458
1493
|
exports.maybe = globals.maybe;
|
|
@@ -1474,6 +1509,8 @@ exports.cloneDeep = cloneDeep;
|
|
|
1474
1509
|
exports.compact = compact;
|
|
1475
1510
|
exports.concatPagination = concatPagination;
|
|
1476
1511
|
exports.createFragmentMap = createFragmentMap;
|
|
1512
|
+
exports.createFulfilledPromise = createFulfilledPromise;
|
|
1513
|
+
exports.createRejectedPromise = createRejectedPromise;
|
|
1477
1514
|
exports.fixObservableSubclass = fixObservableSubclass;
|
|
1478
1515
|
exports.getDefaultValues = getDefaultValues;
|
|
1479
1516
|
exports.getDirectiveNames = getDirectiveNames;
|