@apollo/client 3.6.9 → 3.6.10
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 +3 -0
- package/apollo-client.cjs +31 -17
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +10 -6
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +10 -6
- package/cache/core/types/common.d.ts +1 -1
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js +11 -6
- package/cache/core/types/common.js.map +1 -1
- package/cache/index.d.ts +1 -1
- package/cache/index.d.ts.map +1 -1
- package/cache/index.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/types.d.ts.map +1 -1
- package/core/types.js.map +1 -1
- package/invariantErrorCodes.js +1 -1
- package/link/http/http.cjs +11 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +11 -3
- package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js +11 -3
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/package.json +38 -30
- package/react/hooks/hooks.cjs +9 -7
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +9 -7
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +8 -6
- package/react/hooks/useMutation.js.map +1 -1
- 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/ssr/getDataFromTree.d.ts.map +1 -1
- package/react/ssr/getDataFromTree.js +3 -2
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/renderToStringWithData.d.ts.map +1 -1
- package/react/ssr/renderToStringWithData.js +2 -1
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/ssr/ssr.cjs +4 -3
- package/react/ssr/ssr.cjs.map +1 -1
- package/react/ssr/ssr.cjs.native.js +4 -3
- package/react/types/types.d.ts +2 -3
- 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/itAsync.d.ts +3 -3
- package/testing/core/itAsync.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +1 -1
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/utilities/graphql/storeUtils.d.ts +1 -1
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/version.js +1 -1
|
@@ -94,15 +94,19 @@ exports.Cache = void 0;
|
|
|
94
94
|
(function (Cache) {
|
|
95
95
|
})(exports.Cache || (exports.Cache = {}));
|
|
96
96
|
|
|
97
|
-
var MissingFieldError = (function () {
|
|
97
|
+
var MissingFieldError = (function (_super) {
|
|
98
|
+
tslib.__extends(MissingFieldError, _super);
|
|
98
99
|
function MissingFieldError(message, path, query, variables) {
|
|
99
|
-
this
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
var _this = _super.call(this, message) || this;
|
|
101
|
+
_this.message = message;
|
|
102
|
+
_this.path = path;
|
|
103
|
+
_this.query = query;
|
|
104
|
+
_this.variables = variables;
|
|
105
|
+
_this.__proto__ = MissingFieldError.prototype;
|
|
106
|
+
return _this;
|
|
103
107
|
}
|
|
104
108
|
return MissingFieldError;
|
|
105
|
-
}());
|
|
109
|
+
}(Error));
|
|
106
110
|
|
|
107
111
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
108
112
|
function defaultDataIdFromObject(_a, context) {
|
|
@@ -5,7 +5,7 @@ export declare type SafeReadonly<T> = T extends object ? Readonly<T> : T;
|
|
|
5
5
|
export declare type MissingTree = string | {
|
|
6
6
|
readonly [key: string]: MissingTree;
|
|
7
7
|
};
|
|
8
|
-
export declare class MissingFieldError {
|
|
8
|
+
export declare class MissingFieldError extends Error {
|
|
9
9
|
readonly message: string;
|
|
10
10
|
readonly path: MissingTree | Array<string | number>;
|
|
11
11
|
readonly query: DocumentNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/cache/core/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAStD,oBAAY,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEjE,oBAAY,WAAW,GAAG,MAAM,GAAG;IACjC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;CACrC,CAAC;AAEF,qBAAa,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/cache/core/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAStD,oBAAY,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEjE,oBAAY,WAAW,GAAG,MAAM,GAAG;IACjC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;CACrC,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,KAAK;aAExB,OAAO,EAAE,MAAM;aACf,IAAI,EAAE,WAAW,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CA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AAM,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,EAAE,WAAW,CAAC;CACtB,KAAK,CAAC,CAAC;AAER,oBAAY,SAAS,GAAG;IACtB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;CACpC,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
var MissingFieldError = (function (_super) {
|
|
3
|
+
__extends(MissingFieldError, _super);
|
|
2
4
|
function MissingFieldError(message, path, query, variables) {
|
|
3
|
-
this
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
var _this = _super.call(this, message) || this;
|
|
6
|
+
_this.message = message;
|
|
7
|
+
_this.path = path;
|
|
8
|
+
_this.query = query;
|
|
9
|
+
_this.variables = variables;
|
|
10
|
+
_this.__proto__ = MissingFieldError.prototype;
|
|
11
|
+
return _this;
|
|
7
12
|
}
|
|
8
13
|
return MissingFieldError;
|
|
9
|
-
}());
|
|
14
|
+
}(Error));
|
|
10
15
|
export { MissingFieldError };
|
|
11
16
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/cache/core/types/common.ts"],"names":[],"mappings":"AAwBA;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/cache/core/types/common.ts"],"names":[],"mappings":";AAwBA;IAAuC,qCAAK;IAC1C,2BACkB,OAAe,EACf,IAA0C,EAC1C,KAAmB,EACnB,SAA+B;QAJjD,YAOG,kBAAM,OAAO,CAAC,SAKhB;QAXiB,aAAO,GAAP,OAAO,CAAQ;QACf,UAAI,GAAJ,IAAI,CAAsC;QAC1C,WAAK,GAAL,KAAK,CAAc;QACnB,eAAS,GAAT,SAAS,CAAsB;QAO7C,KAAY,CAAC,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;;IACzD,CAAC;IACH,wBAAC;AAAD,CAAC,AAdD,CAAuC,KAAK,GAc3C","sourcesContent":["import { DocumentNode, FieldNode } from 'graphql';\n\nimport {\n Reference,\n StoreObject,\n StoreValue,\n isReference,\n} from '../../../utilities';\n\nimport { StorageType } from '../../inmemory/policies';\n\n// The Readonly<T> type only really works for object types, since it marks\n// all of the object's properties as readonly, but there are many cases when\n// a generic type parameter like TExisting might be a string or some other\n// primitive type, in which case we need to avoid wrapping it with Readonly.\n// SafeReadonly<string> collapses to just string, which makes string\n// assignable to SafeReadonly<any>, whereas string is not assignable to\n// Readonly<any>, somewhat surprisingly.\nexport type SafeReadonly<T> = T extends object ? Readonly<T> : T;\n\nexport type MissingTree = string | {\n readonly [key: string]: MissingTree;\n};\n\nexport class MissingFieldError extends Error {\n constructor(\n public readonly message: string,\n public readonly path: MissingTree | Array<string | number>,\n public readonly query: DocumentNode,\n public readonly variables?: Record<string, any>,\n ) {\n // 'Error' breaks prototype chain here\n super(message);\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = MissingFieldError.prototype;\n }\n}\n\nexport interface FieldSpecifier {\n typename?: string;\n fieldName: string;\n field?: FieldNode;\n args?: Record<string, any>;\n variables?: Record<string, any>;\n}\n\nexport interface ReadFieldOptions extends FieldSpecifier {\n from?: StoreObject | Reference;\n}\n\nexport interface ReadFieldFunction {\n <V = StoreValue>(options: ReadFieldOptions): SafeReadonly<V> | undefined;\n <V = StoreValue>(\n fieldName: string,\n from?: StoreObject | Reference,\n ): SafeReadonly<V> | undefined;\n}\n\nexport type ToReferenceFunction = (\n objOrIdOrRef: StoreObject | string | Reference,\n mergeIntoStore?: boolean,\n) => Reference | undefined;\n\nexport type CanReadFunction = (value: StoreValue) => boolean;\n\nexport type Modifier<T> = (value: T, details: {\n DELETE: any;\n INVALIDATE: any;\n fieldName: string;\n storeFieldName: string;\n readField: ReadFieldFunction;\n canRead: CanReadFunction;\n isReference: typeof isReference;\n toReference: ToReferenceFunction;\n storage: StorageType;\n}) => T;\n\nexport type Modifiers = {\n [fieldName: string]: Modifier<any>;\n};\n"]}
|
package/cache/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import '../utilities/globals';
|
|
|
2
2
|
export { Transaction, ApolloCache } from './core/cache';
|
|
3
3
|
export { Cache } from './core/types/Cache';
|
|
4
4
|
export { DataProxy } from './core/types/DataProxy';
|
|
5
|
-
export { MissingFieldError, ReadFieldOptions } from './core/types/common';
|
|
5
|
+
export { Modifier, Modifiers, MissingFieldError, ReadFieldOptions } from './core/types/common';
|
|
6
6
|
export { Reference, isReference, makeReference, } from '../utilities';
|
|
7
7
|
export { EntityStore } from './inmemory/entityStore';
|
|
8
8
|
export { fieldNameFromStoreName, defaultDataIdFromObject, } from './inmemory/helpers';
|
package/cache/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,aAAa,GACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,GACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,aAAa,GACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,GACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,cAAc,kBAAkB,CAAC"}
|
package/cache/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAe,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAe,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAGL,iBAAiB,EAElB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,aAAa,GACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,OAAO,EACP,SAAS,GACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAQL,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,cAAc,kBAAkB,CAAC","sourcesContent":["import '../utilities/globals';\n\nexport { Transaction, ApolloCache } from './core/cache';\nexport { Cache } from './core/types/Cache';\nexport { DataProxy } from './core/types/DataProxy';\nexport {\n Modifier,\n Modifiers,\n MissingFieldError,\n ReadFieldOptions\n} from './core/types/common';\n\nexport {\n Reference,\n isReference,\n makeReference,\n} from '../utilities';\n\nexport { EntityStore } from './inmemory/entityStore';\nexport {\n fieldNameFromStoreName,\n defaultDataIdFromObject,\n} from './inmemory/helpers'\n\nexport {\n InMemoryCache,\n} from './inmemory/inMemoryCache';\n\nexport {\n ReactiveVar,\n makeVar,\n cacheSlot,\n} from './inmemory/reactiveVars';\n\nexport {\n TypePolicies,\n TypePolicy,\n FieldPolicy,\n FieldReadFunction,\n FieldMergeFunction,\n FieldFunctionOptions,\n PossibleTypesMap,\n Policies,\n} from './inmemory/policies';\n\nexport {\n canonicalStringify,\n} from './inmemory/object-canon';\n\nexport * from './inmemory/types';\n"]}
|
package/core/core.cjs
CHANGED