houdini 1.3.0 → 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 +64 -25
- package/build/cmd-esm/index.js +64 -25
- 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 +52 -15
- package/build/lib-esm/index.js +51 -15
- 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 +50 -12
- package/build/vite-esm/index.js +50 -12
- 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"
|
|
@@ -65029,7 +65034,7 @@ async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
|
|
|
65029
65034
|
content = await resp.text();
|
|
65030
65035
|
const jsonSchema = JSON.parse(content).data;
|
|
65031
65036
|
let fileData = "";
|
|
65032
|
-
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
65037
|
+
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql") || schemaPath.endsWith("graphqls")) {
|
|
65033
65038
|
const schema = graphql.buildClientSchema(jsonSchema);
|
|
65034
65039
|
fileData = graphql.printSchema(graphql.lexicographicSortSchema(schema));
|
|
65035
65040
|
} else {
|
|
@@ -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
|
}
|
|
@@ -68338,7 +68344,11 @@ async function getConfig({
|
|
|
68338
68344
|
}
|
|
68339
68345
|
}
|
|
68340
68346
|
if (schemaOk && !noSchema) {
|
|
68341
|
-
|
|
68347
|
+
try {
|
|
68348
|
+
_config.schema = await loadSchemaFile(_config.schemaPath);
|
|
68349
|
+
} catch (e3) {
|
|
68350
|
+
console.error(`\u26A0\uFE0F Your schema file could not be loaded: ${e3}`);
|
|
68351
|
+
}
|
|
68342
68352
|
}
|
|
68343
68353
|
}
|
|
68344
68354
|
_config.plugins = orderedPlugins(plugins);
|
|
@@ -68469,7 +68479,7 @@ async function loadSchemaFile(schemaPath) {
|
|
|
68469
68479
|
});
|
|
68470
68480
|
}
|
|
68471
68481
|
const contents = await readFile(schemaPath);
|
|
68472
|
-
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
68482
|
+
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql") || schemaPath.endsWith("graphqls")) {
|
|
68473
68483
|
return graphql3.buildSchema(contents);
|
|
68474
68484
|
}
|
|
68475
68485
|
const jsonContents = JSON.parse(contents);
|
|
@@ -70658,14 +70668,27 @@ async function paginate(config, documents) {
|
|
|
70658
70668
|
return {
|
|
70659
70669
|
...node,
|
|
70660
70670
|
variableDefinitions: finalVariables,
|
|
70661
|
-
directives: [
|
|
70671
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
70662
70672
|
...node.directives || [],
|
|
70663
70673
|
{
|
|
70664
70674
|
kind: graphql13.Kind.DIRECTIVE,
|
|
70665
70675
|
name: {
|
|
70666
70676
|
kind: graphql13.Kind.NAME,
|
|
70667
70677
|
value: config.dedupeDirective
|
|
70668
|
-
}
|
|
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
|
+
]
|
|
70669
70692
|
}
|
|
70670
70693
|
]
|
|
70671
70694
|
};
|
|
@@ -72022,7 +72045,13 @@ function artifactGenerator(stats) {
|
|
|
72022
72045
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
72023
72046
|
(arg) => arg.name.value === "cancelFirst"
|
|
72024
72047
|
);
|
|
72025
|
-
|
|
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
|
+
};
|
|
72026
72055
|
}
|
|
72027
72056
|
selectionSet = operation.selectionSet;
|
|
72028
72057
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -75689,11 +75718,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
75689
75718
|
"""
|
|
75690
75719
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
75691
75720
|
|
|
75721
|
+
enum DedupeMatchMode {
|
|
75722
|
+
${DedupeMatchMode.Variables}
|
|
75723
|
+
${DedupeMatchMode.Operation}
|
|
75724
|
+
${DedupeMatchMode.None}
|
|
75725
|
+
}
|
|
75726
|
+
|
|
75692
75727
|
"""
|
|
75693
75728
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
75694
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.
|
|
75695
75733
|
"""
|
|
75696
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
75734
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
75697
75735
|
|
|
75698
75736
|
"""
|
|
75699
75737
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
|
@@ -78243,6 +78281,7 @@ async function houdiniConfig(configPath, schemaPath, module2, frameworkInfo, url
|
|
|
78243
78281
|
url
|
|
78244
78282
|
};
|
|
78245
78283
|
}
|
|
78284
|
+
config.runtimeDir = ".houdini";
|
|
78246
78285
|
if (schemaPath !== "./schema.graphql") {
|
|
78247
78286
|
config.schemaPath = schemaPath;
|
|
78248
78287
|
}
|
|
@@ -78324,7 +78363,7 @@ const config = {
|
|
|
78324
78363
|
kit: {
|
|
78325
78364
|
adapter: adapter(),
|
|
78326
78365
|
alias: {
|
|
78327
|
-
$houdini: '
|
|
78366
|
+
$houdini: '.houdini/'
|
|
78328
78367
|
}
|
|
78329
78368
|
}
|
|
78330
78369
|
};
|
|
@@ -78338,7 +78377,7 @@ const config = {
|
|
|
78338
78377
|
kit: {
|
|
78339
78378
|
adapter: adapter(),
|
|
78340
78379
|
alias: {
|
|
78341
|
-
$houdini: '
|
|
78380
|
+
$houdini: '.houdini/'
|
|
78342
78381
|
}
|
|
78343
78382
|
}
|
|
78344
78383
|
};
|
|
@@ -78350,8 +78389,8 @@ export default config;
|
|
|
78350
78389
|
async function gitIgnore(targetPath) {
|
|
78351
78390
|
const filepath = path_exports.join(targetPath, ".gitignore");
|
|
78352
78391
|
const existing = await fs_exports.readFile(filepath) || "";
|
|
78353
|
-
if (!existing.includes("\n
|
|
78354
|
-
await fs_exports.writeFile(filepath, existing + "\n
|
|
78392
|
+
if (!existing.includes("\n.houdini\n")) {
|
|
78393
|
+
await fs_exports.writeFile(filepath, existing + "\n.houdini\n");
|
|
78355
78394
|
}
|
|
78356
78395
|
}
|
|
78357
78396
|
async function graphqlRC(targetPath) {
|
|
@@ -78360,11 +78399,11 @@ async function graphqlRC(targetPath) {
|
|
|
78360
78399
|
default:
|
|
78361
78400
|
schema:
|
|
78362
78401
|
- ./schema.graphql
|
|
78363
|
-
-
|
|
78402
|
+
- ./.houdini/graphql/schema.graphql
|
|
78364
78403
|
documents:
|
|
78365
78404
|
- '**/*.gql'
|
|
78366
78405
|
- '**/*.svelte'
|
|
78367
|
-
-
|
|
78406
|
+
- ./.houdini/graphql/documents.gql
|
|
78368
78407
|
`;
|
|
78369
78408
|
await fs_exports.writeFile(target, content);
|
|
78370
78409
|
}
|
|
@@ -78382,7 +78421,7 @@ export default defineConfig({
|
|
|
78382
78421
|
|
|
78383
78422
|
resolve: {
|
|
78384
78423
|
alias: {
|
|
78385
|
-
$houdini:
|
|
78424
|
+
$houdini: '.houdini/',
|
|
78386
78425
|
},
|
|
78387
78426
|
},
|
|
78388
78427
|
})
|
|
@@ -78419,15 +78458,15 @@ async function tjsConfig(targetPath, frameworkInfo) {
|
|
|
78419
78458
|
var tjsConfig2 = parseJSON(tjsConfigFile);
|
|
78420
78459
|
}
|
|
78421
78460
|
if (frameworkInfo.framework === "svelte") {
|
|
78422
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "
|
|
78461
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.houdini/types"];
|
|
78423
78462
|
} else if (frameworkInfo.framework === "kit") {
|
|
78424
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "
|
|
78463
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "./.houdini/types"];
|
|
78425
78464
|
}
|
|
78426
78465
|
if (frameworkInfo.framework === "svelte") {
|
|
78427
78466
|
tjsConfig2.compilerOptions.paths = {
|
|
78428
78467
|
...tjsConfig2.compilerOptions.paths,
|
|
78429
|
-
$houdini: ["
|
|
78430
|
-
"$houdini/*": ["
|
|
78468
|
+
$houdini: ["./.houdini/"],
|
|
78469
|
+
"$houdini/*": ["./.houdini/*"]
|
|
78431
78470
|
};
|
|
78432
78471
|
}
|
|
78433
78472
|
await fs_exports.writeFile(configFile, JSON.stringify(tjsConfig2, null, 4));
|
|
@@ -78444,12 +78483,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78444
78483
|
}
|
|
78445
78484
|
packageJSON2.devDependencies = {
|
|
78446
78485
|
...packageJSON2.devDependencies,
|
|
78447
|
-
houdini: "^1.
|
|
78486
|
+
houdini: "^1.4.0"
|
|
78448
78487
|
};
|
|
78449
78488
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78450
78489
|
packageJSON2.devDependencies = {
|
|
78451
78490
|
...packageJSON2.devDependencies,
|
|
78452
|
-
"houdini-svelte": "^1.
|
|
78491
|
+
"houdini-svelte": "^2.1.0"
|
|
78453
78492
|
};
|
|
78454
78493
|
} else {
|
|
78455
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"
|
|
@@ -65035,7 +65040,7 @@ async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
|
|
|
65035
65040
|
content = await resp.text();
|
|
65036
65041
|
const jsonSchema = JSON.parse(content).data;
|
|
65037
65042
|
let fileData = "";
|
|
65038
|
-
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
65043
|
+
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql") || schemaPath.endsWith("graphqls")) {
|
|
65039
65044
|
const schema = graphql.buildClientSchema(jsonSchema);
|
|
65040
65045
|
fileData = graphql.printSchema(graphql.lexicographicSortSchema(schema));
|
|
65041
65046
|
} else {
|
|
@@ -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
|
}
|
|
@@ -68343,7 +68349,11 @@ async function getConfig({
|
|
|
68343
68349
|
}
|
|
68344
68350
|
}
|
|
68345
68351
|
if (schemaOk && !noSchema) {
|
|
68346
|
-
|
|
68352
|
+
try {
|
|
68353
|
+
_config.schema = await loadSchemaFile(_config.schemaPath);
|
|
68354
|
+
} catch (e3) {
|
|
68355
|
+
console.error(`\u26A0\uFE0F Your schema file could not be loaded: ${e3}`);
|
|
68356
|
+
}
|
|
68347
68357
|
}
|
|
68348
68358
|
}
|
|
68349
68359
|
_config.plugins = orderedPlugins(plugins);
|
|
@@ -68474,7 +68484,7 @@ async function loadSchemaFile(schemaPath) {
|
|
|
68474
68484
|
});
|
|
68475
68485
|
}
|
|
68476
68486
|
const contents = await readFile(schemaPath);
|
|
68477
|
-
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
68487
|
+
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql") || schemaPath.endsWith("graphqls")) {
|
|
68478
68488
|
return graphql3.buildSchema(contents);
|
|
68479
68489
|
}
|
|
68480
68490
|
const jsonContents = JSON.parse(contents);
|
|
@@ -70663,14 +70673,27 @@ async function paginate(config, documents) {
|
|
|
70663
70673
|
return {
|
|
70664
70674
|
...node,
|
|
70665
70675
|
variableDefinitions: finalVariables,
|
|
70666
|
-
directives: [
|
|
70676
|
+
directives: config.configFile.supressPaginationDeduplication ? node.directives : [
|
|
70667
70677
|
...node.directives || [],
|
|
70668
70678
|
{
|
|
70669
70679
|
kind: graphql13.Kind.DIRECTIVE,
|
|
70670
70680
|
name: {
|
|
70671
70681
|
kind: graphql13.Kind.NAME,
|
|
70672
70682
|
value: config.dedupeDirective
|
|
70673
|
-
}
|
|
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
|
+
]
|
|
70674
70697
|
}
|
|
70675
70698
|
]
|
|
70676
70699
|
};
|
|
@@ -72027,7 +72050,13 @@ function artifactGenerator(stats) {
|
|
|
72027
72050
|
const cancelFirstArg = dedupeDirective.arguments?.find(
|
|
72028
72051
|
(arg) => arg.name.value === "cancelFirst"
|
|
72029
72052
|
);
|
|
72030
|
-
|
|
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
|
+
};
|
|
72031
72060
|
}
|
|
72032
72061
|
selectionSet = operation.selectionSet;
|
|
72033
72062
|
if (originalParsed.definitions[0].kind === "OperationDefinition") {
|
|
@@ -75694,11 +75723,20 @@ directive @${config.paginateDirective}(${config.listOrPaginateNameArg}: String,
|
|
|
75694
75723
|
"""
|
|
75695
75724
|
directive @${config.listPrependDirective} on FRAGMENT_SPREAD
|
|
75696
75725
|
|
|
75726
|
+
enum DedupeMatchMode {
|
|
75727
|
+
${DedupeMatchMode.Variables}
|
|
75728
|
+
${DedupeMatchMode.Operation}
|
|
75729
|
+
${DedupeMatchMode.None}
|
|
75730
|
+
}
|
|
75731
|
+
|
|
75697
75732
|
"""
|
|
75698
75733
|
@${config.dedupeDirective} is used to prevent an operation from running more than once at the same time.
|
|
75699
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.
|
|
75700
75738
|
"""
|
|
75701
|
-
directive @${config.dedupeDirective}(cancelFirst: Boolean) on QUERY | MUTATION
|
|
75739
|
+
directive @${config.dedupeDirective}(cancelFirst: Boolean, match: DedupeMatchMode) on QUERY | MUTATION
|
|
75702
75740
|
|
|
75703
75741
|
"""
|
|
75704
75742
|
@${config.optimisticKeyDirective} is used to identify a field as an optimistic key
|
|
@@ -78248,6 +78286,7 @@ async function houdiniConfig(configPath, schemaPath, module, frameworkInfo, url)
|
|
|
78248
78286
|
url
|
|
78249
78287
|
};
|
|
78250
78288
|
}
|
|
78289
|
+
config.runtimeDir = ".houdini";
|
|
78251
78290
|
if (schemaPath !== "./schema.graphql") {
|
|
78252
78291
|
config.schemaPath = schemaPath;
|
|
78253
78292
|
}
|
|
@@ -78329,7 +78368,7 @@ const config = {
|
|
|
78329
78368
|
kit: {
|
|
78330
78369
|
adapter: adapter(),
|
|
78331
78370
|
alias: {
|
|
78332
|
-
$houdini: '
|
|
78371
|
+
$houdini: '.houdini/'
|
|
78333
78372
|
}
|
|
78334
78373
|
}
|
|
78335
78374
|
};
|
|
@@ -78343,7 +78382,7 @@ const config = {
|
|
|
78343
78382
|
kit: {
|
|
78344
78383
|
adapter: adapter(),
|
|
78345
78384
|
alias: {
|
|
78346
|
-
$houdini: '
|
|
78385
|
+
$houdini: '.houdini/'
|
|
78347
78386
|
}
|
|
78348
78387
|
}
|
|
78349
78388
|
};
|
|
@@ -78355,8 +78394,8 @@ export default config;
|
|
|
78355
78394
|
async function gitIgnore(targetPath) {
|
|
78356
78395
|
const filepath = path_exports.join(targetPath, ".gitignore");
|
|
78357
78396
|
const existing = await fs_exports.readFile(filepath) || "";
|
|
78358
|
-
if (!existing.includes("\n
|
|
78359
|
-
await fs_exports.writeFile(filepath, existing + "\n
|
|
78397
|
+
if (!existing.includes("\n.houdini\n")) {
|
|
78398
|
+
await fs_exports.writeFile(filepath, existing + "\n.houdini\n");
|
|
78360
78399
|
}
|
|
78361
78400
|
}
|
|
78362
78401
|
async function graphqlRC(targetPath) {
|
|
@@ -78365,11 +78404,11 @@ async function graphqlRC(targetPath) {
|
|
|
78365
78404
|
default:
|
|
78366
78405
|
schema:
|
|
78367
78406
|
- ./schema.graphql
|
|
78368
|
-
-
|
|
78407
|
+
- ./.houdini/graphql/schema.graphql
|
|
78369
78408
|
documents:
|
|
78370
78409
|
- '**/*.gql'
|
|
78371
78410
|
- '**/*.svelte'
|
|
78372
|
-
-
|
|
78411
|
+
- ./.houdini/graphql/documents.gql
|
|
78373
78412
|
`;
|
|
78374
78413
|
await fs_exports.writeFile(target, content);
|
|
78375
78414
|
}
|
|
@@ -78387,7 +78426,7 @@ export default defineConfig({
|
|
|
78387
78426
|
|
|
78388
78427
|
resolve: {
|
|
78389
78428
|
alias: {
|
|
78390
|
-
$houdini:
|
|
78429
|
+
$houdini: '.houdini/',
|
|
78391
78430
|
},
|
|
78392
78431
|
},
|
|
78393
78432
|
})
|
|
@@ -78424,15 +78463,15 @@ async function tjsConfig(targetPath, frameworkInfo) {
|
|
|
78424
78463
|
var tjsConfig2 = parseJSON(tjsConfigFile);
|
|
78425
78464
|
}
|
|
78426
78465
|
if (frameworkInfo.framework === "svelte") {
|
|
78427
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "
|
|
78466
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.houdini/types"];
|
|
78428
78467
|
} else if (frameworkInfo.framework === "kit") {
|
|
78429
|
-
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "
|
|
78468
|
+
tjsConfig2.compilerOptions.rootDirs = [".", "./.svelte-kit/types", "./.houdini/types"];
|
|
78430
78469
|
}
|
|
78431
78470
|
if (frameworkInfo.framework === "svelte") {
|
|
78432
78471
|
tjsConfig2.compilerOptions.paths = {
|
|
78433
78472
|
...tjsConfig2.compilerOptions.paths,
|
|
78434
|
-
$houdini: ["
|
|
78435
|
-
"$houdini/*": ["
|
|
78473
|
+
$houdini: ["./.houdini/"],
|
|
78474
|
+
"$houdini/*": ["./.houdini/*"]
|
|
78436
78475
|
};
|
|
78437
78476
|
}
|
|
78438
78477
|
await fs_exports.writeFile(configFile, JSON.stringify(tjsConfig2, null, 4));
|
|
@@ -78449,12 +78488,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78449
78488
|
}
|
|
78450
78489
|
packageJSON2.devDependencies = {
|
|
78451
78490
|
...packageJSON2.devDependencies,
|
|
78452
|
-
houdini: "^1.
|
|
78491
|
+
houdini: "^1.4.0"
|
|
78453
78492
|
};
|
|
78454
78493
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78455
78494
|
packageJSON2.devDependencies = {
|
|
78456
78495
|
...packageJSON2.devDependencies,
|
|
78457
|
-
"houdini-svelte": "^1.
|
|
78496
|
+
"houdini-svelte": "^2.1.0"
|
|
78458
78497
|
};
|
|
78459
78498
|
} else {
|
|
78460
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;
|