@apollo/client 4.0.11 → 4.0.12
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/CHANGELOG.md +6 -0
- package/__cjs/cache/core/cache.cjs +48 -5
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +47 -0
- package/__cjs/cache/core/types/Cache.d.cts +28 -0
- package/__cjs/cache/inmemory/fragmentRegistry.cjs +5 -0
- package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +47 -0
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +47 -0
- package/__cjs/link/error/index.cjs +1 -1
- package/__cjs/link/error/index.cjs.map +1 -1
- package/__cjs/link/error/index.d.cts +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +51 -50
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +3 -0
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
- package/__cjs/react/hooks/useApolloClient.d.cts +1 -1
- package/__cjs/utilities/internal/bindCacheKey.cjs +21 -0
- package/__cjs/utilities/internal/bindCacheKey.cjs.map +1 -0
- package/__cjs/utilities/internal/bindCacheKey.d.cts +15 -0
- package/__cjs/utilities/internal/index.cjs +3 -1
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +1 -0
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.d.ts +47 -0
- package/cache/core/cache.js +49 -6
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +28 -0
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.js +6 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +47 -0
- package/cache/inmemory/inMemoryCache.js +47 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/link/error/index.d.ts +1 -1
- package/link/error/index.js +1 -1
- package/link/error/index.js.map +1 -1
- package/link/remove-typename/removeTypenameFromVariables.d.ts +3 -0
- package/link/remove-typename/removeTypenameFromVariables.js +51 -50
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks-compiled/useApolloClient.d.ts +1 -1
- package/react/hooks-compiled/useApolloClient.js +1 -1
- package/react/hooks-compiled/useApolloClient.js.map +1 -1
- package/utilities/internal/bindCacheKey.d.ts +15 -0
- package/utilities/internal/bindCacheKey.js +18 -0
- package/utilities/internal/bindCacheKey.js.map +1 -0
- package/utilities/internal/index.d.ts +1 -0
- package/utilities/internal/index.js +1 -0
- package/utilities/internal/index.js.map +1 -1
- package/version.js +1 -1
|
@@ -4,7 +4,7 @@ import { wrap } from "optimism";
|
|
|
4
4
|
import { ApolloLink } from "@apollo/client/link";
|
|
5
5
|
import { cacheSizes, stripTypename } from "@apollo/client/utilities";
|
|
6
6
|
import { __DEV__ } from "@apollo/client/utilities/environment";
|
|
7
|
-
import { isPlainObject } from "@apollo/client/utilities/internal";
|
|
7
|
+
import { bindCacheKey, isPlainObject } from "@apollo/client/utilities/internal";
|
|
8
8
|
/**
|
|
9
9
|
* Sentinel value used to indicate that `__typename` fields should be kept
|
|
10
10
|
* for a specific field or input type.
|
|
@@ -69,7 +69,7 @@ export class RemoveTypenameFromVariablesLink extends ApolloLink {
|
|
|
69
69
|
if (variables) {
|
|
70
70
|
operation.variables =
|
|
71
71
|
except ?
|
|
72
|
-
maybeStripTypenameUsingConfig(query, variables, except)
|
|
72
|
+
this.maybeStripTypenameUsingConfig(query, variables, except)
|
|
73
73
|
: stripTypename(variables);
|
|
74
74
|
}
|
|
75
75
|
return forward(operation);
|
|
@@ -79,64 +79,65 @@ export class RemoveTypenameFromVariablesLink extends ApolloLink {
|
|
|
79
79
|
getMemoryInternals() {
|
|
80
80
|
return {
|
|
81
81
|
removeTypenameFromVariables: {
|
|
82
|
-
getVariableDefinitions: getVariableDefinitions?.size ?? 0,
|
|
82
|
+
getVariableDefinitions: this.getVariableDefinitions?.size ?? 0,
|
|
83
83
|
},
|
|
84
84
|
};
|
|
85
85
|
},
|
|
86
86
|
}
|
|
87
87
|
: {});
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
function maybeStripTypename(value, config) {
|
|
104
|
-
if (config === KEEP) {
|
|
105
|
-
return value;
|
|
89
|
+
maybeStripTypenameUsingConfig(query, variables, config) {
|
|
90
|
+
const variableDefinitions = this.getVariableDefinitions(query);
|
|
91
|
+
return Object.fromEntries(Object.entries(variables).map((keyVal) => {
|
|
92
|
+
const [key, value] = keyVal;
|
|
93
|
+
const typename = variableDefinitions[key];
|
|
94
|
+
const typenameConfig = config[typename];
|
|
95
|
+
keyVal[1] =
|
|
96
|
+
typenameConfig ?
|
|
97
|
+
this.maybeStripTypename(value, typenameConfig)
|
|
98
|
+
: stripTypename(value);
|
|
99
|
+
return keyVal;
|
|
100
|
+
}));
|
|
106
101
|
}
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
maybeStripTypename(value, config) {
|
|
103
|
+
if (config === KEEP) {
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
if (Array.isArray(value)) {
|
|
107
|
+
return value.map((item) => this.maybeStripTypename(item, config));
|
|
108
|
+
}
|
|
109
|
+
if (isPlainObject(value)) {
|
|
110
|
+
const modified = {};
|
|
111
|
+
Object.keys(value).forEach((key) => {
|
|
112
|
+
const child = value[key];
|
|
113
|
+
if (key === "__typename") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const fieldConfig = config[key];
|
|
117
|
+
modified[key] =
|
|
118
|
+
fieldConfig ?
|
|
119
|
+
this.maybeStripTypename(child, fieldConfig)
|
|
120
|
+
: stripTypename(child);
|
|
121
|
+
});
|
|
122
|
+
return modified;
|
|
123
|
+
}
|
|
124
|
+
return value;
|
|
109
125
|
}
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
const fieldConfig = config[key];
|
|
118
|
-
modified[key] =
|
|
119
|
-
fieldConfig ?
|
|
120
|
-
maybeStripTypename(child, fieldConfig)
|
|
121
|
-
: stripTypename(child);
|
|
126
|
+
getVariableDefinitions = wrap((document) => {
|
|
127
|
+
const definitions = {};
|
|
128
|
+
visit(document, {
|
|
129
|
+
VariableDefinition(node) {
|
|
130
|
+
definitions[node.variable.name.value] = unwrapType(node.type);
|
|
131
|
+
},
|
|
122
132
|
});
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
visit(document, {
|
|
130
|
-
VariableDefinition(node) {
|
|
131
|
-
definitions[node.variable.name.value] = unwrapType(node.type);
|
|
132
|
-
},
|
|
133
|
+
return definitions;
|
|
134
|
+
}, {
|
|
135
|
+
max: cacheSizes["removeTypenameFromVariables.getVariableDefinitions"] ||
|
|
136
|
+
2000 /* defaultCacheSizes["removeTypenameFromVariables.getVariableDefinitions"] */,
|
|
137
|
+
cache: WeakCache,
|
|
138
|
+
makeCacheKey: bindCacheKey(this),
|
|
133
139
|
});
|
|
134
|
-
|
|
135
|
-
}, {
|
|
136
|
-
max: cacheSizes["removeTypenameFromVariables.getVariableDefinitions"] ||
|
|
137
|
-
2000 /* defaultCacheSizes["removeTypenameFromVariables.getVariableDefinitions"] */,
|
|
138
|
-
cache: WeakCache,
|
|
139
|
-
});
|
|
140
|
+
}
|
|
140
141
|
function unwrapType(node) {
|
|
141
142
|
switch (node.kind) {
|
|
142
143
|
case Kind.NON_NULL_TYPE:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeTypenameFromVariables.js","sourceRoot":"","sources":["../../../src/link/remove-typename/removeTypenameFromVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIlE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAiF7B;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAiD;IAEjD,OAAO,IAAI,+BAA+B,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,+BAAgC,SAAQ,UAAU;IAC7D,YAAY,UAAmD,EAAE;QAC/D,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;YAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC3B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;YAEvC,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,CAAC,SAAS;oBACjB,MAAM,CAAC,CAAC;wBACN,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,EAAE,CAAC;QAClB,KAAK,IAAI,CAAC,aAAa;YACrB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,SAAS;YACjB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,UAAU;YAClB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["import { WeakCache } from \"@wry/caches\";\nimport type { DocumentNode, TypeNode } from \"graphql\";\nimport { Kind, visit } from \"graphql\";\nimport { wrap } from \"optimism\";\n\nimport type { OperationVariables } from \"@apollo/client\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { cacheSizes, stripTypename } from \"@apollo/client/utilities\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { isPlainObject } from \"@apollo/client/utilities/internal\";\n\nimport { defaultCacheSizes } from \"../../utilities/caching/sizes.js\";\n\n/**\n * Sentinel value used to indicate that `__typename` fields should be kept\n * for a specific field or input type.\n *\n * @remarks\n * Use this value in the `except` configuration to preserve `__typename`\n * fields in JSON scalar fields or other cases where you need to retain\n * the typename information.\n *\n * @example\n *\n * ```ts\n * import {\n * RemoveTypenameFromVariablesLink,\n * KEEP,\n * } from \"@apollo/client/link/remove-typename\";\n *\n * const link = new RemoveTypenameFromVariablesLink({\n * except: {\n * JSON: KEEP, // Keep __typename for all JSON scalar variables\n * DashboardInput: {\n * config: KEEP, // Keep __typename only for the config field\n * },\n * },\n * });\n * ```\n */\nexport const KEEP = \"__KEEP\";\n\nexport declare namespace RemoveTypenameFromVariablesLink {\n /**\n * Configuration object that specifies which input types and fields should\n * retain their `__typename` fields.\n *\n * @remarks\n * This is a recursive configuration where:\n *\n * - Keys represent GraphQL input type names or field names\n * - Values can be either the `KEEP` sentinel to preserve all `__typename`\n * fields, or a nested `KeepTypenameConfig` to preserve `__typename` fields on\n * a specific field name.\n *\n * @example\n *\n * ```ts\n * const config: KeepTypenameConfig = {\n * // Keep __typename for all JSON scalar variables\n * JSON: KEEP,\n *\n * // For DashboardInput, only keep __typename on the config field\n * DashboardInput: {\n * config: KEEP,\n * },\n *\n * // Nested configuration for complex input types\n * UserInput: {\n * profile: {\n * settings: KEEP,\n * },\n * },\n * };\n * ```\n */\n export interface KeepTypenameConfig {\n [key: string]:\n | typeof KEEP\n | RemoveTypenameFromVariablesLink.KeepTypenameConfig;\n }\n\n /**\n * Options for configuring the `RemoveTypenameFromVariablesLink`.\n */\n export interface Options {\n /**\n * Configuration that determines which input types should retain `__typename`\n * fields.\n *\n * Maps GraphQL input type names to configurations. Each configuration can\n * either be the `KEEP` sentinel, to preserve all `__typename` fields, or\n * a nested object that specifies which fields should retain `__typename`.\n *\n * @example\n *\n * ```ts\n * {\n * except: {\n * // Keep __typename for all JSON scalar variables\n * JSON: KEEP,\n *\n * // For DashboardInput, remove __typename except for config field\n * DashboardInput: {\n * config: KEEP,\n * },\n *\n * // Complex nested configuration\n * UserProfileInput: {\n * settings: {\n * preferences: KEEP,\n * },\n * },\n * },\n * }\n * ```\n */\n except?: RemoveTypenameFromVariablesLink.KeepTypenameConfig;\n }\n}\n\n/**\n * @deprecated\n * Use `RemoveTypenameFromVariablesLink` from `@apollo/client/link/remove-typename` instead.\n */\nexport function removeTypenameFromVariables(\n options?: RemoveTypenameFromVariablesLink.Options\n) {\n return new RemoveTypenameFromVariablesLink(options);\n}\n\n/**\n * `RemoveTypenameFromVariablesLink` is a non-terminating link that automatically\n * removes `__typename` fields from operation variables to prevent GraphQL\n * validation errors.\n *\n * @remarks\n *\n * When reusing data from a query as input to another GraphQL operation,\n * `__typename` fields can cause server-side validation errors because input\n * types don't accept fields that start with double underscores (`__`).\n * `RemoveTypenameFromVariablesLink` automatically strips these fields from all\n * operation variables.\n *\n * @example\n *\n * ```ts\n * import { RemoveTypenameFromVariablesLink } from \"@apollo/client/link/remove-typename\";\n *\n * const link = new RemoveTypenameFromVariablesLink();\n * ```\n */\nexport class RemoveTypenameFromVariablesLink extends ApolloLink {\n constructor(options: RemoveTypenameFromVariablesLink.Options = {}) {\n super((operation, forward) => {\n const { except } = options;\n const { query, variables } = operation;\n\n if (variables) {\n operation.variables =\n except ?\n maybeStripTypenameUsingConfig(query, variables, except)\n : stripTypename(variables);\n }\n\n return forward(operation);\n });\n return Object.assign(\n this,\n __DEV__ ?\n {\n getMemoryInternals() {\n return {\n removeTypenameFromVariables: {\n getVariableDefinitions: getVariableDefinitions?.size ?? 0,\n },\n };\n },\n }\n : {}\n );\n }\n}\n\nfunction maybeStripTypenameUsingConfig(\n query: DocumentNode,\n variables: OperationVariables,\n config: RemoveTypenameFromVariablesLink.KeepTypenameConfig\n) {\n const variableDefinitions = getVariableDefinitions(query);\n\n return Object.fromEntries(\n Object.entries(variables).map((keyVal) => {\n const [key, value] = keyVal;\n const typename = variableDefinitions[key];\n const typenameConfig = config[typename];\n\n keyVal[1] =\n typenameConfig ?\n maybeStripTypename(value, typenameConfig)\n : stripTypename(value);\n\n return keyVal;\n })\n );\n}\n\ntype JSONPrimitive = string | number | null | boolean;\ntype JSONValue = JSONPrimitive | JSONValue[] | { [key: string]: JSONValue };\n\nfunction maybeStripTypename(\n value: JSONValue,\n config: RemoveTypenameFromVariablesLink.KeepTypenameConfig[string]\n): JSONValue {\n if (config === KEEP) {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map((item) => maybeStripTypename(item, config));\n }\n\n if (isPlainObject(value)) {\n const modified: Record<string, any> = {};\n\n Object.keys(value).forEach((key) => {\n const child = value[key];\n\n if (key === \"__typename\") {\n return;\n }\n\n const fieldConfig = config[key];\n\n modified[key] =\n fieldConfig ?\n maybeStripTypename(child, fieldConfig)\n : stripTypename(child);\n });\n\n return modified;\n }\n\n return value;\n}\n\nconst getVariableDefinitions = wrap(\n (document: DocumentNode) => {\n const definitions: Record<string, string> = {};\n\n visit(document, {\n VariableDefinition(node) {\n definitions[node.variable.name.value] = unwrapType(node.type);\n },\n });\n\n return definitions;\n },\n {\n max:\n cacheSizes[\"removeTypenameFromVariables.getVariableDefinitions\"] ||\n defaultCacheSizes[\"removeTypenameFromVariables.getVariableDefinitions\"],\n cache: WeakCache,\n }\n);\n\nfunction unwrapType(node: TypeNode): string {\n switch (node.kind) {\n case Kind.NON_NULL_TYPE:\n return unwrapType(node.type);\n case Kind.LIST_TYPE:\n return unwrapType(node.type);\n case Kind.NAMED_TYPE:\n return node.name.value;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"removeTypenameFromVariables.js","sourceRoot":"","sources":["../../../src/link/remove-typename/removeTypenameFromVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIhF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAiF7B;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAiD;IAEjD,OAAO,IAAI,+BAA+B,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,+BAAgC,SAAQ,UAAU;IAC7D,YAAY,UAAmD,EAAE;QAC/D,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;YAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC3B,MAAM,EAAE,KAAK,E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AO,WAAW,CAAC;IACrB,CAAC,EACD;QACE,GAAG,EACD,UAAU,CAAC,oDAAoD,CAAC;8FACO;QACzE,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC;KACjC,CACF,CAAC;CACH;AAKD,SAAS,UAAU,CAAC,IAAc;IAChC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,IAAI,CAAC,aAAa;YACrB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,SAAS;YACjB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,UAAU;YAClB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["import { WeakCache } from \"@wry/caches\";\nimport type { DocumentNode, TypeNode } from \"graphql\";\nimport { Kind, visit } from \"graphql\";\nimport { wrap } from \"optimism\";\n\nimport type { OperationVariables } from \"@apollo/client\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { cacheSizes, stripTypename } from \"@apollo/client/utilities\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { bindCacheKey, isPlainObject } from \"@apollo/client/utilities/internal\";\n\nimport { defaultCacheSizes } from \"../../utilities/caching/sizes.js\";\n\n/**\n * Sentinel value used to indicate that `__typename` fields should be kept\n * for a specific field or input type.\n *\n * @remarks\n * Use this value in the `except` configuration to preserve `__typename`\n * fields in JSON scalar fields or other cases where you need to retain\n * the typename information.\n *\n * @example\n *\n * ```ts\n * import {\n * RemoveTypenameFromVariablesLink,\n * KEEP,\n * } from \"@apollo/client/link/remove-typename\";\n *\n * const link = new RemoveTypenameFromVariablesLink({\n * except: {\n * JSON: KEEP, // Keep __typename for all JSON scalar variables\n * DashboardInput: {\n * config: KEEP, // Keep __typename only for the config field\n * },\n * },\n * });\n * ```\n */\nexport const KEEP = \"__KEEP\";\n\nexport declare namespace RemoveTypenameFromVariablesLink {\n /**\n * Configuration object that specifies which input types and fields should\n * retain their `__typename` fields.\n *\n * @remarks\n * This is a recursive configuration where:\n *\n * - Keys represent GraphQL input type names or field names\n * - Values can be either the `KEEP` sentinel to preserve all `__typename`\n * fields, or a nested `KeepTypenameConfig` to preserve `__typename` fields on\n * a specific field name.\n *\n * @example\n *\n * ```ts\n * const config: KeepTypenameConfig = {\n * // Keep __typename for all JSON scalar variables\n * JSON: KEEP,\n *\n * // For DashboardInput, only keep __typename on the config field\n * DashboardInput: {\n * config: KEEP,\n * },\n *\n * // Nested configuration for complex input types\n * UserInput: {\n * profile: {\n * settings: KEEP,\n * },\n * },\n * };\n * ```\n */\n export interface KeepTypenameConfig {\n [key: string]:\n | typeof KEEP\n | RemoveTypenameFromVariablesLink.KeepTypenameConfig;\n }\n\n /**\n * Options for configuring the `RemoveTypenameFromVariablesLink`.\n */\n export interface Options {\n /**\n * Configuration that determines which input types should retain `__typename`\n * fields.\n *\n * Maps GraphQL input type names to configurations. Each configuration can\n * either be the `KEEP` sentinel, to preserve all `__typename` fields, or\n * a nested object that specifies which fields should retain `__typename`.\n *\n * @example\n *\n * ```ts\n * {\n * except: {\n * // Keep __typename for all JSON scalar variables\n * JSON: KEEP,\n *\n * // For DashboardInput, remove __typename except for config field\n * DashboardInput: {\n * config: KEEP,\n * },\n *\n * // Complex nested configuration\n * UserProfileInput: {\n * settings: {\n * preferences: KEEP,\n * },\n * },\n * },\n * }\n * ```\n */\n except?: RemoveTypenameFromVariablesLink.KeepTypenameConfig;\n }\n}\n\n/**\n * @deprecated\n * Use `RemoveTypenameFromVariablesLink` from `@apollo/client/link/remove-typename` instead.\n */\nexport function removeTypenameFromVariables(\n options?: RemoveTypenameFromVariablesLink.Options\n) {\n return new RemoveTypenameFromVariablesLink(options);\n}\n\n/**\n * `RemoveTypenameFromVariablesLink` is a non-terminating link that automatically\n * removes `__typename` fields from operation variables to prevent GraphQL\n * validation errors.\n *\n * @remarks\n *\n * When reusing data from a query as input to another GraphQL operation,\n * `__typename` fields can cause server-side validation errors because input\n * types don't accept fields that start with double underscores (`__`).\n * `RemoveTypenameFromVariablesLink` automatically strips these fields from all\n * operation variables.\n *\n * @example\n *\n * ```ts\n * import { RemoveTypenameFromVariablesLink } from \"@apollo/client/link/remove-typename\";\n *\n * const link = new RemoveTypenameFromVariablesLink();\n * ```\n */\nexport class RemoveTypenameFromVariablesLink extends ApolloLink {\n constructor(options: RemoveTypenameFromVariablesLink.Options = {}) {\n super((operation, forward) => {\n const { except } = options;\n const { query, variables } = operation;\n\n if (variables) {\n operation.variables =\n except ?\n this.maybeStripTypenameUsingConfig(query, variables, except)\n : stripTypename(variables);\n }\n\n return forward(operation);\n });\n return Object.assign(\n this,\n __DEV__ ?\n {\n getMemoryInternals(this: RemoveTypenameFromVariablesLink) {\n return {\n removeTypenameFromVariables: {\n getVariableDefinitions: this.getVariableDefinitions?.size ?? 0,\n },\n };\n },\n }\n : {}\n );\n }\n\n private maybeStripTypenameUsingConfig(\n query: DocumentNode,\n variables: OperationVariables,\n config: RemoveTypenameFromVariablesLink.KeepTypenameConfig\n ) {\n const variableDefinitions = this.getVariableDefinitions(query);\n\n return Object.fromEntries(\n Object.entries(variables).map((keyVal) => {\n const [key, value] = keyVal;\n const typename = variableDefinitions[key];\n const typenameConfig = config[typename];\n\n keyVal[1] =\n typenameConfig ?\n this.maybeStripTypename(value, typenameConfig)\n : stripTypename(value);\n\n return keyVal;\n })\n );\n }\n\n private maybeStripTypename(\n value: JSONValue,\n config: RemoveTypenameFromVariablesLink.KeepTypenameConfig[string]\n ): JSONValue {\n if (config === KEEP) {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map((item) => this.maybeStripTypename(item, config));\n }\n\n if (isPlainObject(value)) {\n const modified: Record<string, any> = {};\n\n Object.keys(value).forEach((key) => {\n const child = value[key];\n\n if (key === \"__typename\") {\n return;\n }\n\n const fieldConfig = config[key];\n\n modified[key] =\n fieldConfig ?\n this.maybeStripTypename(child, fieldConfig)\n : stripTypename(child);\n });\n\n return modified;\n }\n\n return value;\n }\n\n private getVariableDefinitions = wrap(\n (document: DocumentNode) => {\n const definitions: Record<string, string> = {};\n\n visit(document, {\n VariableDefinition(node) {\n definitions[node.variable.name.value] = unwrapType(node.type);\n },\n });\n\n return definitions;\n },\n {\n max:\n cacheSizes[\"removeTypenameFromVariables.getVariableDefinitions\"] ||\n defaultCacheSizes[\"removeTypenameFromVariables.getVariableDefinitions\"],\n cache: WeakCache,\n makeCacheKey: bindCacheKey(this),\n }\n );\n}\n\ntype JSONPrimitive = string | number | null | boolean;\ntype JSONValue = JSONPrimitive | JSONValue[] | { [key: string]: JSONValue };\n\nfunction unwrapType(node: TypeNode): string {\n switch (node.kind) {\n case Kind.NON_NULL_TYPE:\n return unwrapType(node.type);\n case Kind.LIST_TYPE:\n return unwrapType(node.type);\n case Kind.NAMED_TYPE:\n return node.name.value;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { getApolloContext } from "../context/ApolloContext.js";
|
|
|
5
5
|
* @example
|
|
6
6
|
*
|
|
7
7
|
* ```jsx
|
|
8
|
-
* import { useApolloClient } from "@apollo/client";
|
|
8
|
+
* import { useApolloClient } from "@apollo/client/react";
|
|
9
9
|
*
|
|
10
10
|
* function SomeComponent() {
|
|
11
11
|
* const client = useApolloClient();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useApolloClient.js","sources":["../../../src/react/hooks/useApolloClient.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport type { ApolloClient } from \"@apollo/client\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { getApolloContext } from \"../context/ApolloContext.js\";\n\n/**\n * @example\n *\n * ```jsx\n * import { useApolloClient } from \"@apollo/client\";\n *\n * function SomeComponent() {\n * const client = useApolloClient();\n * // `client` is now set to the `ApolloClient` instance being used by the\n * // application (that was configured using something like `ApolloProvider`)\n * }\n * ```\n *\n * @returns The `ApolloClient` instance being used by the application.\n */\nexport function useApolloClient(override?: ApolloClient): ApolloClient {\n const context = React.useContext(getApolloContext());\n const client = override || context.client;\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as an option. ' +\n \"Wrap the root component in an <ApolloProvider>, or pass an ApolloClient \" +\n \"instance in via options.\"\n );\n\n return client;\n}\n"],"names":[],"mappings":"AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAP,CAAA,EAAY,CAAZ,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAuB,CAAvB,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B;AAG9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0B,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAiC,CAAjC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA;;;;;;;;;;;;;;CAcA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAgB,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+B,CAAC,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuD,EAAvD;IACE,CAAF,CAAA,CAAA,CAAA,EAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAkB,CAAlB,CAAA,CAAA,CAAA,CAAuB,CAAC,CAAxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkC,CAAC,CAAnC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmD,CAAnD,CAAqD,CAAC;IACpD,CAAF,CAAA,CAAA,CAAA,EAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,EAAA,EAAiB,CAAjB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAA6B,CAA7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoC,CAAC,CAArC,CAAA,CAAA,CAAA,CAAA,CAA2C;IACzC,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EACI,CAAC,CAAC,CADN,CAAA,CAAA,CAAA,CAAA,MAKG;IAED,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAe;AACf;"}
|
|
1
|
+
{"version":3,"file":"useApolloClient.js","sources":["../../../src/react/hooks/useApolloClient.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport type { ApolloClient } from \"@apollo/client\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { getApolloContext } from \"../context/ApolloContext.js\";\n\n/**\n * @example\n *\n * ```jsx\n * import { useApolloClient } from \"@apollo/client/react\";\n *\n * function SomeComponent() {\n * const client = useApolloClient();\n * // `client` is now set to the `ApolloClient` instance being used by the\n * // application (that was configured using something like `ApolloProvider`)\n * }\n * ```\n *\n * @returns The `ApolloClient` instance being used by the application.\n */\nexport function useApolloClient(override?: ApolloClient): ApolloClient {\n const context = React.useContext(getApolloContext());\n const client = override || context.client;\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as an option. ' +\n \"Wrap the root component in an <ApolloProvider>, or pass an ApolloClient \" +\n \"instance in via options.\"\n );\n\n return client;\n}\n"],"names":[],"mappings":"AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAP,CAAA,EAAY,CAAZ,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAuB,CAAvB,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B;AAG9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0B,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAiC,CAAjC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA;;;;;;;;;;;;;;CAcA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAgB,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+B,CAAC,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuD,EAAvD;IACE,CAAF,CAAA,CAAA,CAAA,EAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAkB,CAAlB,CAAA,CAAA,CAAA,CAAuB,CAAC,CAAxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkC,CAAC,CAAnC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmD,CAAnD,CAAqD,CAAC;IACpD,CAAF,CAAA,CAAA,CAAA,EAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,EAAA,EAAiB,CAAjB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAA6B,CAA7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoC,CAAC,CAArC,CAAA,CAAA,CAAA,CAAA,CAA2C;IACzC,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EACI,CAAC,CAAC,CADN,CAAA,CAAA,CAAA,CAAA,MAKG;IAED,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAe;AACf;"}
|
|
@@ -6,7 +6,7 @@ import { getApolloContext } from "../context/ApolloContext.js";
|
|
|
6
6
|
* @example
|
|
7
7
|
*
|
|
8
8
|
* ```jsx
|
|
9
|
-
* import { useApolloClient } from "@apollo/client";
|
|
9
|
+
* import { useApolloClient } from "@apollo/client/react";
|
|
10
10
|
*
|
|
11
11
|
* function SomeComponent() {
|
|
12
12
|
* const client = useApolloClient();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useApolloClient.js","sources":["../../../src/react/hooks/useApolloClient.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport type { ApolloClient } from \"@apollo/client\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { getApolloContext } from \"../context/ApolloContext.js\";\n\n/**\n * @example\n *\n * ```jsx\n * import { useApolloClient } from \"@apollo/client\";\n *\n * function SomeComponent() {\n * const client = useApolloClient();\n * // `client` is now set to the `ApolloClient` instance being used by the\n * // application (that was configured using something like `ApolloProvider`)\n * }\n * ```\n *\n * @returns The `ApolloClient` instance being used by the application.\n */\nexport function useApolloClient(override?: ApolloClient): ApolloClient {\n const context = React.useContext(getApolloContext());\n const client = override || context.client;\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as an option. ' +\n \"Wrap the root component in an <ApolloProvider>, or pass an ApolloClient \" +\n \"instance in via options.\"\n );\n\n return client;\n}\n"],"names":[],"mappings":";AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAP,CAAA,EAAY,CAAZ,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAuB,CAAvB,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B;AAG9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0B,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAiC,CAAjC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA;;;;;;;;;;;;;;CAcA,CAAA;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"useApolloClient.js","sources":["../../../src/react/hooks/useApolloClient.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport type { ApolloClient } from \"@apollo/client\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { getApolloContext } from \"../context/ApolloContext.js\";\n\n/**\n * @example\n *\n * ```jsx\n * import { useApolloClient } from \"@apollo/client/react\";\n *\n * function SomeComponent() {\n * const client = useApolloClient();\n * // `client` is now set to the `ApolloClient` instance being used by the\n * // application (that was configured using something like `ApolloProvider`)\n * }\n * ```\n *\n * @returns The `ApolloClient` instance being used by the application.\n */\nexport function useApolloClient(override?: ApolloClient): ApolloClient {\n const context = React.useContext(getApolloContext());\n const client = override || context.client;\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as an option. ' +\n \"Wrap the root component in an <ApolloProvider>, or pass an ApolloClient \" +\n \"instance in via options.\"\n );\n\n return client;\n}\n"],"names":[],"mappings":";AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAP,CAAA,EAAY,CAAZ,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAuB,CAAvB,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B;AAG9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0B,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAiC,CAAjC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA;;;;;;;;;;;;;;CAcA,CAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A variant of `optimism`'s `defaultMakeCacheKey` function that allows us to
|
|
3
|
+
* pre-bind some arguments to be part of the cache key Trie path.
|
|
4
|
+
*
|
|
5
|
+
* This should always be used in place of `defaultMakeCacheKey` to bind
|
|
6
|
+
* the `this` context of classes owning wrapped functions, to ensure that
|
|
7
|
+
* the cache keys are collected from memory when the owning object is garbage collected.
|
|
8
|
+
*
|
|
9
|
+
* Without this, cache keys can stay in memory indefinitely, even though the owning
|
|
10
|
+
* Apollo Client instance is long gone.
|
|
11
|
+
* This is a risk in long-running processes with `[DocumentNode, string, string]`
|
|
12
|
+
* style cache keys with persistent document nodes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function bindCacheKey(...prebound: object[]): (...args: any) => object;
|
|
15
|
+
//# sourceMappingURL=bindCacheKey.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defaultMakeCacheKey } from "optimism";
|
|
2
|
+
/**
|
|
3
|
+
* A variant of `optimism`'s `defaultMakeCacheKey` function that allows us to
|
|
4
|
+
* pre-bind some arguments to be part of the cache key Trie path.
|
|
5
|
+
*
|
|
6
|
+
* This should always be used in place of `defaultMakeCacheKey` to bind
|
|
7
|
+
* the `this` context of classes owning wrapped functions, to ensure that
|
|
8
|
+
* the cache keys are collected from memory when the owning object is garbage collected.
|
|
9
|
+
*
|
|
10
|
+
* Without this, cache keys can stay in memory indefinitely, even though the owning
|
|
11
|
+
* Apollo Client instance is long gone.
|
|
12
|
+
* This is a risk in long-running processes with `[DocumentNode, string, string]`
|
|
13
|
+
* style cache keys with persistent document nodes.
|
|
14
|
+
*/
|
|
15
|
+
export function bindCacheKey(...prebound) {
|
|
16
|
+
return defaultMakeCacheKey.bind(null, ...prebound);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=bindCacheKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindCacheKey.js","sourceRoot":"","sources":["../../../src/utilities/internal/bindCacheKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,GAAG,QAAkB;IAChD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { defaultMakeCacheKey } from \"optimism\";\n\n/**\n * A variant of `optimism`'s `defaultMakeCacheKey` function that allows us to\n * pre-bind some arguments to be part of the cache key Trie path.\n *\n * This should always be used in place of `defaultMakeCacheKey` to bind\n * the `this` context of classes owning wrapped functions, to ensure that\n * the cache keys are collected from memory when the owning object is garbage collected.\n *\n * Without this, cache keys can stay in memory indefinitely, even though the owning\n * Apollo Client instance is long gone.\n * This is a risk in long-running processes with `[DocumentNode, string, string]`\n * style cache keys with persistent document nodes.\n */\nexport function bindCacheKey(...prebound: object[]): (...args: any) => object {\n return defaultMakeCacheKey.bind(null, ...prebound);\n}\n"]}
|
|
@@ -62,6 +62,7 @@ export { filterMap } from "./filterMap.js";
|
|
|
62
62
|
export { equalByQuery } from "./equalByQuery.js";
|
|
63
63
|
export { canonicalStringify } from "./canonicalStringify.js";
|
|
64
64
|
export { variablesUnknownSymbol } from "./constants.js";
|
|
65
|
+
export { bindCacheKey } from "./bindCacheKey.js";
|
|
65
66
|
export { getApolloCacheMemoryInternals, getApolloClientMemoryInternals, getInMemoryCacheMemoryInternals, registerGlobalCache, } from "../internal/getMemoryInternals.js";
|
|
66
67
|
export { AutoCleanedStrongCache, AutoCleanedWeakCache } from "./caches.js";
|
|
67
68
|
export type { ApplyHKT } from "./types/ApplyHKT.js";
|
|
@@ -48,6 +48,7 @@ export { filterMap } from "./filterMap.js";
|
|
|
48
48
|
export { equalByQuery } from "./equalByQuery.js";
|
|
49
49
|
export { canonicalStringify } from "./canonicalStringify.js";
|
|
50
50
|
export { variablesUnknownSymbol } from "./constants.js";
|
|
51
|
+
export { bindCacheKey } from "./bindCacheKey.js";
|
|
51
52
|
export { getApolloCacheMemoryInternals, getApolloClientMemoryInternals, getInMemoryCacheMemoryInternals, registerGlobalCache, } from "../internal/getMemoryInternals.js";
|
|
52
53
|
export { AutoCleanedStrongCache, AutoCleanedWeakCache } from "./caches.js";
|
|
53
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/internal/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAA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AAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { DecoratedPromise } from \"./types/DecoratedPromise.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { FragmentMap } from \"./types/FragmentMap.js\";\nexport type { FragmentMapFunction } from \"./types/FragmentMapFunction.js\";\nexport type { FulfilledPromise } from \"./types/FulfilledPromise.js\";\nexport type { IsAny } from \"./types/IsAny.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { PendingPromise } from \"./types/PendingPromise.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { RejectedPromise } from \"./types/RejectedPromise.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\nexport type { VariablesOption } from \"./types/VariablesOption.js\";\nexport type { DocumentationTypes } from \"./types/DocumentationTypes.js\";\n\nexport { argumentsObjectFromField } from \"./argumentsObjectFromField.js\";\nexport { canUseDOM } from \"./canUseDOM.js\";\nexport { checkDocument } from \"./checkDocument.js\";\nexport { cloneDeep } from \"./cloneDeep.js\";\nexport { compact } from \"./compact.js\";\nexport { createFragmentMap } from \"./createFragmentMap.js\";\nexport { createFulfilledPromise } from \"./createFulfilledPromise.js\";\nexport { createRejectedPromise } from \"./createRejectedPromise.js\";\nexport { dealias } from \"./dealias.js\";\nexport { decoratePromise } from \"./decoratePromise.js\";\nexport { DeepMerger } from \"./DeepMerger.js\";\nexport { getDefaultValues } from \"./getDefaultValues.js\";\nexport { getFragmentFromSelection } from \"./getFragmentFromSelection.js\";\nexport { getFragmentQueryDocument } from \"./getFragmentQueryDocument.js\";\nexport { getFragmentDefinition } from \"./getFragmentDefinition.js\";\nexport { getFragmentDefinitions } from \"./getFragmentDefinitions.js\";\nexport { getGraphQLErrorsFromResult } from \"./getGraphQLErrorsFromResult.js\";\nexport { getMainDefinition } from \"./getMainDefinition.js\";\nexport { getOperationDefinition } from \"./getOperationDefinition.js\";\nexport { getOperationName } from \"./getOperationName.js\";\nexport { getQueryDefinition } from \"./getQueryDefinition.js\";\nexport { getStoreKeyName } from \"./getStoreKeyName.js\";\nexport { graphQLResultHasError } from \"./graphQLResultHasError.js\";\nexport { hasDirectives } from \"./hasDirectives.js\";\nexport { hasForcedResolvers } from \"./hasForcedResolvers.js\";\nexport { isArray } from \"./isArray.js\";\nexport { isDocumentNode } from \"./isDocumentNode.js\";\nexport { isField } from \"./isField.js\";\nexport { isNonEmptyArray } from \"./isNonEmptyArray.js\";\nexport { isNonNullObject } from \"./isNonNullObject.js\";\nexport { isPlainObject } from \"./isPlainObject.js\";\nexport { makeReference } from \"./makeReference.js\";\nexport { makeUniqueId } from \"./makeUniqueId.js\";\nexport { maybeDeepFreeze } from \"./maybeDeepFreeze.js\";\nexport { mergeDeep } from \"./mergeDeep.js\";\nexport { mergeDeepArray } from \"./mergeDeepArray.js\";\nexport { mergeOptions } from \"./mergeOptions.js\";\nexport { omitDeep } from \"./omitDeep.js\";\nexport { preventUnhandledRejection } from \"./preventUnhandledRejection.js\";\nexport { removeDirectivesFromDocument } from \"./removeDirectivesFromDocument.js\";\nexport { removeMaskedFragmentSpreads } from \"./removeFragmentSpreads.js\";\nexport { resultKeyNameFromField } from \"./resultKeyNameFromField.js\";\nexport { shouldInclude } from \"./shouldInclude.js\";\nexport { storeKeyNameFromField } from \"./storeKeyNameFromField.js\";\nexport { stringifyForDisplay } from \"./stringifyForDisplay.js\";\nexport { toQueryResult } from \"./toQueryResult.js\";\nexport { filterMap } from \"./filterMap.js\";\nexport { equalByQuery } from \"./equalByQuery.js\";\nexport { canonicalStringify } from \"./canonicalStringify.js\";\nexport { variablesUnknownSymbol } from \"./constants.js\";\nexport { bindCacheKey } from \"./bindCacheKey.js\";\n\nexport {\n getApolloCacheMemoryInternals,\n getApolloClientMemoryInternals,\n getInMemoryCacheMemoryInternals,\n registerGlobalCache,\n} from \"../internal/getMemoryInternals.js\";\n\nexport { AutoCleanedStrongCache, AutoCleanedWeakCache } from \"./caches.js\";\n\nexport type { ApplyHKT } from \"./types/ApplyHKT.js\";\nexport type { ApplyHKTImplementationWithDefault } from \"./types/ApplyHKTImplementationWithDefault.js\";\n"]}
|
package/version.js
CHANGED