houdini 1.3.1 → 1.4.1
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 +143 -28
- package/build/cmd-esm/index.js +143 -28
- package/build/codegen-cjs/index.js +123 -10
- package/build/codegen-esm/index.js +123 -10
- package/build/lib/config.d.ts +1 -0
- package/build/lib/router/types.d.ts +3 -1
- package/build/lib-cjs/index.js +92 -19
- package/build/lib-esm/index.js +91 -19
- package/build/runtime/cache/cache.d.ts +1 -1
- package/build/runtime/cache/lists.d.ts +3 -1
- package/build/runtime/lib/config.d.ts +10 -1
- package/build/runtime/lib/types.d.ts +14 -2
- package/build/runtime-cjs/cache/cache.d.ts +1 -1
- package/build/runtime-cjs/cache/cache.js +31 -5
- package/build/runtime-cjs/cache/lists.d.ts +3 -1
- package/build/runtime-cjs/cache/lists.js +15 -1
- package/build/runtime-cjs/client/documentStore.js +27 -7
- package/build/runtime-cjs/client/plugins/fetch.js +5 -0
- package/build/runtime-cjs/lib/config.d.ts +10 -1
- package/build/runtime-cjs/lib/types.d.ts +14 -2
- package/build/runtime-cjs/lib/types.js +7 -0
- package/build/runtime-cjs/router/match.js +1 -1
- package/build/runtime-esm/cache/cache.d.ts +1 -1
- package/build/runtime-esm/cache/cache.js +31 -5
- package/build/runtime-esm/cache/lists.d.ts +3 -1
- package/build/runtime-esm/cache/lists.js +15 -1
- package/build/runtime-esm/client/documentStore.js +28 -8
- package/build/runtime-esm/client/plugins/fetch.js +5 -0
- package/build/runtime-esm/lib/config.d.ts +10 -1
- package/build/runtime-esm/lib/types.d.ts +14 -2
- package/build/runtime-esm/lib/types.js +6 -0
- package/build/runtime-esm/router/match.js +1 -1
- package/build/test-cjs/index.js +129 -15
- package/build/test-esm/index.js +129 -15
- package/build/vite/ast.d.ts +8 -2
- package/build/vite-cjs/index.js +374 -255
- package/build/vite-esm/index.js +374 -255
- package/package.json +3 -3
|
@@ -53973,6 +53973,11 @@ var CachePolicy = {
|
|
|
53973
53973
|
CacheAndNetwork: "CacheAndNetwork",
|
|
53974
53974
|
NoCache: "NoCache"
|
|
53975
53975
|
};
|
|
53976
|
+
var DedupeMatchMode = {
|
|
53977
|
+
Variables: "Variables",
|
|
53978
|
+
Operation: "Operation",
|
|
53979
|
+
None: "None"
|
|
53980
|
+
};
|
|
53976
53981
|
var PaginateMode = {
|
|
53977
53982
|
Infinite: "Infinite",
|
|
53978
53983
|
SinglePage: "SinglePage"
|
|
@@ -54552,7 +54557,18 @@ var ListManager = class {
|
|
|
54552
54557
|
}
|
|
54553
54558
|
lists = /* @__PURE__ */ new Map();
|
|
54554
54559
|
listsByField = /* @__PURE__ */ new Map();
|
|
54555
|
-
get(listName, id, allLists) {
|
|
54560
|
+
get(listName, id, allLists, skipMatches) {
|
|
54561
|
+
const lists = this.getLists(listName, id, allLists);
|
|
54562
|
+
if (!lists) {
|
|
54563
|
+
return null;
|
|
54564
|
+
}
|
|
54565
|
+
if (skipMatches) {
|
|
54566
|
+
return new ListCollection(lists.lists.filter((list) => !skipMatches.has(list.fieldRef)));
|
|
54567
|
+
} else {
|
|
54568
|
+
return lists;
|
|
54569
|
+
}
|
|
54570
|
+
}
|
|
54571
|
+
getLists(listName, id, allLists) {
|
|
54556
54572
|
const matches = this.lists.get(listName);
|
|
54557
54573
|
if (!matches || matches.size === 0) {
|
|
54558
54574
|
return null;
|
|
@@ -54674,6 +54690,9 @@ var List = class {
|
|
|
54674
54690
|
this.manager = manager;
|
|
54675
54691
|
this.abstract = abstract;
|
|
54676
54692
|
}
|
|
54693
|
+
get fieldRef() {
|
|
54694
|
+
return `${this.recordID}.${this.key}`;
|
|
54695
|
+
}
|
|
54677
54696
|
when(when) {
|
|
54678
54697
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
54679
54698
|
}
|
|
@@ -55826,8 +55845,8 @@ var Cache = class {
|
|
|
55826
55845
|
variables
|
|
55827
55846
|
);
|
|
55828
55847
|
}
|
|
55829
|
-
list(name, parentID, allLists) {
|
|
55830
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
55848
|
+
list(name, parentID, allLists, skipMatches) {
|
|
55849
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
55831
55850
|
if (!handler) {
|
|
55832
55851
|
throw new Error(
|
|
55833
55852
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -56242,6 +56261,7 @@ var CacheInternal = class {
|
|
|
56242
56261
|
});
|
|
56243
56262
|
}
|
|
56244
56263
|
}
|
|
56264
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
56245
56265
|
for (const operation of operations || []) {
|
|
56246
56266
|
let parentID;
|
|
56247
56267
|
if (operation.parentID) {
|
|
@@ -56261,7 +56281,12 @@ var CacheInternal = class {
|
|
|
56261
56281
|
const targets = Array.isArray(value) ? value : [value];
|
|
56262
56282
|
for (const target of targets) {
|
|
56263
56283
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
56264
|
-
this.cache.list(
|
|
56284
|
+
this.cache.list(
|
|
56285
|
+
operation.list,
|
|
56286
|
+
parentID,
|
|
56287
|
+
operation.target === "all",
|
|
56288
|
+
processedOperations
|
|
56289
|
+
).when(operation.when).addToList(
|
|
56265
56290
|
fieldSelection,
|
|
56266
56291
|
target,
|
|
56267
56292
|
variables,
|
|
@@ -56269,7 +56294,12 @@ var CacheInternal = class {
|
|
|
56269
56294
|
layer
|
|
56270
56295
|
);
|
|
56271
56296
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
56272
|
-
this.cache.list(
|
|
56297
|
+
this.cache.list(
|
|
56298
|
+
operation.list,
|
|
56299
|
+
parentID,
|
|
56300
|
+
operation.target === "all",
|
|
56301
|
+
processedOperations
|
|
56302
|
+
).when(operation.when).toggleElement({
|
|
56273
56303
|
selection: fieldSelection,
|
|
56274
56304
|
data: target,
|
|
56275
56305
|
variables,
|
|
@@ -56277,7 +56307,12 @@ var CacheInternal = class {
|
|
|
56277
56307
|
layer
|
|
56278
56308
|
});
|
|
56279
56309
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
56280
|
-
this.cache.list(
|
|
56310
|
+
this.cache.list(
|
|
56311
|
+
operation.list,
|
|
56312
|
+
parentID,
|
|
56313
|
+
operation.target === "all",
|
|
56314
|
+
processedOperations
|
|
56315
|
+
).when(operation.when).remove(target, variables, layer);
|
|
56281
56316
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
56282
56317
|
const targetID = this.id(operation.type, target);
|
|
56283
56318
|
if (!targetID) {
|
|
@@ -56289,6 +56324,16 @@ var CacheInternal = class {
|
|
|
56289
56324
|
this.cache.delete(targetID, layer);
|
|
56290
56325
|
}
|
|
56291
56326
|
}
|
|
56327
|
+
if (operation.list) {
|
|
56328
|
+
const matchingLists = this.cache.list(
|
|
56329
|
+
operation.list,
|
|
56330
|
+
parentID,
|
|
56331
|
+
operation.target === "all"
|
|
56332
|
+
);
|
|
56333
|
+
for (const list of matchingLists.lists) {
|
|
56334
|
+
processedOperations.add(list.fieldRef);
|
|
56335
|
+
}
|
|
56336
|
+
}
|
|
56292
56337
|
}
|
|
56293
56338
|
}
|
|
56294
56339
|
return toNotify;
|
|
@@ -58855,14 +58900,27 @@ async function paginate(config, documents) {
|
|
|
58855
58900
|
return {
|
|
58856
58901
|
...node,
|
|
58857
58902
|
variableDefinitions: finalVariables,
|
|
58858
|
-
directives: [
|
|
58903
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
58859
58904
|
...node.directives || [],
|
|
58860
58905
|
{
|
|
58861
58906
|
kind: graphql13.Kind.DIRECTIVE,
|
|
58862
58907
|
name: {
|
|
58863
58908
|
kind: graphql13.Kind.NAME,
|
|
58864
58909
|
value: config.dedupeDirective
|
|
58865
|
-
}
|
|
58910
|
+
},
|
|
58911
|
+
arguments: [
|
|
58912
|
+
{
|
|
58913
|
+
kind: "Argument",
|
|
58914
|
+
name: {
|
|
58915
|
+
kind: "Name",
|
|
58916
|
+
value: "match"
|
|
58917
|
+
},
|
|
58918
|
+
value: {
|
|
58919
|
+
kind: "EnumValue",
|
|
58920
|
+
value: DedupeMatchMode.Variables
|
|
58921
|
+
}
|
|
58922
|
+
}
|
|
58923
|
+
]
|
|
58866
58924
|
}
|
|
58867
58925
|
]
|
|
58868
58926
|
};
|
|
@@ -59230,6 +59288,46 @@ function objectNode([type, defaultValue]) {
|
|
|
59230
59288
|
return node;
|
|
59231
59289
|
}
|
|
59232
59290
|
var pageInfoSelection = [
|
|
59291
|
+
{
|
|
59292
|
+
kind: graphql13.Kind.FIELD,
|
|
59293
|
+
name: {
|
|
59294
|
+
kind: graphql13.Kind.NAME,
|
|
59295
|
+
value: "pageInfo"
|
|
59296
|
+
},
|
|
59297
|
+
selectionSet: {
|
|
59298
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59299
|
+
selections: [
|
|
59300
|
+
{
|
|
59301
|
+
kind: graphql13.Kind.FIELD,
|
|
59302
|
+
name: {
|
|
59303
|
+
kind: graphql13.Kind.NAME,
|
|
59304
|
+
value: "hasPreviousPage"
|
|
59305
|
+
}
|
|
59306
|
+
},
|
|
59307
|
+
{
|
|
59308
|
+
kind: graphql13.Kind.FIELD,
|
|
59309
|
+
name: {
|
|
59310
|
+
kind: graphql13.Kind.NAME,
|
|
59311
|
+
value: "hasNextPage"
|
|
59312
|
+
}
|
|
59313
|
+
},
|
|
59314
|
+
{
|
|
59315
|
+
kind: graphql13.Kind.FIELD,
|
|
59316
|
+
name: {
|
|
59317
|
+
kind: graphql13.Kind.NAME,
|
|
59318
|
+
value: "startCursor"
|
|
59319
|
+
}
|
|
59320
|
+
},
|
|
59321
|
+
{
|
|
59322
|
+
kind: graphql13.Kind.FIELD,
|
|
59323
|
+
name: {
|
|
59324
|
+
kind: graphql13.Kind.NAME,
|
|
59325
|
+
value: "endCursor"
|
|
59326
|
+
}
|
|
59327
|
+
}
|
|
59328
|
+
]
|
|
59329
|
+
}
|
|
59330
|
+
},
|
|
59233
59331
|
{
|
|
59234
59332
|
kind: graphql13.Kind.FIELD,
|
|
59235
59333
|
name: {
|
|
@@ -60219,7 +60317,13 @@ function artifactGenerator(stats) {
|
|
|
60219
60317
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
60220
60318
|
(arg) => arg.name.value === "cancelFirst"
|
|
60221
60319
|
);
|
|
60222
|
-
|
|
60320
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
60321
|
+
(arg) => arg.name.value === "match"
|
|
60322
|
+
);
|
|
60323
|
+
dedupe = {
|
|
60324
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
60325
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
60326
|
+
};
|
|
60223
60327
|
}
|
|
60224
60328
|
selectionSet = operation.selectionSet;
|
|
60225
60329
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -63886,11 +63990,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
63886
63990
|
"""
|
|
63887
63991
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
63888
63992
|
|
|
63993
|
+
enum DedupeMatchMode {
|
|
63994
|
+
${DedupeMatchMode.Variables}
|
|
63995
|
+
${DedupeMatchMode.Operation}
|
|
63996
|
+
${DedupeMatchMode.None}
|
|
63997
|
+
}
|
|
63998
|
+
|
|
63889
63999
|
"""
|
|
63890
64000
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
63891
64001
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
64002
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
64003
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
64004
|
+
then the request will never be deduplicated.
|
|
63892
64005
|
"""
|
|
63893
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
64006
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
63894
64007
|
|
|
63895
64008
|
"""
|
|
63896
64009
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
package/build/lib/config.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export type Adapter = ((args: {
|
|
|
9
9
|
manifest: ProjectManifest;
|
|
10
10
|
adapterPath: string;
|
|
11
11
|
}) => void | Promise<void>) & {
|
|
12
|
-
includePaths?: Record<string, string
|
|
12
|
+
includePaths?: Record<string, string> | ((args: {
|
|
13
|
+
config: Config;
|
|
14
|
+
}) => Record<string, string>);
|
|
13
15
|
disableServer?: boolean;
|
|
14
16
|
pre?: (args: {
|
|
15
17
|
config: Config;
|
package/build/lib-cjs/index.js
CHANGED
|
@@ -58181,6 +58181,7 @@ __export(lib_exports, {
|
|
|
58181
58181
|
CompiledSubscriptionKind: () => CompiledSubscriptionKind,
|
|
58182
58182
|
Config: () => Config,
|
|
58183
58183
|
DataSource: () => DataSource,
|
|
58184
|
+
DedupeMatchMode: () => DedupeMatchMode,
|
|
58184
58185
|
DocumentStore: () => DocumentStore,
|
|
58185
58186
|
HoudiniClient: () => HoudiniClient,
|
|
58186
58187
|
HoudiniError: () => HoudiniError,
|
|
@@ -61533,6 +61534,11 @@ var CachePolicy = {
|
|
|
61533
61534
|
CacheAndNetwork: "CacheAndNetwork",
|
|
61534
61535
|
NoCache: "NoCache"
|
|
61535
61536
|
};
|
|
61537
|
+
var DedupeMatchMode = {
|
|
61538
|
+
Variables: "Variables",
|
|
61539
|
+
Operation: "Operation",
|
|
61540
|
+
None: "None"
|
|
61541
|
+
};
|
|
61536
61542
|
var PaginateMode = {
|
|
61537
61543
|
Infinite: "Infinite",
|
|
61538
61544
|
SinglePage: "SinglePage"
|
|
@@ -63979,7 +63985,18 @@ var ListManager = class {
|
|
|
63979
63985
|
}
|
|
63980
63986
|
lists = /* @__PURE__ */ new Map();
|
|
63981
63987
|
listsByField = /* @__PURE__ */ new Map();
|
|
63982
|
-
get(listName, id, allLists) {
|
|
63988
|
+
get(listName, id, allLists, skipMatches) {
|
|
63989
|
+
const lists = this.getLists(listName, id, allLists);
|
|
63990
|
+
if (!lists) {
|
|
63991
|
+
return null;
|
|
63992
|
+
}
|
|
63993
|
+
if (skipMatches) {
|
|
63994
|
+
return new ListCollection(lists.lists.filter((list) => !skipMatches.has(list.fieldRef)));
|
|
63995
|
+
} else {
|
|
63996
|
+
return lists;
|
|
63997
|
+
}
|
|
63998
|
+
}
|
|
63999
|
+
getLists(listName, id, allLists) {
|
|
63983
64000
|
const matches = this.lists.get(listName);
|
|
63984
64001
|
if (!matches || matches.size === 0) {
|
|
63985
64002
|
return null;
|
|
@@ -64101,6 +64118,9 @@ var List = class {
|
|
|
64101
64118
|
this.manager = manager;
|
|
64102
64119
|
this.abstract = abstract;
|
|
64103
64120
|
}
|
|
64121
|
+
get fieldRef() {
|
|
64122
|
+
return `${this.recordID}.${this.key}`;
|
|
64123
|
+
}
|
|
64104
64124
|
when(when) {
|
|
64105
64125
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
64106
64126
|
}
|
|
@@ -65253,8 +65273,8 @@ var Cache = class {
|
|
|
65253
65273
|
variables
|
|
65254
65274
|
);
|
|
65255
65275
|
}
|
|
65256
|
-
list(name, parentID, allLists) {
|
|
65257
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
65276
|
+
list(name, parentID, allLists, skipMatches) {
|
|
65277
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
65258
65278
|
if (!handler) {
|
|
65259
65279
|
throw new Error(
|
|
65260
65280
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -65669,6 +65689,7 @@ var CacheInternal = class {
|
|
|
65669
65689
|
});
|
|
65670
65690
|
}
|
|
65671
65691
|
}
|
|
65692
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
65672
65693
|
for (const operation of operations || []) {
|
|
65673
65694
|
let parentID;
|
|
65674
65695
|
if (operation.parentID) {
|
|
@@ -65688,7 +65709,12 @@ var CacheInternal = class {
|
|
|
65688
65709
|
const targets = Array.isArray(value) ? value : [value];
|
|
65689
65710
|
for (const target of targets) {
|
|
65690
65711
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
65691
|
-
this.cache.list(
|
|
65712
|
+
this.cache.list(
|
|
65713
|
+
operation.list,
|
|
65714
|
+
parentID,
|
|
65715
|
+
operation.target === "all",
|
|
65716
|
+
processedOperations
|
|
65717
|
+
).when(operation.when).addToList(
|
|
65692
65718
|
fieldSelection,
|
|
65693
65719
|
target,
|
|
65694
65720
|
variables,
|
|
@@ -65696,7 +65722,12 @@ var CacheInternal = class {
|
|
|
65696
65722
|
layer
|
|
65697
65723
|
);
|
|
65698
65724
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
65699
|
-
this.cache.list(
|
|
65725
|
+
this.cache.list(
|
|
65726
|
+
operation.list,
|
|
65727
|
+
parentID,
|
|
65728
|
+
operation.target === "all",
|
|
65729
|
+
processedOperations
|
|
65730
|
+
).when(operation.when).toggleElement({
|
|
65700
65731
|
selection: fieldSelection,
|
|
65701
65732
|
data: target,
|
|
65702
65733
|
variables,
|
|
@@ -65704,7 +65735,12 @@ var CacheInternal = class {
|
|
|
65704
65735
|
layer
|
|
65705
65736
|
});
|
|
65706
65737
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
65707
|
-
this.cache.list(
|
|
65738
|
+
this.cache.list(
|
|
65739
|
+
operation.list,
|
|
65740
|
+
parentID,
|
|
65741
|
+
operation.target === "all",
|
|
65742
|
+
processedOperations
|
|
65743
|
+
).when(operation.when).remove(target, variables, layer);
|
|
65708
65744
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
65709
65745
|
const targetID = this.id(operation.type, target);
|
|
65710
65746
|
if (!targetID) {
|
|
@@ -65716,6 +65752,16 @@ var CacheInternal = class {
|
|
|
65716
65752
|
this.cache.delete(targetID, layer);
|
|
65717
65753
|
}
|
|
65718
65754
|
}
|
|
65755
|
+
if (operation.list) {
|
|
65756
|
+
const matchingLists = this.cache.list(
|
|
65757
|
+
operation.list,
|
|
65758
|
+
parentID,
|
|
65759
|
+
operation.target === "all"
|
|
65760
|
+
);
|
|
65761
|
+
for (const list of matchingLists.lists) {
|
|
65762
|
+
processedOperations.add(list.fieldRef);
|
|
65763
|
+
}
|
|
65764
|
+
}
|
|
65719
65765
|
}
|
|
65720
65766
|
}
|
|
65721
65767
|
return toNotify;
|
|
@@ -66232,6 +66278,11 @@ var defaultFetch = (url, params) => {
|
|
|
66232
66278
|
...params?.headers
|
|
66233
66279
|
}
|
|
66234
66280
|
});
|
|
66281
|
+
if (!result.ok && !result.headers.get("content-type")?.startsWith("application/json") && !result.headers.get("content-type")?.startsWith("application/graphql+json")) {
|
|
66282
|
+
throw new Error(
|
|
66283
|
+
`Failed to fetch: server returned invalid response with error ${result.status}: ${result.statusText}`
|
|
66284
|
+
);
|
|
66285
|
+
}
|
|
66235
66286
|
return await result.json();
|
|
66236
66287
|
};
|
|
66237
66288
|
};
|
|
@@ -67052,7 +67103,8 @@ var DocumentStore = class extends Writable {
|
|
|
67052
67103
|
pendingPromise = null;
|
|
67053
67104
|
serverSideFallback;
|
|
67054
67105
|
controllerKey(variables) {
|
|
67055
|
-
|
|
67106
|
+
const usedVariables = "dedupe" in this.artifact && this.artifact.dedupe?.match !== DedupeMatchMode.Variables ? {} : variables;
|
|
67107
|
+
return `${this.artifact.name}@${stableStringify(usedVariables)}`;
|
|
67056
67108
|
}
|
|
67057
67109
|
constructor({
|
|
67058
67110
|
artifact,
|
|
@@ -67114,16 +67166,20 @@ var DocumentStore = class extends Writable {
|
|
|
67114
67166
|
silenceEcho = false,
|
|
67115
67167
|
abortController = new AbortController()
|
|
67116
67168
|
} = {}) {
|
|
67117
|
-
if ("dedupe" in this.artifact) {
|
|
67118
|
-
|
|
67119
|
-
|
|
67120
|
-
|
|
67121
|
-
inflightRequests[
|
|
67169
|
+
if ("dedupe" in this.artifact && this.artifact.dedupe && this.artifact.dedupe.match !== "None") {
|
|
67170
|
+
const dedupeKey = this.controllerKey(variables);
|
|
67171
|
+
if (inflightRequests[dedupeKey]) {
|
|
67172
|
+
if (this.artifact.dedupe.cancel === "first") {
|
|
67173
|
+
inflightRequests[dedupeKey].controller.abort();
|
|
67174
|
+
inflightRequests[dedupeKey].controller = abortController;
|
|
67122
67175
|
} else {
|
|
67123
67176
|
abortController.abort();
|
|
67124
67177
|
}
|
|
67125
67178
|
} else {
|
|
67126
|
-
inflightRequests[
|
|
67179
|
+
inflightRequests[dedupeKey] = {
|
|
67180
|
+
variables,
|
|
67181
|
+
controller: abortController
|
|
67182
|
+
};
|
|
67127
67183
|
}
|
|
67128
67184
|
}
|
|
67129
67185
|
let context = new ClientPluginContextWrapper({
|
|
@@ -67445,6 +67501,21 @@ function marshalVariables(ctx) {
|
|
|
67445
67501
|
function variablesChanged(ctx) {
|
|
67446
67502
|
return ctx.stuff.inputs?.changed;
|
|
67447
67503
|
}
|
|
67504
|
+
function stableStringify(obj) {
|
|
67505
|
+
return JSON.stringify(sortObject(obj));
|
|
67506
|
+
}
|
|
67507
|
+
function sortObject(obj) {
|
|
67508
|
+
if (obj === null || typeof obj !== "object") {
|
|
67509
|
+
return obj;
|
|
67510
|
+
}
|
|
67511
|
+
if (Array.isArray(obj)) {
|
|
67512
|
+
return obj.map(sortObject);
|
|
67513
|
+
}
|
|
67514
|
+
return Object.keys(obj).sort().reduce((result, key) => {
|
|
67515
|
+
result[key] = sortObject(obj[key]);
|
|
67516
|
+
return result;
|
|
67517
|
+
}, {});
|
|
67518
|
+
}
|
|
67448
67519
|
|
|
67449
67520
|
// src/runtime/client/plugins/injectedPlugins.ts
|
|
67450
67521
|
var plugins = [];
|
|
@@ -67882,8 +67953,9 @@ var Config = class {
|
|
|
67882
67953
|
localSchema;
|
|
67883
67954
|
projectRoot;
|
|
67884
67955
|
schema;
|
|
67956
|
+
runtimeDir;
|
|
67885
67957
|
schemaPath;
|
|
67886
|
-
persistedQueriesPath
|
|
67958
|
+
persistedQueriesPath;
|
|
67887
67959
|
exclude;
|
|
67888
67960
|
scalars;
|
|
67889
67961
|
module = "esm";
|
|
@@ -67924,6 +67996,7 @@ var Config = class {
|
|
|
67924
67996
|
let {
|
|
67925
67997
|
schema,
|
|
67926
67998
|
schemaPath = "./schema.graphql",
|
|
67999
|
+
runtimeDir = "$houdini",
|
|
67927
68000
|
exclude = [],
|
|
67928
68001
|
module: module2 = "esm",
|
|
67929
68002
|
scalars,
|
|
@@ -67962,6 +68035,7 @@ var Config = class {
|
|
|
67962
68035
|
this.projectRoot = dirname(
|
|
67963
68036
|
projectDir ? join2(process.cwd(), projectDir) : filepath
|
|
67964
68037
|
);
|
|
68038
|
+
this.runtimeDir = runtimeDir;
|
|
67965
68039
|
this.scalars = scalars;
|
|
67966
68040
|
this.cacheBufferSize = cacheBufferSize;
|
|
67967
68041
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -67976,11 +68050,9 @@ var Config = class {
|
|
|
67976
68050
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
67977
68051
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
67978
68052
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
67979
|
-
this.rootDir = join2(this.projectRoot,
|
|
68053
|
+
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
68054
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
67980
68055
|
this.#fragmentVariableMaps = {};
|
|
67981
|
-
if (persistedQueriesPath) {
|
|
67982
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
67983
|
-
}
|
|
67984
68056
|
if (defaultKeys) {
|
|
67985
68057
|
this.defaultKeys = defaultKeys;
|
|
67986
68058
|
}
|
|
@@ -69292,7 +69364,7 @@ function exec(match, params) {
|
|
|
69292
69364
|
if (param.rest)
|
|
69293
69365
|
result[param.name] = "";
|
|
69294
69366
|
} else {
|
|
69295
|
-
result[param.name] = value;
|
|
69367
|
+
result[param.name] = decodeURIComponent(value);
|
|
69296
69368
|
}
|
|
69297
69369
|
}
|
|
69298
69370
|
if (buffered)
|
|
@@ -69820,6 +69892,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
69820
69892
|
CompiledSubscriptionKind,
|
|
69821
69893
|
Config,
|
|
69822
69894
|
DataSource,
|
|
69895
|
+
DedupeMatchMode,
|
|
69823
69896
|
DocumentStore,
|
|
69824
69897
|
HoudiniClient,
|
|
69825
69898
|
HoudiniError,
|