houdini 1.2.34 → 1.2.36
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/build/cmd-cjs/index.js +44 -38
- package/build/cmd-esm/index.js +44 -38
- package/build/codegen-cjs/index.js +42 -36
- package/build/codegen-esm/index.js +42 -36
- package/build/lib-cjs/index.js +33 -32
- package/build/lib-esm/index.js +33 -32
- package/build/runtime/cache/subscription.d.ts +0 -1
- package/build/runtime-cjs/cache/subscription.d.ts +0 -1
- package/build/runtime-cjs/cache/subscription.js +32 -31
- package/build/runtime-esm/cache/subscription.d.ts +0 -1
- package/build/runtime-esm/cache/subscription.js +32 -31
- package/build/test-cjs/index.js +42 -36
- package/build/test-esm/index.js +42 -36
- package/build/vite-cjs/index.js +42 -36
- package/build/vite-esm/index.js +42 -36
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -66488,11 +66488,10 @@ var InMemorySubscriptions = class {
|
|
|
66488
66488
|
constructor(cache) {
|
|
66489
66489
|
this.cache = cache;
|
|
66490
66490
|
}
|
|
66491
|
-
subscribers =
|
|
66492
|
-
referenceCounts = {};
|
|
66491
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
66493
66492
|
keyVersions = {};
|
|
66494
66493
|
activeFields(parent2) {
|
|
66495
|
-
return Object.keys(this.subscribers
|
|
66494
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
66496
66495
|
}
|
|
66497
66496
|
add({
|
|
66498
66497
|
parent: parent2,
|
|
@@ -66566,27 +66565,28 @@ var InMemorySubscriptions = class {
|
|
|
66566
66565
|
type
|
|
66567
66566
|
}) {
|
|
66568
66567
|
const spec = selection[0];
|
|
66569
|
-
if (!this.subscribers
|
|
66570
|
-
this.subscribers
|
|
66571
|
-
}
|
|
66572
|
-
|
|
66573
|
-
|
|
66568
|
+
if (!this.subscribers.has(id)) {
|
|
66569
|
+
this.subscribers.set(id, /* @__PURE__ */ new Map());
|
|
66570
|
+
}
|
|
66571
|
+
const subscriber = this.subscribers.get(id);
|
|
66572
|
+
if (!subscriber.has(key)) {
|
|
66573
|
+
subscriber.set(key, {
|
|
66574
|
+
selections: [],
|
|
66575
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
66576
|
+
});
|
|
66574
66577
|
}
|
|
66578
|
+
const subscriberField = subscriber.get(key);
|
|
66575
66579
|
if (!this.keyVersions[key]) {
|
|
66576
66580
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
66577
66581
|
}
|
|
66578
66582
|
this.keyVersions[key].add(key);
|
|
66579
|
-
if (!
|
|
66580
|
-
|
|
66581
|
-
}
|
|
66582
|
-
if (!this.referenceCounts[id]) {
|
|
66583
|
-
this.referenceCounts[id] = {};
|
|
66583
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
66584
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
66584
66585
|
}
|
|
66585
|
-
|
|
66586
|
-
|
|
66587
|
-
|
|
66588
|
-
|
|
66589
|
-
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
66586
|
+
subscriberField.referenceCounts.set(
|
|
66587
|
+
spec.set,
|
|
66588
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
66589
|
+
);
|
|
66590
66590
|
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
66591
66591
|
}
|
|
66592
66592
|
registerList({
|
|
@@ -66673,7 +66673,7 @@ var InMemorySubscriptions = class {
|
|
|
66673
66673
|
}
|
|
66674
66674
|
}
|
|
66675
66675
|
get(id, field) {
|
|
66676
|
-
return this.subscribers
|
|
66676
|
+
return this.subscribers.get(id)?.get(field)?.selections || [];
|
|
66677
66677
|
}
|
|
66678
66678
|
remove(id, selection, targets, variables, visited = []) {
|
|
66679
66679
|
visited.push(id);
|
|
@@ -66699,24 +66699,24 @@ var InMemorySubscriptions = class {
|
|
|
66699
66699
|
}
|
|
66700
66700
|
}
|
|
66701
66701
|
reset() {
|
|
66702
|
-
const subscribers =
|
|
66703
|
-
([id]) => !id.startsWith(rootID)
|
|
66704
|
-
);
|
|
66702
|
+
const subscribers = [...this.subscribers.entries()].filter(([id]) => !id.startsWith(rootID));
|
|
66705
66703
|
for (const [id, _fields] of subscribers) {
|
|
66706
|
-
|
|
66704
|
+
this.subscribers.delete(id);
|
|
66707
66705
|
}
|
|
66708
66706
|
const subscriptionSpecs = subscribers.flatMap(
|
|
66709
|
-
([_id, fields]) =>
|
|
66707
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
66710
66708
|
);
|
|
66711
66709
|
return subscriptionSpecs;
|
|
66712
66710
|
}
|
|
66713
66711
|
removeSubscribers(id, fieldName, specs) {
|
|
66714
66712
|
let targets = [];
|
|
66713
|
+
const subscriber = this.subscribers.get(id);
|
|
66714
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
66715
66715
|
for (const spec of specs) {
|
|
66716
|
-
|
|
66716
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
66717
|
+
if (!counts?.has(spec.set)) {
|
|
66717
66718
|
continue;
|
|
66718
66719
|
}
|
|
66719
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
66720
66720
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
66721
66721
|
counts.set(spec.set, newVal);
|
|
66722
66722
|
if (newVal <= 0) {
|
|
@@ -66724,18 +66724,19 @@ var InMemorySubscriptions = class {
|
|
|
66724
66724
|
counts.delete(spec.set);
|
|
66725
66725
|
}
|
|
66726
66726
|
}
|
|
66727
|
-
if (
|
|
66728
|
-
|
|
66727
|
+
if (subscriberField) {
|
|
66728
|
+
subscriberField.selections = this.get(id, fieldName).filter(
|
|
66729
66729
|
([{ set }]) => !targets.includes(set)
|
|
66730
66730
|
);
|
|
66731
66731
|
}
|
|
66732
66732
|
}
|
|
66733
66733
|
removeAllSubscribers(id, targets, visited = []) {
|
|
66734
66734
|
visited.push(id);
|
|
66735
|
-
|
|
66736
|
-
|
|
66737
|
-
|
|
66738
|
-
|
|
66735
|
+
const subscriber = this.subscribers.get(id);
|
|
66736
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
66737
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
66738
|
+
this.removeSubscribers(id, key, subscribers);
|
|
66739
|
+
const { value, kind } = this.cache._internal_unstable.storage.get(id, key);
|
|
66739
66740
|
if (kind === "scalar") {
|
|
66740
66741
|
continue;
|
|
66741
66742
|
}
|
|
@@ -69525,7 +69526,7 @@ var FieldCollection = class {
|
|
|
69525
69526
|
return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
|
|
69526
69527
|
}
|
|
69527
69528
|
add({ selection, external }) {
|
|
69528
|
-
let include = this.config.defaultFragmentMasking === "disable";
|
|
69529
|
+
let include = this.applyFragments || this.config.defaultFragmentMasking === "disable";
|
|
69529
69530
|
const maskEnableDirective = selection.directives?.find(
|
|
69530
69531
|
({ name }) => name.value === this.config.maskEnableDirective
|
|
69531
69532
|
);
|
|
@@ -71859,7 +71860,12 @@ function prepareSelection({
|
|
|
71859
71860
|
object.fragments = {
|
|
71860
71861
|
...object.fragments,
|
|
71861
71862
|
[fragment2]: {
|
|
71862
|
-
arguments: args ?? {}
|
|
71863
|
+
arguments: args && Object.keys(args ?? {}).length > 0 ? args : Object.fromEntries(
|
|
71864
|
+
withArguments(config, field).map((arg) => [
|
|
71865
|
+
arg.name.value,
|
|
71866
|
+
arg.value
|
|
71867
|
+
])
|
|
71868
|
+
)
|
|
71863
71869
|
}
|
|
71864
71870
|
};
|
|
71865
71871
|
if (globalLoading || field.directives?.find((d3) => d3.name.value === config.loadingDirective)) {
|
|
@@ -72186,7 +72192,7 @@ function artifactGenerator(stats) {
|
|
|
72186
72192
|
document: doc,
|
|
72187
72193
|
rootType,
|
|
72188
72194
|
globalLoading,
|
|
72189
|
-
includeFragments:
|
|
72195
|
+
includeFragments: true,
|
|
72190
72196
|
hasComponents: () => {
|
|
72191
72197
|
hasComponents = true;
|
|
72192
72198
|
},
|
|
@@ -72195,7 +72201,7 @@ function artifactGenerator(stats) {
|
|
|
72195
72201
|
filepath: doc.filename,
|
|
72196
72202
|
selections: selectionSet.selections,
|
|
72197
72203
|
fragmentDefinitions,
|
|
72198
|
-
applyFragments:
|
|
72204
|
+
applyFragments: true
|
|
72199
72205
|
}),
|
|
72200
72206
|
operations: operationsByPath(
|
|
72201
72207
|
config,
|
|
@@ -78518,12 +78524,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78518
78524
|
}
|
|
78519
78525
|
packageJSON2.devDependencies = {
|
|
78520
78526
|
...packageJSON2.devDependencies,
|
|
78521
|
-
houdini: "^1.2.
|
|
78527
|
+
houdini: "^1.2.36"
|
|
78522
78528
|
};
|
|
78523
78529
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78524
78530
|
packageJSON2.devDependencies = {
|
|
78525
78531
|
...packageJSON2.devDependencies,
|
|
78526
|
-
"houdini-svelte": "^1.2.
|
|
78532
|
+
"houdini-svelte": "^1.2.36"
|
|
78527
78533
|
};
|
|
78528
78534
|
} else {
|
|
78529
78535
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
package/build/cmd-esm/index.js
CHANGED
|
@@ -66494,11 +66494,10 @@ var InMemorySubscriptions = class {
|
|
|
66494
66494
|
constructor(cache) {
|
|
66495
66495
|
this.cache = cache;
|
|
66496
66496
|
}
|
|
66497
|
-
subscribers =
|
|
66498
|
-
referenceCounts = {};
|
|
66497
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
66499
66498
|
keyVersions = {};
|
|
66500
66499
|
activeFields(parent2) {
|
|
66501
|
-
return Object.keys(this.subscribers
|
|
66500
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
66502
66501
|
}
|
|
66503
66502
|
add({
|
|
66504
66503
|
parent: parent2,
|
|
@@ -66572,27 +66571,28 @@ var InMemorySubscriptions = class {
|
|
|
66572
66571
|
type
|
|
66573
66572
|
}) {
|
|
66574
66573
|
const spec = selection[0];
|
|
66575
|
-
if (!this.subscribers
|
|
66576
|
-
this.subscribers
|
|
66577
|
-
}
|
|
66578
|
-
|
|
66579
|
-
|
|
66574
|
+
if (!this.subscribers.has(id)) {
|
|
66575
|
+
this.subscribers.set(id, /* @__PURE__ */ new Map());
|
|
66576
|
+
}
|
|
66577
|
+
const subscriber = this.subscribers.get(id);
|
|
66578
|
+
if (!subscriber.has(key)) {
|
|
66579
|
+
subscriber.set(key, {
|
|
66580
|
+
selections: [],
|
|
66581
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
66582
|
+
});
|
|
66580
66583
|
}
|
|
66584
|
+
const subscriberField = subscriber.get(key);
|
|
66581
66585
|
if (!this.keyVersions[key]) {
|
|
66582
66586
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
66583
66587
|
}
|
|
66584
66588
|
this.keyVersions[key].add(key);
|
|
66585
|
-
if (!
|
|
66586
|
-
|
|
66587
|
-
}
|
|
66588
|
-
if (!this.referenceCounts[id]) {
|
|
66589
|
-
this.referenceCounts[id] = {};
|
|
66589
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
66590
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
66590
66591
|
}
|
|
66591
|
-
|
|
66592
|
-
|
|
66593
|
-
|
|
66594
|
-
|
|
66595
|
-
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
66592
|
+
subscriberField.referenceCounts.set(
|
|
66593
|
+
spec.set,
|
|
66594
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
66595
|
+
);
|
|
66596
66596
|
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
66597
66597
|
}
|
|
66598
66598
|
registerList({
|
|
@@ -66679,7 +66679,7 @@ var InMemorySubscriptions = class {
|
|
|
66679
66679
|
}
|
|
66680
66680
|
}
|
|
66681
66681
|
get(id, field) {
|
|
66682
|
-
return this.subscribers
|
|
66682
|
+
return this.subscribers.get(id)?.get(field)?.selections || [];
|
|
66683
66683
|
}
|
|
66684
66684
|
remove(id, selection, targets, variables, visited = []) {
|
|
66685
66685
|
visited.push(id);
|
|
@@ -66705,24 +66705,24 @@ var InMemorySubscriptions = class {
|
|
|
66705
66705
|
}
|
|
66706
66706
|
}
|
|
66707
66707
|
reset() {
|
|
66708
|
-
const subscribers =
|
|
66709
|
-
([id]) => !id.startsWith(rootID)
|
|
66710
|
-
);
|
|
66708
|
+
const subscribers = [...this.subscribers.entries()].filter(([id]) => !id.startsWith(rootID));
|
|
66711
66709
|
for (const [id, _fields] of subscribers) {
|
|
66712
|
-
|
|
66710
|
+
this.subscribers.delete(id);
|
|
66713
66711
|
}
|
|
66714
66712
|
const subscriptionSpecs = subscribers.flatMap(
|
|
66715
|
-
([_id, fields]) =>
|
|
66713
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
66716
66714
|
);
|
|
66717
66715
|
return subscriptionSpecs;
|
|
66718
66716
|
}
|
|
66719
66717
|
removeSubscribers(id, fieldName, specs) {
|
|
66720
66718
|
let targets = [];
|
|
66719
|
+
const subscriber = this.subscribers.get(id);
|
|
66720
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
66721
66721
|
for (const spec of specs) {
|
|
66722
|
-
|
|
66722
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
66723
|
+
if (!counts?.has(spec.set)) {
|
|
66723
66724
|
continue;
|
|
66724
66725
|
}
|
|
66725
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
66726
66726
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
66727
66727
|
counts.set(spec.set, newVal);
|
|
66728
66728
|
if (newVal <= 0) {
|
|
@@ -66730,18 +66730,19 @@ var InMemorySubscriptions = class {
|
|
|
66730
66730
|
counts.delete(spec.set);
|
|
66731
66731
|
}
|
|
66732
66732
|
}
|
|
66733
|
-
if (
|
|
66734
|
-
|
|
66733
|
+
if (subscriberField) {
|
|
66734
|
+
subscriberField.selections = this.get(id, fieldName).filter(
|
|
66735
66735
|
([{ set }]) => !targets.includes(set)
|
|
66736
66736
|
);
|
|
66737
66737
|
}
|
|
66738
66738
|
}
|
|
66739
66739
|
removeAllSubscribers(id, targets, visited = []) {
|
|
66740
66740
|
visited.push(id);
|
|
66741
|
-
|
|
66742
|
-
|
|
66743
|
-
|
|
66744
|
-
|
|
66741
|
+
const subscriber = this.subscribers.get(id);
|
|
66742
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
66743
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
66744
|
+
this.removeSubscribers(id, key, subscribers);
|
|
66745
|
+
const { value, kind } = this.cache._internal_unstable.storage.get(id, key);
|
|
66745
66746
|
if (kind === "scalar") {
|
|
66746
66747
|
continue;
|
|
66747
66748
|
}
|
|
@@ -69530,7 +69531,7 @@ var FieldCollection = class {
|
|
|
69530
69531
|
return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
|
|
69531
69532
|
}
|
|
69532
69533
|
add({ selection, external }) {
|
|
69533
|
-
let include = this.config.defaultFragmentMasking === "disable";
|
|
69534
|
+
let include = this.applyFragments || this.config.defaultFragmentMasking === "disable";
|
|
69534
69535
|
const maskEnableDirective = selection.directives?.find(
|
|
69535
69536
|
({ name }) => name.value === this.config.maskEnableDirective
|
|
69536
69537
|
);
|
|
@@ -71864,7 +71865,12 @@ function prepareSelection({
|
|
|
71864
71865
|
object.fragments = {
|
|
71865
71866
|
...object.fragments,
|
|
71866
71867
|
[fragment2]: {
|
|
71867
|
-
arguments: args ?? {}
|
|
71868
|
+
arguments: args && Object.keys(args ?? {}).length > 0 ? args : Object.fromEntries(
|
|
71869
|
+
withArguments(config, field).map((arg) => [
|
|
71870
|
+
arg.name.value,
|
|
71871
|
+
arg.value
|
|
71872
|
+
])
|
|
71873
|
+
)
|
|
71868
71874
|
}
|
|
71869
71875
|
};
|
|
71870
71876
|
if (globalLoading || field.directives?.find((d3) => d3.name.value === config.loadingDirective)) {
|
|
@@ -72191,7 +72197,7 @@ function artifactGenerator(stats) {
|
|
|
72191
72197
|
document: doc,
|
|
72192
72198
|
rootType,
|
|
72193
72199
|
globalLoading,
|
|
72194
|
-
includeFragments:
|
|
72200
|
+
includeFragments: true,
|
|
72195
72201
|
hasComponents: () => {
|
|
72196
72202
|
hasComponents = true;
|
|
72197
72203
|
},
|
|
@@ -72200,7 +72206,7 @@ function artifactGenerator(stats) {
|
|
|
72200
72206
|
filepath: doc.filename,
|
|
72201
72207
|
selections: selectionSet.selections,
|
|
72202
72208
|
fragmentDefinitions,
|
|
72203
|
-
applyFragments:
|
|
72209
|
+
applyFragments: true
|
|
72204
72210
|
}),
|
|
72205
72211
|
operations: operationsByPath(
|
|
72206
72212
|
config,
|
|
@@ -78523,12 +78529,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78523
78529
|
}
|
|
78524
78530
|
packageJSON2.devDependencies = {
|
|
78525
78531
|
...packageJSON2.devDependencies,
|
|
78526
|
-
houdini: "^1.2.
|
|
78532
|
+
houdini: "^1.2.36"
|
|
78527
78533
|
};
|
|
78528
78534
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78529
78535
|
packageJSON2.devDependencies = {
|
|
78530
78536
|
...packageJSON2.devDependencies,
|
|
78531
|
-
"houdini-svelte": "^1.2.
|
|
78537
|
+
"houdini-svelte": "^1.2.36"
|
|
78532
78538
|
};
|
|
78533
78539
|
} else {
|
|
78534
78540
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
|
@@ -55862,11 +55862,10 @@ var InMemorySubscriptions = class {
|
|
|
55862
55862
|
constructor(cache) {
|
|
55863
55863
|
this.cache = cache;
|
|
55864
55864
|
}
|
|
55865
|
-
subscribers =
|
|
55866
|
-
referenceCounts = {};
|
|
55865
|
+
subscribers = /* @__PURE__ */ new Map();
|
|
55867
55866
|
keyVersions = {};
|
|
55868
55867
|
activeFields(parent2) {
|
|
55869
|
-
return Object.keys(this.subscribers
|
|
55868
|
+
return Object.keys(this.subscribers.get(parent2) || {});
|
|
55870
55869
|
}
|
|
55871
55870
|
add({
|
|
55872
55871
|
parent: parent2,
|
|
@@ -55940,27 +55939,28 @@ var InMemorySubscriptions = class {
|
|
|
55940
55939
|
type
|
|
55941
55940
|
}) {
|
|
55942
55941
|
const spec = selection[0];
|
|
55943
|
-
if (!this.subscribers
|
|
55944
|
-
this.subscribers
|
|
55945
|
-
}
|
|
55946
|
-
|
|
55947
|
-
|
|
55942
|
+
if (!this.subscribers.has(id)) {
|
|
55943
|
+
this.subscribers.set(id, /* @__PURE__ */ new Map());
|
|
55944
|
+
}
|
|
55945
|
+
const subscriber = this.subscribers.get(id);
|
|
55946
|
+
if (!subscriber.has(key)) {
|
|
55947
|
+
subscriber.set(key, {
|
|
55948
|
+
selections: [],
|
|
55949
|
+
referenceCounts: /* @__PURE__ */ new Map()
|
|
55950
|
+
});
|
|
55948
55951
|
}
|
|
55952
|
+
const subscriberField = subscriber.get(key);
|
|
55949
55953
|
if (!this.keyVersions[key]) {
|
|
55950
55954
|
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
55951
55955
|
}
|
|
55952
55956
|
this.keyVersions[key].add(key);
|
|
55953
|
-
if (!
|
|
55954
|
-
|
|
55955
|
-
}
|
|
55956
|
-
if (!this.referenceCounts[id]) {
|
|
55957
|
-
this.referenceCounts[id] = {};
|
|
55957
|
+
if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
|
|
55958
|
+
subscriberField.selections.push([spec, selection[1]]);
|
|
55958
55959
|
}
|
|
55959
|
-
|
|
55960
|
-
|
|
55961
|
-
|
|
55962
|
-
|
|
55963
|
-
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
55960
|
+
subscriberField.referenceCounts.set(
|
|
55961
|
+
spec.set,
|
|
55962
|
+
(subscriberField.referenceCounts.get(spec.set) || 0) + 1
|
|
55963
|
+
);
|
|
55964
55964
|
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
55965
55965
|
}
|
|
55966
55966
|
registerList({
|
|
@@ -56047,7 +56047,7 @@ var InMemorySubscriptions = class {
|
|
|
56047
56047
|
}
|
|
56048
56048
|
}
|
|
56049
56049
|
get(id, field) {
|
|
56050
|
-
return this.subscribers
|
|
56050
|
+
return this.subscribers.get(id)?.get(field)?.selections || [];
|
|
56051
56051
|
}
|
|
56052
56052
|
remove(id, selection, targets, variables, visited = []) {
|
|
56053
56053
|
visited.push(id);
|
|
@@ -56073,24 +56073,24 @@ var InMemorySubscriptions = class {
|
|
|
56073
56073
|
}
|
|
56074
56074
|
}
|
|
56075
56075
|
reset() {
|
|
56076
|
-
const subscribers =
|
|
56077
|
-
([id]) => !id.startsWith(rootID)
|
|
56078
|
-
);
|
|
56076
|
+
const subscribers = [...this.subscribers.entries()].filter(([id]) => !id.startsWith(rootID));
|
|
56079
56077
|
for (const [id, _fields] of subscribers) {
|
|
56080
|
-
|
|
56078
|
+
this.subscribers.delete(id);
|
|
56081
56079
|
}
|
|
56082
56080
|
const subscriptionSpecs = subscribers.flatMap(
|
|
56083
|
-
([_id, fields]) =>
|
|
56081
|
+
([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
|
|
56084
56082
|
);
|
|
56085
56083
|
return subscriptionSpecs;
|
|
56086
56084
|
}
|
|
56087
56085
|
removeSubscribers(id, fieldName, specs) {
|
|
56088
56086
|
let targets = [];
|
|
56087
|
+
const subscriber = this.subscribers.get(id);
|
|
56088
|
+
const subscriberField = subscriber?.get(fieldName);
|
|
56089
56089
|
for (const spec of specs) {
|
|
56090
|
-
|
|
56090
|
+
const counts = subscriber?.get(fieldName)?.referenceCounts;
|
|
56091
|
+
if (!counts?.has(spec.set)) {
|
|
56091
56092
|
continue;
|
|
56092
56093
|
}
|
|
56093
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
56094
56094
|
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
56095
56095
|
counts.set(spec.set, newVal);
|
|
56096
56096
|
if (newVal <= 0) {
|
|
@@ -56098,18 +56098,19 @@ var InMemorySubscriptions = class {
|
|
|
56098
56098
|
counts.delete(spec.set);
|
|
56099
56099
|
}
|
|
56100
56100
|
}
|
|
56101
|
-
if (
|
|
56102
|
-
|
|
56101
|
+
if (subscriberField) {
|
|
56102
|
+
subscriberField.selections = this.get(id, fieldName).filter(
|
|
56103
56103
|
([{ set }]) => !targets.includes(set)
|
|
56104
56104
|
);
|
|
56105
56105
|
}
|
|
56106
56106
|
}
|
|
56107
56107
|
removeAllSubscribers(id, targets, visited = []) {
|
|
56108
56108
|
visited.push(id);
|
|
56109
|
-
|
|
56110
|
-
|
|
56111
|
-
|
|
56112
|
-
|
|
56109
|
+
const subscriber = this.subscribers.get(id);
|
|
56110
|
+
for (const [key, val] of subscriber?.entries() ?? []) {
|
|
56111
|
+
const subscribers = targets || val.selections.map(([spec]) => spec);
|
|
56112
|
+
this.removeSubscribers(id, key, subscribers);
|
|
56113
|
+
const { value, kind } = this.cache._internal_unstable.storage.get(id, key);
|
|
56113
56114
|
if (kind === "scalar") {
|
|
56114
56115
|
continue;
|
|
56115
56116
|
}
|
|
@@ -57914,7 +57915,7 @@ var FieldCollection = class {
|
|
|
57914
57915
|
return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
|
|
57915
57916
|
}
|
|
57916
57917
|
add({ selection, external }) {
|
|
57917
|
-
let include = this.config.defaultFragmentMasking === "disable";
|
|
57918
|
+
let include = this.applyFragments || this.config.defaultFragmentMasking === "disable";
|
|
57918
57919
|
const maskEnableDirective = selection.directives?.find(
|
|
57919
57920
|
({ name }) => name.value === this.config.maskEnableDirective
|
|
57920
57921
|
);
|
|
@@ -60248,7 +60249,12 @@ function prepareSelection({
|
|
|
60248
60249
|
object.fragments = {
|
|
60249
60250
|
...object.fragments,
|
|
60250
60251
|
[fragment2]: {
|
|
60251
|
-
arguments: args ?? {}
|
|
60252
|
+
arguments: args && Object.keys(args ?? {}).length > 0 ? args : Object.fromEntries(
|
|
60253
|
+
withArguments(config, field).map((arg) => [
|
|
60254
|
+
arg.name.value,
|
|
60255
|
+
arg.value
|
|
60256
|
+
])
|
|
60257
|
+
)
|
|
60252
60258
|
}
|
|
60253
60259
|
};
|
|
60254
60260
|
if (globalLoading || field.directives?.find((d) => d.name.value === config.loadingDirective)) {
|
|
@@ -60575,7 +60581,7 @@ function artifactGenerator(stats) {
|
|
|
60575
60581
|
document: doc,
|
|
60576
60582
|
rootType,
|
|
60577
60583
|
globalLoading,
|
|
60578
|
-
includeFragments:
|
|
60584
|
+
includeFragments: true,
|
|
60579
60585
|
hasComponents: () => {
|
|
60580
60586
|
hasComponents = true;
|
|
60581
60587
|
},
|
|
@@ -60584,7 +60590,7 @@ function artifactGenerator(stats) {
|
|
|
60584
60590
|
filepath: doc.filename,
|
|
60585
60591
|
selections: selectionSet.selections,
|
|
60586
60592
|
fragmentDefinitions,
|
|
60587
|
-
applyFragments:
|
|
60593
|
+
applyFragments: true
|
|
60588
60594
|
}),
|
|
60589
60595
|
operations: operationsByPath(
|
|
60590
60596
|
config,
|