@apollo/client 3.8.0-alpha.5 → 3.8.0-alpha.7
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/README.md +1 -0
- package/apollo-client.cjs +151 -72
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +20 -20
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +20 -20
- package/cache/core/cache.d.ts +1 -1
- package/cache/core/cache.d.ts.map +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/common.d.ts +7 -7
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/inmemory/entityStore.d.ts +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +3 -2
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +1 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/object-canon.d.ts +0 -1
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +1 -1
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts +12 -12
- 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/readFromStore.d.ts +2 -2
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +1 -1
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +4 -4
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +1 -1
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +5 -5
- 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 +9 -6
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +65 -15
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +5 -5
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +2 -2
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +1 -1
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +7 -7
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +19 -11
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +113 -62
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +113 -62
- package/core/index.js +2 -2
- package/core/index.js.map +1 -1
- package/core/types.d.ts +18 -17
- package/core/types.d.ts.map +1 -1
- package/core/types.js +1 -0
- 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/errors/index.d.ts +2 -2
- package/errors/index.d.ts.map +1 -1
- package/invariantErrorCodes.js +33 -33
- package/link/batch/batch.cjs +5 -3
- package/link/batch/batch.cjs.map +1 -1
- package/link/batch/batch.cjs.native.js +5 -3
- package/link/batch/batching.d.ts +2 -2
- package/link/batch/batching.d.ts.map +1 -1
- package/link/batch/batching.js +5 -3
- package/link/batch/batching.js.map +1 -1
- package/link/context/index.d.ts +2 -1
- package/link/context/index.d.ts.map +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/core/types.d.ts +13 -12
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/http/checkFetcher.js +2 -2
- package/link/http/createHttpLink.d.ts +0 -1
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +2 -1
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +13 -38
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +13 -38
- package/link/http/iterators/async.js.map +1 -1
- package/link/http/iterators/nodeStream.js.map +1 -1
- package/link/http/iterators/promise.js.map +1 -1
- package/link/http/iterators/reader.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.js +1 -1
- package/link/http/responseIterator.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +3 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.d.ts.map +1 -1
- package/link/http/serializeFetchParameter.js +2 -2
- package/link/persisted-queries/index.d.ts +2 -2
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +3 -3
- package/link/persisted-queries/persisted-queries.cjs +3 -3
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +3 -3
- package/link/utils/throwServerError.d.ts +1 -1
- package/link/utils/throwServerError.d.ts.map +1 -1
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +2 -2
- package/package.json +15 -15
- package/react/cache/SuspenseCache.d.ts +1 -1
- package/react/cache/SuspenseCache.d.ts.map +1 -1
- package/react/cache/SuspenseCache.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 +2 -2
- package/react/components/types.d.ts.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.js +2 -2
- package/react/context/ApolloProvider.js +2 -2
- package/react/context/context.cjs +4 -4
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +4 -4
- package/react/hoc/graphql.d.ts +2 -1
- package/react/hoc/graphql.d.ts.map +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +1 -1
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +2 -2
- package/react/hoc/hoc.cjs +4 -4
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +4 -4
- package/react/hoc/mutation-hoc.d.ts +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +6 -6
- package/react/hoc/types.d.ts.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.js +2 -2
- package/react/hooks/hooks.cjs +26 -32
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +26 -32
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/useApolloClient.js +2 -2
- package/react/hooks/useFragment.d.ts +4 -2
- package/react/hooks/useFragment.d.ts.map +1 -1
- package/react/hooks/useFragment.js +9 -8
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +2 -2
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js +3 -4
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +2 -2
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +4 -4
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +2 -3
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +1 -2
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseCache.js +2 -2
- package/react/hooks/useSuspenseQuery.d.ts +1 -1
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.d.ts +1 -1
- package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/parser/index.js +6 -6
- package/react/parser/parser.cjs +10 -10
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +10 -10
- package/react/ssr/RenderPromises.d.ts +4 -4
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/getDataFromTree.d.ts +1 -1
- package/react/ssr/getDataFromTree.d.ts.map +1 -1
- package/react/types/types.d.ts +24 -23
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +13 -3
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +13 -3
- package/testing/core/index.d.ts +1 -1
- package/testing/core/index.d.ts.map +1 -1
- package/testing/core/index.js.map +1 -1
- package/testing/core/mocking/mockFetch.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +8 -4
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +14 -4
- 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 +3 -3
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
- package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
- package/testing/core/mocking/mockWatchQuery.js +4 -5
- 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/react/MockedProvider.d.ts +1 -0
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +2 -2
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +2 -2
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +2 -2
- package/utilities/common/cloneDeep.js.map +1 -1
- package/utilities/common/errorHandling.d.ts +2 -2
- package/utilities/common/errorHandling.d.ts.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/incrementalResult.d.ts +4 -4
- package/utilities/common/incrementalResult.d.ts.map +1 -1
- package/utilities/common/incrementalResult.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts +0 -1
- package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
- package/utilities/common/maybeDeepFreeze.js +1 -1
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeDeep.d.ts +2 -2
- package/utilities/common/mergeDeep.d.ts.map +1 -1
- package/utilities/common/mergeOptions.d.ts +3 -3
- package/utilities/common/mergeOptions.d.ts.map +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/globals/DEV.d.ts +1 -1
- package/utilities/globals/DEV.d.ts.map +1 -1
- package/utilities/globals/DEV.js +1 -17
- package/utilities/globals/DEV.js.map +1 -1
- package/utilities/globals/global.d.ts +5 -2
- package/utilities/globals/global.d.ts.map +1 -1
- package/utilities/globals/global.js.map +1 -1
- package/utilities/globals/globals.cjs +5 -22
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +5 -22
- package/utilities/globals/index.d.ts +1 -1
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +1 -4
- package/utilities/globals/index.js.map +1 -1
- package/utilities/graphql/directives.d.ts +2 -2
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +1 -1
- 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 +1 -1
- package/utilities/graphql/getFromAST.js +1 -1
- package/utilities/graphql/storeUtils.d.ts +3 -3
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts +9 -9
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +2 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +2 -0
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.d.ts +5 -5
- package/utilities/observables/Concast.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/policies/pagination.d.ts +7 -7
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/types/IsStrictlyAny.d.ts +3 -3
- package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
- package/utilities/utilities.cjs +75 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +75 -19
- package/version.js +1 -1
|
@@ -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
|
-
__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 41);
|
|
21
|
+
globals.__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 41);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
evaledValue = ifArgument.value.value;
|
|
@@ -65,11 +65,11 @@ function getInclusionDirectives(directives) {
|
|
|
65
65
|
return;
|
|
66
66
|
var directiveArguments = directive.arguments;
|
|
67
67
|
var directiveName = directive.name.value;
|
|
68
|
-
__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 42);
|
|
68
|
+
globals.__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 42);
|
|
69
69
|
var ifArgument = directiveArguments[0];
|
|
70
|
-
__DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 43);
|
|
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', 43);
|
|
71
71
|
var ifValue = ifArgument.value;
|
|
72
|
-
__DEV__ ? globals.invariant(ifValue &&
|
|
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
74
|
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 44);
|
|
75
75
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
@@ -83,7 +83,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
83
83
|
var fragments = [];
|
|
84
84
|
document.definitions.forEach(function (definition) {
|
|
85
85
|
if (definition.kind === 'OperationDefinition') {
|
|
86
|
-
throw __DEV__ ? new globals.InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
|
|
86
|
+
throw globals.__DEV__ ? new globals.InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
|
|
87
87
|
'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(45);
|
|
88
88
|
}
|
|
89
89
|
if (definition.kind === 'FragmentDefinition') {
|
|
@@ -91,7 +91,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
if (typeof actualFragmentName === 'undefined') {
|
|
94
|
-
__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, 46);
|
|
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, 46);
|
|
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
|
-
__DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 47);
|
|
135
|
+
globals.__DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 47);
|
|
136
136
|
return fragment || null;
|
|
137
137
|
}
|
|
138
138
|
default:
|
|
@@ -214,7 +214,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
214
214
|
argObj[name.value] = null;
|
|
215
215
|
}
|
|
216
216
|
else {
|
|
217
|
-
throw __DEV__ ? new globals.InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
|
|
217
|
+
throw globals.__DEV__ ? new globals.InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
|
|
218
218
|
'is not supported. Use variables instead of inline arguments to ' +
|
|
219
219
|
'overcome this limitation.') : new globals.InvariantError(56);
|
|
220
220
|
}
|
|
@@ -350,16 +350,16 @@ function isInlineFragment(selection) {
|
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
function checkDocument(doc) {
|
|
353
|
-
__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', 48);
|
|
353
|
+
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', 48);
|
|
354
354
|
var operations = doc.definitions
|
|
355
355
|
.filter(function (d) { return d.kind !== 'FragmentDefinition'; })
|
|
356
356
|
.map(function (definition) {
|
|
357
357
|
if (definition.kind !== 'OperationDefinition') {
|
|
358
|
-
throw __DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(49);
|
|
358
|
+
throw globals.__DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(49);
|
|
359
359
|
}
|
|
360
360
|
return definition;
|
|
361
361
|
});
|
|
362
|
-
__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 50);
|
|
362
|
+
globals.__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 50);
|
|
363
363
|
return doc;
|
|
364
364
|
}
|
|
365
365
|
function getOperationDefinition(doc) {
|
|
@@ -378,14 +378,14 @@ function getFragmentDefinitions(doc) {
|
|
|
378
378
|
}
|
|
379
379
|
function getQueryDefinition(doc) {
|
|
380
380
|
var queryDef = getOperationDefinition(doc);
|
|
381
|
-
__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 51);
|
|
381
|
+
globals.__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 51);
|
|
382
382
|
return queryDef;
|
|
383
383
|
}
|
|
384
384
|
function getFragmentDefinition(doc) {
|
|
385
|
-
__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', 52);
|
|
386
|
-
__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 53);
|
|
385
|
+
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', 52);
|
|
386
|
+
globals.__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 53);
|
|
387
387
|
var fragmentDef = doc.definitions[0];
|
|
388
|
-
__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 54);
|
|
388
|
+
globals.__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 54);
|
|
389
389
|
return fragmentDef;
|
|
390
390
|
}
|
|
391
391
|
function getMainDefinition(queryDoc) {
|
|
@@ -408,7 +408,7 @@ function getMainDefinition(queryDoc) {
|
|
|
408
408
|
if (fragmentDefinition) {
|
|
409
409
|
return fragmentDefinition;
|
|
410
410
|
}
|
|
411
|
-
throw __DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(55);
|
|
411
|
+
throw globals.__DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(55);
|
|
412
412
|
}
|
|
413
413
|
function getDefaultValues(definition) {
|
|
414
414
|
var defaultValues = Object.create(null);
|
|
@@ -564,7 +564,7 @@ var connectionRemoveConfig = {
|
|
|
564
564
|
if (willRemove) {
|
|
565
565
|
if (!directive.arguments ||
|
|
566
566
|
!directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
|
|
567
|
-
__DEV__ && globals.invariant.warn('Removing an @connection directive even though it does not have a key. ' +
|
|
567
|
+
globals.__DEV__ && globals.invariant.warn('Removing an @connection directive even though it does not have a key. ' +
|
|
568
568
|
'You may want to use the key parameter to specify a store key.');
|
|
569
569
|
}
|
|
570
570
|
}
|
|
@@ -955,7 +955,7 @@ function deepFreeze(value) {
|
|
|
955
955
|
return value;
|
|
956
956
|
}
|
|
957
957
|
function shallowFreeze(obj) {
|
|
958
|
-
if (__DEV__ && !Object.isFrozen(obj)) {
|
|
958
|
+
if (globals.__DEV__ && !Object.isFrozen(obj)) {
|
|
959
959
|
try {
|
|
960
960
|
Object.freeze(obj);
|
|
961
961
|
}
|
|
@@ -968,7 +968,7 @@ function shallowFreeze(obj) {
|
|
|
968
968
|
return obj;
|
|
969
969
|
}
|
|
970
970
|
function maybeDeepFreeze(obj) {
|
|
971
|
-
if (__DEV__) {
|
|
971
|
+
if (globals.__DEV__) {
|
|
972
972
|
deepFreeze(obj);
|
|
973
973
|
}
|
|
974
974
|
return obj;
|
|
@@ -1188,6 +1188,32 @@ function isNonEmptyArray(value) {
|
|
|
1188
1188
|
function isExecutionPatchIncrementalResult(value) {
|
|
1189
1189
|
return "incremental" in value;
|
|
1190
1190
|
}
|
|
1191
|
+
function isExecutionPatchInitialResult(value) {
|
|
1192
|
+
return "hasNext" in value && "data" in value;
|
|
1193
|
+
}
|
|
1194
|
+
function isExecutionPatchResult(value) {
|
|
1195
|
+
return (isExecutionPatchIncrementalResult(value) ||
|
|
1196
|
+
isExecutionPatchInitialResult(value));
|
|
1197
|
+
}
|
|
1198
|
+
function mergeIncrementalData(prevResult, result) {
|
|
1199
|
+
var mergedData = prevResult;
|
|
1200
|
+
var merger = new DeepMerger();
|
|
1201
|
+
if (isExecutionPatchIncrementalResult(result) &&
|
|
1202
|
+
isNonEmptyArray(result.incremental)) {
|
|
1203
|
+
result.incremental.forEach(function (_a) {
|
|
1204
|
+
var data = _a.data, path = _a.path;
|
|
1205
|
+
for (var i = path.length - 1; i >= 0; --i) {
|
|
1206
|
+
var key = path[i];
|
|
1207
|
+
var isNumericKey = !isNaN(+key);
|
|
1208
|
+
var parent_1 = isNumericKey ? [] : {};
|
|
1209
|
+
parent_1[key] = data;
|
|
1210
|
+
data = parent_1;
|
|
1211
|
+
}
|
|
1212
|
+
mergedData = merger.merge(mergedData, data);
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
return mergedData;
|
|
1216
|
+
}
|
|
1191
1217
|
|
|
1192
1218
|
function graphQLResultHasError(result) {
|
|
1193
1219
|
var errors = getGraphQLErrorsFromResult(result);
|
|
@@ -1247,6 +1273,26 @@ function mergeOptions(defaults, options) {
|
|
|
1247
1273
|
});
|
|
1248
1274
|
}
|
|
1249
1275
|
|
|
1276
|
+
function isNodeResponse(value) {
|
|
1277
|
+
return !!value.body;
|
|
1278
|
+
}
|
|
1279
|
+
function isReadableStream(value) {
|
|
1280
|
+
return !!value.getReader;
|
|
1281
|
+
}
|
|
1282
|
+
function isAsyncIterableIterator(value) {
|
|
1283
|
+
return !!(canUseAsyncIteratorSymbol &&
|
|
1284
|
+
value[Symbol.asyncIterator]);
|
|
1285
|
+
}
|
|
1286
|
+
function isStreamableBlob(value) {
|
|
1287
|
+
return !!value.stream;
|
|
1288
|
+
}
|
|
1289
|
+
function isBlob(value) {
|
|
1290
|
+
return !!value.arrayBuffer;
|
|
1291
|
+
}
|
|
1292
|
+
function isNodeReadableStream(value) {
|
|
1293
|
+
return !!value.pipe;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1250
1296
|
exports.DEV = globals.DEV;
|
|
1251
1297
|
exports.maybe = globals.maybe;
|
|
1252
1298
|
exports.Observable = zenObservableTs.Observable;
|
|
@@ -1287,18 +1333,28 @@ exports.hasAllDirectives = hasAllDirectives;
|
|
|
1287
1333
|
exports.hasAnyDirectives = hasAnyDirectives;
|
|
1288
1334
|
exports.hasClientExports = hasClientExports;
|
|
1289
1335
|
exports.hasDirectives = hasDirectives;
|
|
1336
|
+
exports.isAsyncIterableIterator = isAsyncIterableIterator;
|
|
1337
|
+
exports.isBlob = isBlob;
|
|
1290
1338
|
exports.isDocumentNode = isDocumentNode;
|
|
1339
|
+
exports.isExecutionPatchIncrementalResult = isExecutionPatchIncrementalResult;
|
|
1340
|
+
exports.isExecutionPatchInitialResult = isExecutionPatchInitialResult;
|
|
1341
|
+
exports.isExecutionPatchResult = isExecutionPatchResult;
|
|
1291
1342
|
exports.isField = isField;
|
|
1292
1343
|
exports.isInlineFragment = isInlineFragment;
|
|
1344
|
+
exports.isNodeReadableStream = isNodeReadableStream;
|
|
1345
|
+
exports.isNodeResponse = isNodeResponse;
|
|
1293
1346
|
exports.isNonEmptyArray = isNonEmptyArray;
|
|
1294
1347
|
exports.isNonNullObject = isNonNullObject;
|
|
1348
|
+
exports.isReadableStream = isReadableStream;
|
|
1295
1349
|
exports.isReference = isReference;
|
|
1350
|
+
exports.isStreamableBlob = isStreamableBlob;
|
|
1296
1351
|
exports.iterateObserversSafely = iterateObserversSafely;
|
|
1297
1352
|
exports.makeReference = makeReference;
|
|
1298
1353
|
exports.makeUniqueId = makeUniqueId;
|
|
1299
1354
|
exports.maybeDeepFreeze = maybeDeepFreeze;
|
|
1300
1355
|
exports.mergeDeep = mergeDeep;
|
|
1301
1356
|
exports.mergeDeepArray = mergeDeepArray;
|
|
1357
|
+
exports.mergeIncrementalData = mergeIncrementalData;
|
|
1302
1358
|
exports.mergeOptions = mergeOptions;
|
|
1303
1359
|
exports.offsetLimitPagination = offsetLimitPagination;
|
|
1304
1360
|
exports.relayStylePagination = relayStylePagination;
|
package/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = '3.8.0-alpha.
|
|
1
|
+
export var version = '3.8.0-alpha.7';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|