houdini 1.3.1 → 1.4.0
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 +57 -22
- package/build/cmd-esm/index.js +57 -22
- package/build/codegen-cjs/index.js +37 -4
- package/build/codegen-esm/index.js +37 -4
- package/build/lib/config.d.ts +1 -0
- package/build/lib/router/types.d.ts +3 -1
- package/build/lib-cjs/index.js +45 -12
- package/build/lib-esm/index.js +44 -12
- package/build/runtime/lib/config.d.ts +10 -1
- package/build/runtime/lib/types.d.ts +14 -2
- 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-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/test-cjs/index.js +43 -9
- package/build/test-esm/index.js +43 -9
- package/build/vite-cjs/index.js +43 -9
- package/build/vite-esm/index.js +43 -9
- package/package.json +3 -3
package/build/test-cjs/index.js
CHANGED
|
@@ -53983,6 +53983,11 @@ var CachePolicy = {
|
|
|
53983
53983
|
CacheAndNetwork: "CacheAndNetwork",
|
|
53984
53984
|
NoCache: "NoCache"
|
|
53985
53985
|
};
|
|
53986
|
+
var DedupeMatchMode = {
|
|
53987
|
+
Variables: "Variables",
|
|
53988
|
+
Operation: "Operation",
|
|
53989
|
+
None: "None"
|
|
53990
|
+
};
|
|
53986
53991
|
var PaginateMode = {
|
|
53987
53992
|
Infinite: "Infinite",
|
|
53988
53993
|
SinglePage: "SinglePage"
|
|
@@ -56767,8 +56772,9 @@ var Config = class {
|
|
|
56767
56772
|
localSchema;
|
|
56768
56773
|
projectRoot;
|
|
56769
56774
|
schema;
|
|
56775
|
+
runtimeDir;
|
|
56770
56776
|
schemaPath;
|
|
56771
|
-
persistedQueriesPath
|
|
56777
|
+
persistedQueriesPath;
|
|
56772
56778
|
exclude;
|
|
56773
56779
|
scalars;
|
|
56774
56780
|
module = "esm";
|
|
@@ -56809,6 +56815,7 @@ var Config = class {
|
|
|
56809
56815
|
let {
|
|
56810
56816
|
schema,
|
|
56811
56817
|
schemaPath = "./schema.graphql",
|
|
56818
|
+
runtimeDir = "$houdini",
|
|
56812
56819
|
exclude = [],
|
|
56813
56820
|
module: module2 = "esm",
|
|
56814
56821
|
scalars,
|
|
@@ -56847,6 +56854,7 @@ var Config = class {
|
|
|
56847
56854
|
this.projectRoot = dirname(
|
|
56848
56855
|
projectDir ? join(process.cwd(), projectDir) : filepath
|
|
56849
56856
|
);
|
|
56857
|
+
this.runtimeDir = runtimeDir;
|
|
56850
56858
|
this.scalars = scalars;
|
|
56851
56859
|
this.cacheBufferSize = cacheBufferSize;
|
|
56852
56860
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -56861,11 +56869,9 @@ var Config = class {
|
|
|
56861
56869
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
56862
56870
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
56863
56871
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
56864
|
-
this.rootDir = join(this.projectRoot,
|
|
56872
|
+
this.rootDir = join(this.projectRoot, this.runtimeDir);
|
|
56873
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join(this.rootDir, "persisted_queries.json");
|
|
56865
56874
|
this.#fragmentVariableMaps = {};
|
|
56866
|
-
if (persistedQueriesPath) {
|
|
56867
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
56868
|
-
}
|
|
56869
56875
|
if (defaultKeys) {
|
|
56870
56876
|
this.defaultKeys = defaultKeys;
|
|
56871
56877
|
}
|
|
@@ -59225,14 +59231,27 @@ async function paginate(config, documents) {
|
|
|
59225
59231
|
return {
|
|
59226
59232
|
...node,
|
|
59227
59233
|
variableDefinitions: finalVariables,
|
|
59228
|
-
directives: [
|
|
59234
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
59229
59235
|
...node.directives || [],
|
|
59230
59236
|
{
|
|
59231
59237
|
kind: graphql13.Kind.DIRECTIVE,
|
|
59232
59238
|
name: {
|
|
59233
59239
|
kind: graphql13.Kind.NAME,
|
|
59234
59240
|
value: config.dedupeDirective
|
|
59235
|
-
}
|
|
59241
|
+
},
|
|
59242
|
+
arguments: [
|
|
59243
|
+
{
|
|
59244
|
+
kind: "Argument",
|
|
59245
|
+
name: {
|
|
59246
|
+
kind: "Name",
|
|
59247
|
+
value: "match"
|
|
59248
|
+
},
|
|
59249
|
+
value: {
|
|
59250
|
+
kind: "EnumValue",
|
|
59251
|
+
value: DedupeMatchMode.Variables
|
|
59252
|
+
}
|
|
59253
|
+
}
|
|
59254
|
+
]
|
|
59236
59255
|
}
|
|
59237
59256
|
]
|
|
59238
59257
|
};
|
|
@@ -60589,7 +60608,13 @@ function artifactGenerator(stats) {
|
|
|
60589
60608
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
60590
60609
|
(arg) => arg.name.value === "cancelFirst"
|
|
60591
60610
|
);
|
|
60592
|
-
|
|
60611
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
60612
|
+
(arg) => arg.name.value === "match"
|
|
60613
|
+
);
|
|
60614
|
+
dedupe = {
|
|
60615
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
60616
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
60617
|
+
};
|
|
60593
60618
|
}
|
|
60594
60619
|
selectionSet = operation.selectionSet;
|
|
60595
60620
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -64256,11 +64281,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
64256
64281
|
"""
|
|
64257
64282
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
64258
64283
|
|
|
64284
|
+
enum DedupeMatchMode {
|
|
64285
|
+
${DedupeMatchMode.Variables}
|
|
64286
|
+
${DedupeMatchMode.Operation}
|
|
64287
|
+
${DedupeMatchMode.None}
|
|
64288
|
+
}
|
|
64289
|
+
|
|
64259
64290
|
"""
|
|
64260
64291
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
64261
64292
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
64293
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
64294
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
64295
|
+
then the request will never be deduplicated.
|
|
64262
64296
|
"""
|
|
64263
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
64297
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
64264
64298
|
|
|
64265
64299
|
"""
|
|
64266
64300
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
package/build/test-esm/index.js
CHANGED
|
@@ -53980,6 +53980,11 @@ var CachePolicy = {
|
|
|
53980
53980
|
CacheAndNetwork: "CacheAndNetwork",
|
|
53981
53981
|
NoCache: "NoCache"
|
|
53982
53982
|
};
|
|
53983
|
+
var DedupeMatchMode = {
|
|
53984
|
+
Variables: "Variables",
|
|
53985
|
+
Operation: "Operation",
|
|
53986
|
+
None: "None"
|
|
53987
|
+
};
|
|
53983
53988
|
var PaginateMode = {
|
|
53984
53989
|
Infinite: "Infinite",
|
|
53985
53990
|
SinglePage: "SinglePage"
|
|
@@ -56763,8 +56768,9 @@ var Config = class {
|
|
|
56763
56768
|
localSchema;
|
|
56764
56769
|
projectRoot;
|
|
56765
56770
|
schema;
|
|
56771
|
+
runtimeDir;
|
|
56766
56772
|
schemaPath;
|
|
56767
|
-
persistedQueriesPath
|
|
56773
|
+
persistedQueriesPath;
|
|
56768
56774
|
exclude;
|
|
56769
56775
|
scalars;
|
|
56770
56776
|
module = "esm";
|
|
@@ -56805,6 +56811,7 @@ var Config = class {
|
|
|
56805
56811
|
let {
|
|
56806
56812
|
schema,
|
|
56807
56813
|
schemaPath = "./schema.graphql",
|
|
56814
|
+
runtimeDir = "$houdini",
|
|
56808
56815
|
exclude = [],
|
|
56809
56816
|
module = "esm",
|
|
56810
56817
|
scalars,
|
|
@@ -56843,6 +56850,7 @@ var Config = class {
|
|
|
56843
56850
|
this.projectRoot = dirname(
|
|
56844
56851
|
projectDir ? join(process.cwd(), projectDir) : filepath
|
|
56845
56852
|
);
|
|
56853
|
+
this.runtimeDir = runtimeDir;
|
|
56846
56854
|
this.scalars = scalars;
|
|
56847
56855
|
this.cacheBufferSize = cacheBufferSize;
|
|
56848
56856
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -56857,11 +56865,9 @@ var Config = class {
|
|
|
56857
56865
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
56858
56866
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
56859
56867
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
56860
|
-
this.rootDir = join(this.projectRoot,
|
|
56868
|
+
this.rootDir = join(this.projectRoot, this.runtimeDir);
|
|
56869
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join(this.rootDir, "persisted_queries.json");
|
|
56861
56870
|
this.#fragmentVariableMaps = {};
|
|
56862
|
-
if (persistedQueriesPath) {
|
|
56863
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
56864
|
-
}
|
|
56865
56871
|
if (defaultKeys) {
|
|
56866
56872
|
this.defaultKeys = defaultKeys;
|
|
56867
56873
|
}
|
|
@@ -59221,14 +59227,27 @@ async function paginate(config, documents) {
|
|
|
59221
59227
|
return {
|
|
59222
59228
|
...node,
|
|
59223
59229
|
variableDefinitions: finalVariables,
|
|
59224
|
-
directives: [
|
|
59230
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
59225
59231
|
...node.directives || [],
|
|
59226
59232
|
{
|
|
59227
59233
|
kind: graphql13.Kind.DIRECTIVE,
|
|
59228
59234
|
name: {
|
|
59229
59235
|
kind: graphql13.Kind.NAME,
|
|
59230
59236
|
value: config.dedupeDirective
|
|
59231
|
-
}
|
|
59237
|
+
},
|
|
59238
|
+
arguments: [
|
|
59239
|
+
{
|
|
59240
|
+
kind: "Argument",
|
|
59241
|
+
name: {
|
|
59242
|
+
kind: "Name",
|
|
59243
|
+
value: "match"
|
|
59244
|
+
},
|
|
59245
|
+
value: {
|
|
59246
|
+
kind: "EnumValue",
|
|
59247
|
+
value: DedupeMatchMode.Variables
|
|
59248
|
+
}
|
|
59249
|
+
}
|
|
59250
|
+
]
|
|
59232
59251
|
}
|
|
59233
59252
|
]
|
|
59234
59253
|
};
|
|
@@ -60585,7 +60604,13 @@ function artifactGenerator(stats) {
|
|
|
60585
60604
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
60586
60605
|
(arg) => arg.name.value === "cancelFirst"
|
|
60587
60606
|
);
|
|
60588
|
-
|
|
60607
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
60608
|
+
(arg) => arg.name.value === "match"
|
|
60609
|
+
);
|
|
60610
|
+
dedupe = {
|
|
60611
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
60612
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
60613
|
+
};
|
|
60589
60614
|
}
|
|
60590
60615
|
selectionSet = operation.selectionSet;
|
|
60591
60616
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -64252,11 +64277,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
64252
64277
|
"""
|
|
64253
64278
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
64254
64279
|
|
|
64280
|
+
enum DedupeMatchMode {
|
|
64281
|
+
${DedupeMatchMode.Variables}
|
|
64282
|
+
${DedupeMatchMode.Operation}
|
|
64283
|
+
${DedupeMatchMode.None}
|
|
64284
|
+
}
|
|
64285
|
+
|
|
64255
64286
|
"""
|
|
64256
64287
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
64257
64288
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
64289
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
64290
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
64291
|
+
then the request will never be deduplicated.
|
|
64258
64292
|
"""
|
|
64259
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
64293
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
64260
64294
|
|
|
64261
64295
|
"""
|
|
64262
64296
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
package/build/vite-cjs/index.js
CHANGED
|
@@ -64623,6 +64623,11 @@ var CachePolicy = {
|
|
|
64623
64623
|
CacheAndNetwork: "CacheAndNetwork",
|
|
64624
64624
|
NoCache: "NoCache"
|
|
64625
64625
|
};
|
|
64626
|
+
var DedupeMatchMode = {
|
|
64627
|
+
Variables: "Variables",
|
|
64628
|
+
Operation: "Operation",
|
|
64629
|
+
None: "None"
|
|
64630
|
+
};
|
|
64626
64631
|
var PaginateMode = {
|
|
64627
64632
|
Infinite: "Infinite",
|
|
64628
64633
|
SinglePage: "SinglePage"
|
|
@@ -69138,8 +69143,9 @@ var Config = class {
|
|
|
69138
69143
|
localSchema;
|
|
69139
69144
|
projectRoot;
|
|
69140
69145
|
schema;
|
|
69146
|
+
runtimeDir;
|
|
69141
69147
|
schemaPath;
|
|
69142
|
-
persistedQueriesPath
|
|
69148
|
+
persistedQueriesPath;
|
|
69143
69149
|
exclude;
|
|
69144
69150
|
scalars;
|
|
69145
69151
|
module = "esm";
|
|
@@ -69180,6 +69186,7 @@ var Config = class {
|
|
|
69180
69186
|
let {
|
|
69181
69187
|
schema,
|
|
69182
69188
|
schemaPath = "./schema.graphql",
|
|
69189
|
+
runtimeDir = "$houdini",
|
|
69183
69190
|
exclude = [],
|
|
69184
69191
|
module: module2 = "esm",
|
|
69185
69192
|
scalars,
|
|
@@ -69218,6 +69225,7 @@ var Config = class {
|
|
|
69218
69225
|
this.projectRoot = dirname(
|
|
69219
69226
|
projectDir ? join2(process.cwd(), projectDir) : filepath
|
|
69220
69227
|
);
|
|
69228
|
+
this.runtimeDir = runtimeDir;
|
|
69221
69229
|
this.scalars = scalars;
|
|
69222
69230
|
this.cacheBufferSize = cacheBufferSize;
|
|
69223
69231
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -69232,11 +69240,9 @@ var Config = class {
|
|
|
69232
69240
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
69233
69241
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
69234
69242
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
69235
|
-
this.rootDir = join2(this.projectRoot,
|
|
69243
|
+
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
69244
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
69236
69245
|
this.#fragmentVariableMaps = {};
|
|
69237
|
-
if (persistedQueriesPath) {
|
|
69238
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
69239
|
-
}
|
|
69240
69246
|
if (defaultKeys) {
|
|
69241
69247
|
this.defaultKeys = defaultKeys;
|
|
69242
69248
|
}
|
|
@@ -72282,14 +72288,27 @@ async function paginate(config2, documents) {
|
|
|
72282
72288
|
return {
|
|
72283
72289
|
...node,
|
|
72284
72290
|
variableDefinitions: finalVariables,
|
|
72285
|
-
directives: [
|
|
72291
|
+
directives: config2.configFile.supressPaginationDeduplication ? node.directives : [
|
|
72286
72292
|
...node.directives || [],
|
|
72287
72293
|
{
|
|
72288
72294
|
kind: graphql13.Kind.DIRECTIVE,
|
|
72289
72295
|
name: {
|
|
72290
72296
|
kind: graphql13.Kind.NAME,
|
|
72291
72297
|
value: config2.dedupeDirective
|
|
72292
|
-
}
|
|
72298
|
+
},
|
|
72299
|
+
arguments: [
|
|
72300
|
+
{
|
|
72301
|
+
kind: "Argument",
|
|
72302
|
+
name: {
|
|
72303
|
+
kind: "Name",
|
|
72304
|
+
value: "match"
|
|
72305
|
+
},
|
|
72306
|
+
value: {
|
|
72307
|
+
kind: "EnumValue",
|
|
72308
|
+
value: DedupeMatchMode.Variables
|
|
72309
|
+
}
|
|
72310
|
+
}
|
|
72311
|
+
]
|
|
72293
72312
|
}
|
|
72294
72313
|
]
|
|
72295
72314
|
};
|
|
@@ -73646,7 +73665,13 @@ function artifactGenerator(stats) {
|
|
|
73646
73665
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
73647
73666
|
(arg) => arg.name.value === "cancelFirst"
|
|
73648
73667
|
);
|
|
73649
|
-
|
|
73668
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
73669
|
+
(arg) => arg.name.value === "match"
|
|
73670
|
+
);
|
|
73671
|
+
dedupe = {
|
|
73672
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
73673
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
73674
|
+
};
|
|
73650
73675
|
}
|
|
73651
73676
|
selectionSet = operation.selectionSet;
|
|
73652
73677
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -77313,11 +77338,20 @@ directive @${config2.paginateDirective}(${config2.listOrPaginateNameArg}: String
|
|
|
77313
77338
|
"""
|
|
77314
77339
|
directive @${config2.listPrependDirective} on FRAGMENT_SPREAD
|
|
77315
77340
|
|
|
77341
|
+
enum DedupeMatchMode {
|
|
77342
|
+
${DedupeMatchMode.Variables}
|
|
77343
|
+
${DedupeMatchMode.Operation}
|
|
77344
|
+
${DedupeMatchMode.None}
|
|
77345
|
+
}
|
|
77346
|
+
|
|
77316
77347
|
"""
|
|
77317
77348
|
@${config2.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
77318
77349
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
77350
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
77351
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
77352
|
+
then the request will never be deduplicated.
|
|
77319
77353
|
"""
|
|
77320
|
-
directive @${config2.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
77354
|
+
directive @${config2.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
77321
77355
|
|
|
77322
77356
|
"""
|
|
77323
77357
|
@${config2.optimisticKeyDirective} is used to identify a field as an optimistic key
|
package/build/vite-esm/index.js
CHANGED
|
@@ -64617,6 +64617,11 @@ var CachePolicy = {
|
|
|
64617
64617
|
CacheAndNetwork: "CacheAndNetwork",
|
|
64618
64618
|
NoCache: "NoCache"
|
|
64619
64619
|
};
|
|
64620
|
+
var DedupeMatchMode = {
|
|
64621
|
+
Variables: "Variables",
|
|
64622
|
+
Operation: "Operation",
|
|
64623
|
+
None: "None"
|
|
64624
|
+
};
|
|
64620
64625
|
var PaginateMode = {
|
|
64621
64626
|
Infinite: "Infinite",
|
|
64622
64627
|
SinglePage: "SinglePage"
|
|
@@ -69131,8 +69136,9 @@ var Config = class {
|
|
|
69131
69136
|
localSchema;
|
|
69132
69137
|
projectRoot;
|
|
69133
69138
|
schema;
|
|
69139
|
+
runtimeDir;
|
|
69134
69140
|
schemaPath;
|
|
69135
|
-
persistedQueriesPath
|
|
69141
|
+
persistedQueriesPath;
|
|
69136
69142
|
exclude;
|
|
69137
69143
|
scalars;
|
|
69138
69144
|
module = "esm";
|
|
@@ -69173,6 +69179,7 @@ var Config = class {
|
|
|
69173
69179
|
let {
|
|
69174
69180
|
schema,
|
|
69175
69181
|
schemaPath = "./schema.graphql",
|
|
69182
|
+
runtimeDir = "$houdini",
|
|
69176
69183
|
exclude = [],
|
|
69177
69184
|
module = "esm",
|
|
69178
69185
|
scalars,
|
|
@@ -69211,6 +69218,7 @@ var Config = class {
|
|
|
69211
69218
|
this.projectRoot = dirname(
|
|
69212
69219
|
projectDir ? join2(process.cwd(), projectDir) : filepath
|
|
69213
69220
|
);
|
|
69221
|
+
this.runtimeDir = runtimeDir;
|
|
69214
69222
|
this.scalars = scalars;
|
|
69215
69223
|
this.cacheBufferSize = cacheBufferSize;
|
|
69216
69224
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -69225,11 +69233,9 @@ var Config = class {
|
|
|
69225
69233
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
69226
69234
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
69227
69235
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
69228
|
-
this.rootDir = join2(this.projectRoot,
|
|
69236
|
+
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
69237
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
69229
69238
|
this.#fragmentVariableMaps = {};
|
|
69230
|
-
if (persistedQueriesPath) {
|
|
69231
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
69232
|
-
}
|
|
69233
69239
|
if (defaultKeys) {
|
|
69234
69240
|
this.defaultKeys = defaultKeys;
|
|
69235
69241
|
}
|
|
@@ -72275,14 +72281,27 @@ async function paginate(config2, documents) {
|
|
|
72275
72281
|
return {
|
|
72276
72282
|
...node,
|
|
72277
72283
|
variableDefinitions: finalVariables,
|
|
72278
|
-
directives: [
|
|
72284
|
+
directives: config2.configFile.supressPaginationDeduplication ? node.directives : [
|
|
72279
72285
|
...node.directives || [],
|
|
72280
72286
|
{
|
|
72281
72287
|
kind: graphql13.Kind.DIRECTIVE,
|
|
72282
72288
|
name: {
|
|
72283
72289
|
kind: graphql13.Kind.NAME,
|
|
72284
72290
|
value: config2.dedupeDirective
|
|
72285
|
-
}
|
|
72291
|
+
},
|
|
72292
|
+
arguments: [
|
|
72293
|
+
{
|
|
72294
|
+
kind: "Argument",
|
|
72295
|
+
name: {
|
|
72296
|
+
kind: "Name",
|
|
72297
|
+
value: "match"
|
|
72298
|
+
},
|
|
72299
|
+
value: {
|
|
72300
|
+
kind: "EnumValue",
|
|
72301
|
+
value: DedupeMatchMode.Variables
|
|
72302
|
+
}
|
|
72303
|
+
}
|
|
72304
|
+
]
|
|
72286
72305
|
}
|
|
72287
72306
|
]
|
|
72288
72307
|
};
|
|
@@ -73639,7 +73658,13 @@ function artifactGenerator(stats) {
|
|
|
73639
73658
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
73640
73659
|
(arg) => arg.name.value === "cancelFirst"
|
|
73641
73660
|
);
|
|
73642
|
-
|
|
73661
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
73662
|
+
(arg) => arg.name.value === "match"
|
|
73663
|
+
);
|
|
73664
|
+
dedupe = {
|
|
73665
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
73666
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
73667
|
+
};
|
|
73643
73668
|
}
|
|
73644
73669
|
selectionSet = operation.selectionSet;
|
|
73645
73670
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -77306,11 +77331,20 @@ directive @${config2.paginateDirective}(${config2.listOrPaginateNameArg}: String
|
|
|
77306
77331
|
"""
|
|
77307
77332
|
directive @${config2.listPrependDirective} on FRAGMENT_SPREAD
|
|
77308
77333
|
|
|
77334
|
+
enum DedupeMatchMode {
|
|
77335
|
+
${DedupeMatchMode.Variables}
|
|
77336
|
+
${DedupeMatchMode.Operation}
|
|
77337
|
+
${DedupeMatchMode.None}
|
|
77338
|
+
}
|
|
77339
|
+
|
|
77309
77340
|
"""
|
|
77310
77341
|
@${config2.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
77311
77342
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
77343
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
77344
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
77345
|
+
then the request will never be deduplicated.
|
|
77312
77346
|
"""
|
|
77313
|
-
directive @${config2.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
77347
|
+
directive @${config2.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
77314
77348
|
|
|
77315
77349
|
"""
|
|
77316
77350
|
@${config2.optimisticKeyDirective} is used to identify a field as an optimistic key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "The disappearing GraphQL clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@types/ungap__structured-clone": "^0.3.0",
|
|
25
25
|
"kleur": "^4.1.5",
|
|
26
26
|
"prettier": "^2.8.3",
|
|
27
|
-
"rollup": "^4.
|
|
28
|
-
"vite": "^
|
|
27
|
+
"rollup": "^4.28.1",
|
|
28
|
+
"vite": "^6.0.3",
|
|
29
29
|
"vitest": "^1.6.0",
|
|
30
30
|
"scripts": "^1.0.0"
|
|
31
31
|
},
|