@apollo/client 3.8.0-beta.5 → 3.8.0-beta.6
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 +102 -74
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.js +4 -3
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +1 -0
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +9 -5
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.d.ts +2 -2
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +9 -9
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +25 -20
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +25 -20
- package/dev/dev.cjs +72 -79
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +72 -79
- package/invariantErrorCodes.js +71 -78
- 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/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +3 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +3 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs +2 -2
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
- 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 +1 -1
- package/package.json +10 -10
- package/react/cache/QueryReference.d.ts +2 -0
- package/react/cache/QueryReference.d.ts.map +1 -1
- package/react/cache/QueryReference.js +29 -4
- package/react/cache/QueryReference.js.map +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +3 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +3 -3
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +2 -2
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -2
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +43 -21
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +43 -21
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useBackgroundQuery.js +3 -4
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useSubscription.js +2 -2
- package/react/hooks/useSuspenseCache.js +1 -1
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +5 -6
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/parser/index.js +5 -5
- 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 +29 -4
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +29 -4
- 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/mockLink.js +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/promises/decoration.d.ts.map +1 -1
- package/utilities/promises/decoration.js +1 -0
- package/utilities/promises/decoration.js.map +1 -1
- package/utilities/utilities.cjs +20 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +20 -19
- package/version.js +1 -1
|
@@ -19,7 +19,7 @@ function shouldInclude(_a, variables) {
|
|
|
19
19
|
var evaledValue = false;
|
|
20
20
|
if (ifArgument.value.kind === 'Variable') {
|
|
21
21
|
evaledValue = variables && variables[ifArgument.value.name.value];
|
|
22
|
-
globals.invariant(evaledValue !== void 0,
|
|
22
|
+
globals.invariant(evaledValue !== void 0, 65, directive.name.value);
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
evaledValue = ifArgument.value.value;
|
|
@@ -66,12 +66,12 @@ function getInclusionDirectives(directives) {
|
|
|
66
66
|
return;
|
|
67
67
|
var directiveArguments = directive.arguments;
|
|
68
68
|
var directiveName = directive.name.value;
|
|
69
|
-
globals.invariant(directiveArguments && directiveArguments.length === 1,
|
|
69
|
+
globals.invariant(directiveArguments && directiveArguments.length === 1, 66, directiveName);
|
|
70
70
|
var ifArgument = directiveArguments[0];
|
|
71
|
-
globals.invariant(ifArgument.name && ifArgument.name.value === 'if',
|
|
71
|
+
globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 67, directiveName);
|
|
72
72
|
var ifValue = ifArgument.value;
|
|
73
73
|
globals.invariant(ifValue &&
|
|
74
|
-
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),
|
|
74
|
+
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 68, directiveName);
|
|
75
75
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -104,7 +104,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
104
104
|
document.definitions.forEach(function (definition) {
|
|
105
105
|
if (definition.kind === 'OperationDefinition') {
|
|
106
106
|
throw globals.newInvariantError(
|
|
107
|
-
|
|
107
|
+
69,
|
|
108
108
|
definition.operation,
|
|
109
109
|
definition.name ? " named '".concat(definition.name.value, "'") : ''
|
|
110
110
|
);
|
|
@@ -114,7 +114,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
if (typeof actualFragmentName === 'undefined') {
|
|
117
|
-
globals.invariant(fragments.length === 1,
|
|
117
|
+
globals.invariant(fragments.length === 1, 70, fragments.length);
|
|
118
118
|
actualFragmentName = fragments[0].name.value;
|
|
119
119
|
}
|
|
120
120
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
@@ -155,7 +155,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
155
155
|
return fragmentMap(fragmentName);
|
|
156
156
|
}
|
|
157
157
|
var fragment = fragmentMap && fragmentMap[fragmentName];
|
|
158
|
-
globals.invariant(fragment,
|
|
158
|
+
globals.invariant(fragment, 71, fragmentName);
|
|
159
159
|
return fragment || null;
|
|
160
160
|
}
|
|
161
161
|
default:
|
|
@@ -233,7 +233,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
233
233
|
argObj[name.value] = null;
|
|
234
234
|
}
|
|
235
235
|
else {
|
|
236
|
-
throw globals.newInvariantError(
|
|
236
|
+
throw globals.newInvariantError(80, name.value, value.kind);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
function storeKeyNameFromField(field, variables) {
|
|
@@ -378,16 +378,16 @@ function isInlineFragment(selection) {
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
function checkDocument(doc) {
|
|
381
|
-
globals.invariant(doc && doc.kind === 'Document',
|
|
381
|
+
globals.invariant(doc && doc.kind === 'Document', 72);
|
|
382
382
|
var operations = doc.definitions
|
|
383
383
|
.filter(function (d) { return d.kind !== 'FragmentDefinition'; })
|
|
384
384
|
.map(function (definition) {
|
|
385
385
|
if (definition.kind !== 'OperationDefinition') {
|
|
386
|
-
throw globals.newInvariantError(
|
|
386
|
+
throw globals.newInvariantError(73, definition.kind);
|
|
387
387
|
}
|
|
388
388
|
return definition;
|
|
389
389
|
});
|
|
390
|
-
globals.invariant(operations.length <= 1,
|
|
390
|
+
globals.invariant(operations.length <= 1, 74, operations.length);
|
|
391
391
|
return doc;
|
|
392
392
|
}
|
|
393
393
|
function getOperationDefinition(doc) {
|
|
@@ -410,14 +410,14 @@ function getFragmentDefinitions(doc) {
|
|
|
410
410
|
}
|
|
411
411
|
function getQueryDefinition(doc) {
|
|
412
412
|
var queryDef = getOperationDefinition(doc);
|
|
413
|
-
globals.invariant(queryDef && queryDef.operation === 'query',
|
|
413
|
+
globals.invariant(queryDef && queryDef.operation === 'query', 75);
|
|
414
414
|
return queryDef;
|
|
415
415
|
}
|
|
416
416
|
function getFragmentDefinition(doc) {
|
|
417
|
-
globals.invariant(doc.kind === 'Document',
|
|
418
|
-
globals.invariant(doc.definitions.length <= 1,
|
|
417
|
+
globals.invariant(doc.kind === 'Document', 76);
|
|
418
|
+
globals.invariant(doc.definitions.length <= 1, 77);
|
|
419
419
|
var fragmentDef = doc.definitions[0];
|
|
420
|
-
globals.invariant(fragmentDef.kind === 'FragmentDefinition',
|
|
420
|
+
globals.invariant(fragmentDef.kind === 'FragmentDefinition', 78);
|
|
421
421
|
return fragmentDef;
|
|
422
422
|
}
|
|
423
423
|
function getMainDefinition(queryDoc) {
|
|
@@ -440,7 +440,7 @@ function getMainDefinition(queryDoc) {
|
|
|
440
440
|
if (fragmentDefinition) {
|
|
441
441
|
return fragmentDefinition;
|
|
442
442
|
}
|
|
443
|
-
throw globals.newInvariantError(
|
|
443
|
+
throw globals.newInvariantError(79);
|
|
444
444
|
}
|
|
445
445
|
function getDefaultValues(definition) {
|
|
446
446
|
var defaultValues = Object.create(null);
|
|
@@ -512,7 +512,7 @@ var DocumentTransform = (function () {
|
|
|
512
512
|
return;
|
|
513
513
|
var cacheKeys = this.getCacheKey(document);
|
|
514
514
|
if (cacheKeys) {
|
|
515
|
-
globals.invariant(Array.isArray(cacheKeys),
|
|
515
|
+
globals.invariant(Array.isArray(cacheKeys), 64);
|
|
516
516
|
return this.stableCacheKeys.lookupArray(cacheKeys);
|
|
517
517
|
}
|
|
518
518
|
};
|
|
@@ -605,7 +605,7 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
605
605
|
return getInUseByFragmentName(ancestor.name.value);
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
globals.__DEV__ && globals.invariant.error(
|
|
608
|
+
globals.__DEV__ && globals.invariant.error(81);
|
|
609
609
|
return null;
|
|
610
610
|
};
|
|
611
611
|
var operationCount = 0;
|
|
@@ -781,7 +781,7 @@ var connectionRemoveConfig = {
|
|
|
781
781
|
if (willRemove) {
|
|
782
782
|
if (!directive.arguments ||
|
|
783
783
|
!directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
|
|
784
|
-
globals.__DEV__ && globals.invariant.warn(
|
|
784
|
+
globals.__DEV__ && globals.invariant.warn(82);
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
787
|
return willRemove;
|
|
@@ -1121,6 +1121,7 @@ function createFulfilledPromise(value) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
function createRejectedPromise(reason) {
|
|
1123
1123
|
var promise = Promise.reject(reason);
|
|
1124
|
+
promise.catch(function () { });
|
|
1124
1125
|
promise.status = 'rejected';
|
|
1125
1126
|
promise.reason = reason;
|
|
1126
1127
|
return promise;
|
package/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = '3.8.0-beta.
|
|
1
|
+
export var version = '3.8.0-beta.6';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|