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/cmd-cjs/index.js
CHANGED
|
@@ -63313,6 +63313,11 @@ var CachePolicy = {
|
|
|
63313
63313
|
CacheAndNetwork: "CacheAndNetwork",
|
|
63314
63314
|
NoCache: "NoCache"
|
|
63315
63315
|
};
|
|
63316
|
+
var DedupeMatchMode = {
|
|
63317
|
+
Variables: "Variables",
|
|
63318
|
+
Operation: "Operation",
|
|
63319
|
+
None: "None"
|
|
63320
|
+
};
|
|
63316
63321
|
var PaginateMode = {
|
|
63317
63322
|
Infinite: "Infinite",
|
|
63318
63323
|
SinglePage: "SinglePage"
|
|
@@ -67587,8 +67592,9 @@ var Config = class {
|
|
|
67587
67592
|
localSchema;
|
|
67588
67593
|
projectRoot;
|
|
67589
67594
|
schema;
|
|
67595
|
+
runtimeDir;
|
|
67590
67596
|
schemaPath;
|
|
67591
|
-
persistedQueriesPath
|
|
67597
|
+
persistedQueriesPath;
|
|
67592
67598
|
exclude;
|
|
67593
67599
|
scalars;
|
|
67594
67600
|
module = "esm";
|
|
@@ -67629,6 +67635,7 @@ var Config = class {
|
|
|
67629
67635
|
let {
|
|
67630
67636
|
schema,
|
|
67631
67637
|
schemaPath = "./schema.graphql",
|
|
67638
|
+
runtimeDir = "$houdini",
|
|
67632
67639
|
exclude = [],
|
|
67633
67640
|
module: module2 = "esm",
|
|
67634
67641
|
scalars,
|
|
@@ -67667,6 +67674,7 @@ var Config = class {
|
|
|
67667
67674
|
this.projectRoot = dirname(
|
|
67668
67675
|
projectDir ? join2(process.cwd(), projectDir) : filepath
|
|
67669
67676
|
);
|
|
67677
|
+
this.runtimeDir = runtimeDir;
|
|
67670
67678
|
this.scalars = scalars;
|
|
67671
67679
|
this.cacheBufferSize = cacheBufferSize;
|
|
67672
67680
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -67681,11 +67689,9 @@ var Config = class {
|
|
|
67681
67689
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
67682
67690
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
67683
67691
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
67684
|
-
this.rootDir = join2(this.projectRoot,
|
|
67692
|
+
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
67693
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
67685
67694
|
this.#fragmentVariableMaps = {};
|
|
67686
|
-
if (persistedQueriesPath) {
|
|
67687
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
67688
|
-
}
|
|
67689
67695
|
if (defaultKeys) {
|
|
67690
67696
|
this.defaultKeys = defaultKeys;
|
|
67691
67697
|
}
|
|
@@ -70662,14 +70668,27 @@ async function paginate(config, documents) {
|
|
|
70662
70668
|
return {
|
|
70663
70669
|
...node,
|
|
70664
70670
|
variableDefinitions: finalVariables,
|
|
70665
|
-
directives: [
|
|
70671
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
70666
70672
|
...node.directives || [],
|
|
70667
70673
|
{
|
|
70668
70674
|
kind: graphql13.Kind.DIRECTIVE,
|
|
70669
70675
|
name: {
|
|
70670
70676
|
kind: graphql13.Kind.NAME,
|
|
70671
70677
|
value: config.dedupeDirective
|
|
70672
|
-
}
|
|
70678
|
+
},
|
|
70679
|
+
arguments: [
|
|
70680
|
+
{
|
|
70681
|
+
kind: "Argument",
|
|
70682
|
+
name: {
|
|
70683
|
+
kind: "Name",
|
|
70684
|
+
value: "match"
|
|
70685
|
+
},
|
|
70686
|
+
value: {
|
|
70687
|
+
kind: "EnumValue",
|
|
70688
|
+
value: DedupeMatchMode.Variables
|
|
70689
|
+
}
|
|
70690
|
+
}
|
|
70691
|
+
]
|
|
70673
70692
|
}
|
|
70674
70693
|
]
|
|
70675
70694
|
};
|
|
@@ -72026,7 +72045,13 @@ function artifactGenerator(stats) {
|
|
|
72026
72045
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
72027
72046
|
(arg) => arg.name.value === "cancelFirst"
|
|
72028
72047
|
);
|
|
72029
|
-
|
|
72048
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
72049
|
+
(arg) => arg.name.value === "match"
|
|
72050
|
+
);
|
|
72051
|
+
dedupe = {
|
|
72052
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
72053
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
72054
|
+
};
|
|
72030
72055
|
}
|
|
72031
72056
|
selectionSet = operation.selectionSet;
|
|
72032
72057
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -75693,11 +75718,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
75693
75718
|
"""
|
|
75694
75719
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
75695
75720
|
|
|
75721
|
+
enum DedupeMatchMode {
|
|
75722
|
+
${DedupeMatchMode.Variables}
|
|
75723
|
+
${DedupeMatchMode.Operation}
|
|
75724
|
+
${DedupeMatchMode.None}
|
|
75725
|
+
}
|
|
75726
|
+
|
|
75696
75727
|
"""
|
|
75697
75728
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
75698
75729
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
75730
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
75731
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
75732
|
+
then the request will never be deduplicated.
|
|
75699
75733
|
"""
|
|
75700
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
75734
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
75701
75735
|
|
|
75702
75736
|
"""
|
|
75703
75737
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
|
@@ -78247,6 +78281,7 @@ async function houdiniConfig(configPath, schemaPath, module2, frameworkInfo, url
|
|
|
78247
78281
|
url
|
|
78248
78282
|
};
|
|
78249
78283
|
}
|
|
78284
|
+
config.runtimeDir = ".houdini";
|
|
78250
78285
|
if (schemaPath !== "./schema.graphql") {
|
|
78251
78286
|
config.schemaPath = schemaPath;
|
|
78252
78287
|
}
|
|
@@ -78328,7 +78363,7 @@ const config = {
|
|
|
78328
78363
|
kit: {
|
|
78329
78364
|
adapter: adapter(),
|
|
78330
78365
|
alias: {
|
|
78331
|
-
$houdini: '
|
|
78366
|
+
$houdini: '.houdini/'
|
|
78332
78367
|
}
|
|
78333
78368
|
}
|
|
78334
78369
|
};
|
|
@@ -78342,7 +78377,7 @@ const config = {
|
|
|
78342
78377
|
kit: {
|
|
78343
78378
|
adapter: adapter(),
|
|
78344
78379
|
alias: {
|
|
78345
|
-
$houdini: '
|
|
78380
|
+
$houdini: '.houdini/'
|
|
78346
78381
|
}
|
|
78347
78382
|
}
|
|
78348
78383
|
};
|
|
@@ -78354,8 +78389,8 @@ export default config;
|
|
|
78354
78389
|
async function gitIgnore(targetPath) {
|
|
78355
78390
|
const filepath = path_exports.join(targetPath, ".gitignore");
|
|
78356
78391
|
const existing = await fs_exports.readFile(filepath) || "";
|
|
78357
|
-
if (!existing.includes("\n
|
|
78358
|
-
await fs_exports.writeFile(filepath, existing + "\n
|
|
78392
|
+
if (!existing.includes("\n.houdini\n")) {
|
|
78393
|
+
await fs_exports.writeFile(filepath, existing + "\n.houdini\n");
|
|
78359
78394
|
}
|
|
78360
78395
|
}
|
|
78361
78396
|
async function graphqlRC(targetPath) {
|
|
@@ -78364,11 +78399,11 @@ async function graphqlRC(targetPath) {
|
|
|
78364
78399
|
default:
|
|
78365
78400
|
schema:
|
|
78366
78401
|
- ./schema.graphql
|
|
78367
|
-
-
|
|
78402
|
+
- ./.houdini/graphql/schema.graphql
|
|
78368
78403
|
documents:
|
|
78369
78404
|
- '**/*.gql'
|
|
78370
78405
|
- '**/*.svelte'
|
|
78371
|
-
-
|
|
78406
|
+
- ./.houdini/graphql/documents.gql
|
|
78372
78407
|
`;
|
|
78373
78408
|
await fs_exports.writeFile(target, content);
|
|
78374
78409
|
}
|
|
@@ -78386,7 +78421,7 @@ export default defineConfig({
|
|
|
78386
78421
|
|
|
78387
78422
|
resolve: {
|
|
78388
78423
|
alias: {
|
|
78389
|
-
$houdini:
|
|
78424
|
+
$houdini: '.houdini/',
|
|
78390
78425
|
},
|
|
78391
78426
|
},
|
|
78392
78427
|
})
|
|
@@ -78423,15 +78458,15 @@ async function tjsConfig(targetPath, frameworkInfo) {
|
|
|
78423
78458
|
var tjsConfig2 = parseJSON(tjsConfigFile);
|
|
78424
78459
|
}
|
|
78425
78460
|
if (frameworkInfo.framework === "svelte") {
|
|
78426
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "
|
|
78461
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.houdini/types"];
|
|
78427
78462
|
} else if (frameworkInfo.framework === "kit") {
|
|
78428
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "
|
|
78463
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "./.houdini/types"];
|
|
78429
78464
|
}
|
|
78430
78465
|
if (frameworkInfo.framework === "svelte") {
|
|
78431
78466
|
tjsConfig2.compilerOptions.paths = {
|
|
78432
78467
|
...tjsConfig2.compilerOptions.paths,
|
|
78433
|
-
$houdini: ["
|
|
78434
|
-
"$houdini/*": ["
|
|
78468
|
+
$houdini: ["./.houdini/"],
|
|
78469
|
+
"$houdini/*": ["./.houdini/*"]
|
|
78435
78470
|
};
|
|
78436
78471
|
}
|
|
78437
78472
|
await fs_exports.writeFile(configFile, JSON.stringify(tjsConfig2, null, 4));
|
|
@@ -78448,12 +78483,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78448
78483
|
}
|
|
78449
78484
|
packageJSON2.devDependencies = {
|
|
78450
78485
|
...packageJSON2.devDependencies,
|
|
78451
|
-
houdini: "^1.
|
|
78486
|
+
houdini: "^1.4.0"
|
|
78452
78487
|
};
|
|
78453
78488
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78454
78489
|
packageJSON2.devDependencies = {
|
|
78455
78490
|
...packageJSON2.devDependencies,
|
|
78456
|
-
"houdini-svelte": "^2.0
|
|
78491
|
+
"houdini-svelte": "^2.1.0"
|
|
78457
78492
|
};
|
|
78458
78493
|
} else {
|
|
78459
78494
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
package/build/cmd-esm/index.js
CHANGED
|
@@ -63319,6 +63319,11 @@ var CachePolicy = {
|
|
|
63319
63319
|
CacheAndNetwork: "CacheAndNetwork",
|
|
63320
63320
|
NoCache: "NoCache"
|
|
63321
63321
|
};
|
|
63322
|
+
var DedupeMatchMode = {
|
|
63323
|
+
Variables: "Variables",
|
|
63324
|
+
Operation: "Operation",
|
|
63325
|
+
None: "None"
|
|
63326
|
+
};
|
|
63322
63327
|
var PaginateMode = {
|
|
63323
63328
|
Infinite: "Infinite",
|
|
63324
63329
|
SinglePage: "SinglePage"
|
|
@@ -67592,8 +67597,9 @@ var Config = class {
|
|
|
67592
67597
|
localSchema;
|
|
67593
67598
|
projectRoot;
|
|
67594
67599
|
schema;
|
|
67600
|
+
runtimeDir;
|
|
67595
67601
|
schemaPath;
|
|
67596
|
-
persistedQueriesPath
|
|
67602
|
+
persistedQueriesPath;
|
|
67597
67603
|
exclude;
|
|
67598
67604
|
scalars;
|
|
67599
67605
|
module = "esm";
|
|
@@ -67634,6 +67640,7 @@ var Config = class {
|
|
|
67634
67640
|
let {
|
|
67635
67641
|
schema,
|
|
67636
67642
|
schemaPath = "./schema.graphql",
|
|
67643
|
+
runtimeDir = "$houdini",
|
|
67637
67644
|
exclude = [],
|
|
67638
67645
|
module = "esm",
|
|
67639
67646
|
scalars,
|
|
@@ -67672,6 +67679,7 @@ var Config = class {
|
|
|
67672
67679
|
this.projectRoot = dirname(
|
|
67673
67680
|
projectDir ? join2(process.cwd(), projectDir) : filepath
|
|
67674
67681
|
);
|
|
67682
|
+
this.runtimeDir = runtimeDir;
|
|
67675
67683
|
this.scalars = scalars;
|
|
67676
67684
|
this.cacheBufferSize = cacheBufferSize;
|
|
67677
67685
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
@@ -67686,11 +67694,9 @@ var Config = class {
|
|
|
67686
67694
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
67687
67695
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
67688
67696
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
67689
|
-
this.rootDir = join2(this.projectRoot,
|
|
67697
|
+
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
67698
|
+
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
67690
67699
|
this.#fragmentVariableMaps = {};
|
|
67691
|
-
if (persistedQueriesPath) {
|
|
67692
|
-
this.persistedQueriesPath = persistedQueriesPath;
|
|
67693
|
-
}
|
|
67694
67700
|
if (defaultKeys) {
|
|
67695
67701
|
this.defaultKeys = defaultKeys;
|
|
67696
67702
|
}
|
|
@@ -70667,14 +70673,27 @@ async function paginate(config, documents) {
|
|
|
70667
70673
|
return {
|
|
70668
70674
|
...node,
|
|
70669
70675
|
variableDefinitions: finalVariables,
|
|
70670
|
-
directives: [
|
|
70676
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
70671
70677
|
...node.directives || [],
|
|
70672
70678
|
{
|
|
70673
70679
|
kind: graphql13.Kind.DIRECTIVE,
|
|
70674
70680
|
name: {
|
|
70675
70681
|
kind: graphql13.Kind.NAME,
|
|
70676
70682
|
value: config.dedupeDirective
|
|
70677
|
-
}
|
|
70683
|
+
},
|
|
70684
|
+
arguments: [
|
|
70685
|
+
{
|
|
70686
|
+
kind: "Argument",
|
|
70687
|
+
name: {
|
|
70688
|
+
kind: "Name",
|
|
70689
|
+
value: "match"
|
|
70690
|
+
},
|
|
70691
|
+
value: {
|
|
70692
|
+
kind: "EnumValue",
|
|
70693
|
+
value: DedupeMatchMode.Variables
|
|
70694
|
+
}
|
|
70695
|
+
}
|
|
70696
|
+
]
|
|
70678
70697
|
}
|
|
70679
70698
|
]
|
|
70680
70699
|
};
|
|
@@ -72031,7 +72050,13 @@ function artifactGenerator(stats) {
|
|
|
72031
72050
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
72032
72051
|
(arg) => arg.name.value === "cancelFirst"
|
|
72033
72052
|
);
|
|
72034
|
-
|
|
72053
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
72054
|
+
(arg) => arg.name.value === "match"
|
|
72055
|
+
);
|
|
72056
|
+
dedupe = {
|
|
72057
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
72058
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
72059
|
+
};
|
|
72035
72060
|
}
|
|
72036
72061
|
selectionSet = operation.selectionSet;
|
|
72037
72062
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -75698,11 +75723,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
75698
75723
|
"""
|
|
75699
75724
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
75700
75725
|
|
|
75726
|
+
enum DedupeMatchMode {
|
|
75727
|
+
${DedupeMatchMode.Variables}
|
|
75728
|
+
${DedupeMatchMode.Operation}
|
|
75729
|
+
${DedupeMatchMode.None}
|
|
75730
|
+
}
|
|
75731
|
+
|
|
75701
75732
|
"""
|
|
75702
75733
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
75703
75734
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
75735
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
75736
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
75737
|
+
then the request will never be deduplicated.
|
|
75704
75738
|
"""
|
|
75705
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
75739
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
75706
75740
|
|
|
75707
75741
|
"""
|
|
75708
75742
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
|
@@ -78252,6 +78286,7 @@ async function houdiniConfig(configPath, schemaPath, module, frameworkInfo, url)
|
|
|
78252
78286
|
url
|
|
78253
78287
|
};
|
|
78254
78288
|
}
|
|
78289
|
+
config.runtimeDir = ".houdini";
|
|
78255
78290
|
if (schemaPath !== "./schema.graphql") {
|
|
78256
78291
|
config.schemaPath = schemaPath;
|
|
78257
78292
|
}
|
|
@@ -78333,7 +78368,7 @@ const config = {
|
|
|
78333
78368
|
kit: {
|
|
78334
78369
|
adapter: adapter(),
|
|
78335
78370
|
alias: {
|
|
78336
|
-
$houdini: '
|
|
78371
|
+
$houdini: '.houdini/'
|
|
78337
78372
|
}
|
|
78338
78373
|
}
|
|
78339
78374
|
};
|
|
@@ -78347,7 +78382,7 @@ const config = {
|
|
|
78347
78382
|
kit: {
|
|
78348
78383
|
adapter: adapter(),
|
|
78349
78384
|
alias: {
|
|
78350
|
-
$houdini: '
|
|
78385
|
+
$houdini: '.houdini/'
|
|
78351
78386
|
}
|
|
78352
78387
|
}
|
|
78353
78388
|
};
|
|
@@ -78359,8 +78394,8 @@ export default config;
|
|
|
78359
78394
|
async function gitIgnore(targetPath) {
|
|
78360
78395
|
const filepath = path_exports.join(targetPath, ".gitignore");
|
|
78361
78396
|
const existing = await fs_exports.readFile(filepath) || "";
|
|
78362
|
-
if (!existing.includes("\n
|
|
78363
|
-
await fs_exports.writeFile(filepath, existing + "\n
|
|
78397
|
+
if (!existing.includes("\n.houdini\n")) {
|
|
78398
|
+
await fs_exports.writeFile(filepath, existing + "\n.houdini\n");
|
|
78364
78399
|
}
|
|
78365
78400
|
}
|
|
78366
78401
|
async function graphqlRC(targetPath) {
|
|
@@ -78369,11 +78404,11 @@ async function graphqlRC(targetPath) {
|
|
|
78369
78404
|
default:
|
|
78370
78405
|
schema:
|
|
78371
78406
|
- ./schema.graphql
|
|
78372
|
-
-
|
|
78407
|
+
- ./.houdini/graphql/schema.graphql
|
|
78373
78408
|
documents:
|
|
78374
78409
|
- '**/*.gql'
|
|
78375
78410
|
- '**/*.svelte'
|
|
78376
|
-
-
|
|
78411
|
+
- ./.houdini/graphql/documents.gql
|
|
78377
78412
|
`;
|
|
78378
78413
|
await fs_exports.writeFile(target, content);
|
|
78379
78414
|
}
|
|
@@ -78391,7 +78426,7 @@ export default defineConfig({
|
|
|
78391
78426
|
|
|
78392
78427
|
resolve: {
|
|
78393
78428
|
alias: {
|
|
78394
|
-
$houdini:
|
|
78429
|
+
$houdini: '.houdini/',
|
|
78395
78430
|
},
|
|
78396
78431
|
},
|
|
78397
78432
|
})
|
|
@@ -78428,15 +78463,15 @@ async function tjsConfig(targetPath, frameworkInfo) {
|
|
|
78428
78463
|
var tjsConfig2 = parseJSON(tjsConfigFile);
|
|
78429
78464
|
}
|
|
78430
78465
|
if (frameworkInfo.framework === "svelte") {
|
|
78431
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "
|
|
78466
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.houdini/types"];
|
|
78432
78467
|
} else if (frameworkInfo.framework === "kit") {
|
|
78433
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "
|
|
78468
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "./.houdini/types"];
|
|
78434
78469
|
}
|
|
78435
78470
|
if (frameworkInfo.framework === "svelte") {
|
|
78436
78471
|
tjsConfig2.compilerOptions.paths = {
|
|
78437
78472
|
...tjsConfig2.compilerOptions.paths,
|
|
78438
|
-
$houdini: ["
|
|
78439
|
-
"$houdini/*": ["
|
|
78473
|
+
$houdini: ["./.houdini/"],
|
|
78474
|
+
"$houdini/*": ["./.houdini/*"]
|
|
78440
78475
|
};
|
|
78441
78476
|
}
|
|
78442
78477
|
await fs_exports.writeFile(configFile, JSON.stringify(tjsConfig2, null, 4));
|
|
@@ -78453,12 +78488,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78453
78488
|
}
|
|
78454
78489
|
packageJSON2.devDependencies = {
|
|
78455
78490
|
...packageJSON2.devDependencies,
|
|
78456
|
-
houdini: "^1.
|
|
78491
|
+
houdini: "^1.4.0"
|
|
78457
78492
|
};
|
|
78458
78493
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78459
78494
|
packageJSON2.devDependencies = {
|
|
78460
78495
|
...packageJSON2.devDependencies,
|
|
78461
|
-
"houdini-svelte": "^2.0
|
|
78496
|
+
"houdini-svelte": "^2.1.0"
|
|
78462
78497
|
};
|
|
78463
78498
|
} else {
|
|
78464
78499
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
|
@@ -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"
|
|
@@ -58856,14 +58861,27 @@ async function paginate(config, documents) {
|
|
|
58856
58861
|
return {
|
|
58857
58862
|
...node,
|
|
58858
58863
|
variableDefinitions: finalVariables,
|
|
58859
|
-
directives: [
|
|
58864
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
58860
58865
|
...node.directives || [],
|
|
58861
58866
|
{
|
|
58862
58867
|
kind: graphql13.Kind.DIRECTIVE,
|
|
58863
58868
|
name: {
|
|
58864
58869
|
kind: graphql13.Kind.NAME,
|
|
58865
58870
|
value: config.dedupeDirective
|
|
58866
|
-
}
|
|
58871
|
+
},
|
|
58872
|
+
arguments: [
|
|
58873
|
+
{
|
|
58874
|
+
kind: "Argument",
|
|
58875
|
+
name: {
|
|
58876
|
+
kind: "Name",
|
|
58877
|
+
value: "match"
|
|
58878
|
+
},
|
|
58879
|
+
value: {
|
|
58880
|
+
kind: "EnumValue",
|
|
58881
|
+
value: DedupeMatchMode.Variables
|
|
58882
|
+
}
|
|
58883
|
+
}
|
|
58884
|
+
]
|
|
58867
58885
|
}
|
|
58868
58886
|
]
|
|
58869
58887
|
};
|
|
@@ -60220,7 +60238,13 @@ function artifactGenerator(stats) {
|
|
|
60220
60238
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
60221
60239
|
(arg) => arg.name.value === "cancelFirst"
|
|
60222
60240
|
);
|
|
60223
|
-
|
|
60241
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
60242
|
+
(arg) => arg.name.value === "match"
|
|
60243
|
+
);
|
|
60244
|
+
dedupe = {
|
|
60245
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
60246
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
60247
|
+
};
|
|
60224
60248
|
}
|
|
60225
60249
|
selectionSet = operation.selectionSet;
|
|
60226
60250
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -63887,11 +63911,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
63887
63911
|
"""
|
|
63888
63912
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
63889
63913
|
|
|
63914
|
+
enum DedupeMatchMode {
|
|
63915
|
+
${DedupeMatchMode.Variables}
|
|
63916
|
+
${DedupeMatchMode.Operation}
|
|
63917
|
+
${DedupeMatchMode.None}
|
|
63918
|
+
}
|
|
63919
|
+
|
|
63890
63920
|
"""
|
|
63891
63921
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
63892
63922
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
63923
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
63924
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
63925
|
+
then the request will never be deduplicated.
|
|
63893
63926
|
"""
|
|
63894
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
63927
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
63895
63928
|
|
|
63896
63929
|
"""
|
|
63897
63930
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
|
@@ -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"
|
|
@@ -58855,14 +58860,27 @@ async function paginate(config, documents) {
|
|
|
58855
58860
|
return {
|
|
58856
58861
|
...node,
|
|
58857
58862
|
variableDefinitions: finalVariables,
|
|
58858
|
-
directives: [
|
|
58863
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
58859
58864
|
...node.directives || [],
|
|
58860
58865
|
{
|
|
58861
58866
|
kind: graphql13.Kind.DIRECTIVE,
|
|
58862
58867
|
name: {
|
|
58863
58868
|
kind: graphql13.Kind.NAME,
|
|
58864
58869
|
value: config.dedupeDirective
|
|
58865
|
-
}
|
|
58870
|
+
},
|
|
58871
|
+
arguments: [
|
|
58872
|
+
{
|
|
58873
|
+
kind: "Argument",
|
|
58874
|
+
name: {
|
|
58875
|
+
kind: "Name",
|
|
58876
|
+
value: "match"
|
|
58877
|
+
},
|
|
58878
|
+
value: {
|
|
58879
|
+
kind: "EnumValue",
|
|
58880
|
+
value: DedupeMatchMode.Variables
|
|
58881
|
+
}
|
|
58882
|
+
}
|
|
58883
|
+
]
|
|
58866
58884
|
}
|
|
58867
58885
|
]
|
|
58868
58886
|
};
|
|
@@ -60219,7 +60237,13 @@ function artifactGenerator(stats) {
|
|
|
60219
60237
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
60220
60238
|
(arg) => arg.name.value === "cancelFirst"
|
|
60221
60239
|
);
|
|
60222
|
-
|
|
60240
|
+
const matchArg = dedupeDirective.arguments?.find(
|
|
60241
|
+
(arg) => arg.name.value === "match"
|
|
60242
|
+
);
|
|
60243
|
+
dedupe = {
|
|
60244
|
+
cancel: cancelFirstArg && cancelFirstArg.value.kind === "BooleanValue" && cancelFirstArg.value ? "first" : "last",
|
|
60245
|
+
match: matchArg && matchArg.value.kind === "EnumValue" ? matchArg.value.value : DedupeMatchMode.Operation
|
|
60246
|
+
};
|
|
60223
60247
|
}
|
|
60224
60248
|
selectionSet = operation.selectionSet;
|
|
60225
60249
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -63886,11 +63910,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
63886
63910
|
"""
|
|
63887
63911
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
63888
63912
|
|
|
63913
|
+
enum DedupeMatchMode {
|
|
63914
|
+
${DedupeMatchMode.Variables}
|
|
63915
|
+
${DedupeMatchMode.Operation}
|
|
63916
|
+
${DedupeMatchMode.None}
|
|
63917
|
+
}
|
|
63918
|
+
|
|
63889
63919
|
"""
|
|
63890
63920
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
63891
63921
|
If the cancelFirst arg is set to true, the response already in flight will be canceled instead of the second one.
|
|
63922
|
+
If match is set to Operation, then a request will be deduplicated any time there is a request with the same operation.
|
|
63923
|
+
If it's set to Variables then the request will only be deduplicated if the variables match. If match is set to None,
|
|
63924
|
+
then the request will never be deduplicated.
|
|
63892
63925
|
"""
|
|
63893
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
63926
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
63894
63927
|
|
|
63895
63928
|
"""
|
|
63896
63929
|
@${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;
|