houdini 1.0.0-next.18 → 1.0.0-next.19
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 +55 -39
- package/build/cmd-esm/index.js +55 -39
- package/build/codegen-cjs/index.js +52 -27
- package/build/codegen-esm/index.js +52 -27
- package/build/lib/config.d.ts +4 -6
- package/build/lib/types.d.ts +11 -10
- package/build/lib-cjs/index.js +35 -40
- package/build/lib-esm/index.js +35 -40
- package/build/runtime/cache/storage.d.ts +18 -15
- package/build/runtime/client/documentStore.d.ts +3 -3
- package/build/runtime/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime/lib/config.d.ts +2 -2
- package/build/runtime/lib/types.d.ts +40 -41
- package/build/runtime-cjs/cache/storage.d.ts +18 -15
- package/build/runtime-cjs/cache/storage.js +9 -11
- package/build/runtime-cjs/client/documentStore.d.ts +3 -3
- package/build/runtime-cjs/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-cjs/lib/config.d.ts +2 -2
- package/build/runtime-cjs/lib/types.d.ts +40 -41
- package/build/runtime-cjs/lib/types.js +26 -30
- package/build/runtime-esm/cache/storage.d.ts +18 -15
- package/build/runtime-esm/cache/storage.js +9 -11
- package/build/runtime-esm/client/documentStore.d.ts +3 -3
- package/build/runtime-esm/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-esm/lib/config.d.ts +2 -2
- package/build/runtime-esm/lib/types.d.ts +40 -41
- package/build/runtime-esm/lib/types.js +26 -30
- package/build/test-cjs/index.js +55 -33
- package/build/test-esm/index.js +55 -33
- package/build/vite-cjs/index.js +53 -37
- package/build/vite-esm/index.js +53 -37
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -68352,10 +68352,27 @@ function computeID(configFile, type, data) {
|
|
|
68352
68352
|
}
|
|
68353
68353
|
|
|
68354
68354
|
// src/runtime/lib/types.ts
|
|
68355
|
-
var
|
|
68356
|
-
|
|
68357
|
-
|
|
68358
|
-
|
|
68355
|
+
var CachePolicy = {
|
|
68356
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
68357
|
+
CacheOnly: "CacheOnly",
|
|
68358
|
+
NetworkOnly: "NetworkOnly",
|
|
68359
|
+
CacheAndNetwork: "CacheAndNetwork"
|
|
68360
|
+
};
|
|
68361
|
+
var ArtifactKind = {
|
|
68362
|
+
Query: "HoudiniQuery",
|
|
68363
|
+
Subscription: "HoudiniSubscription",
|
|
68364
|
+
Mutation: "HoudiniMutation",
|
|
68365
|
+
Fragment: "HoudiniFragment"
|
|
68366
|
+
};
|
|
68367
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
68368
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
68369
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
68370
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
68371
|
+
var RefetchUpdateMode = {
|
|
68372
|
+
append: "append",
|
|
68373
|
+
prepend: "prepend",
|
|
68374
|
+
replace: "replace"
|
|
68375
|
+
};
|
|
68359
68376
|
|
|
68360
68377
|
// src/lib/constants.ts
|
|
68361
68378
|
var siteURL = "https://houdinigraphql.com";
|
|
@@ -69935,13 +69952,12 @@ function plugin(name, hooks) {
|
|
|
69935
69952
|
}
|
|
69936
69953
|
|
|
69937
69954
|
// src/lib/types.ts
|
|
69938
|
-
var LogLevel =
|
|
69939
|
-
|
|
69940
|
-
|
|
69941
|
-
|
|
69942
|
-
|
|
69943
|
-
|
|
69944
|
-
})(LogLevel || {});
|
|
69955
|
+
var LogLevel = {
|
|
69956
|
+
Full: "full",
|
|
69957
|
+
Summary: "summary",
|
|
69958
|
+
ShortSummary: "short-summary",
|
|
69959
|
+
Quiet: "quiet"
|
|
69960
|
+
};
|
|
69945
69961
|
|
|
69946
69962
|
// src/lib/config.ts
|
|
69947
69963
|
var import_meta = {};
|
|
@@ -69993,7 +70009,7 @@ var Config = class {
|
|
|
69993
70009
|
scalars,
|
|
69994
70010
|
cacheBufferSize,
|
|
69995
70011
|
definitionsPath,
|
|
69996
|
-
defaultCachePolicy =
|
|
70012
|
+
defaultCachePolicy = CachePolicy.CacheOrNetwork,
|
|
69997
70013
|
defaultPartial = false,
|
|
69998
70014
|
defaultListPosition = "append",
|
|
69999
70015
|
defaultListTarget = null,
|
|
@@ -70015,7 +70031,7 @@ var Config = class {
|
|
|
70015
70031
|
Object.values(LogLevel)
|
|
70016
70032
|
)}`
|
|
70017
70033
|
);
|
|
70018
|
-
logLevel =
|
|
70034
|
+
logLevel = LogLevel.Summary;
|
|
70019
70035
|
}
|
|
70020
70036
|
this.schemaPath = schemaPath;
|
|
70021
70037
|
this.filepath = filepath;
|
|
@@ -70031,7 +70047,7 @@ var Config = class {
|
|
|
70031
70047
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
70032
70048
|
this.defaultListTarget = defaultListTarget;
|
|
70033
70049
|
this.definitionsFolder = definitionsPath;
|
|
70034
|
-
this.logLevel = (logLevel ||
|
|
70050
|
+
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
70035
70051
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
70036
70052
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
70037
70053
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -71431,7 +71447,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
71431
71447
|
};
|
|
71432
71448
|
documents.push({
|
|
71433
71449
|
name: "generated::fragmentVariables",
|
|
71434
|
-
kind:
|
|
71450
|
+
kind: ArtifactKind.Fragment,
|
|
71435
71451
|
document: doc,
|
|
71436
71452
|
originalParsed: doc,
|
|
71437
71453
|
generateStore: false,
|
|
@@ -72352,7 +72368,7 @@ async function paginate(config2, documents) {
|
|
|
72352
72368
|
]
|
|
72353
72369
|
};
|
|
72354
72370
|
newDocs.push({
|
|
72355
|
-
kind:
|
|
72371
|
+
kind: ArtifactKind.Query,
|
|
72356
72372
|
filename: doc.filename,
|
|
72357
72373
|
name: refetchQueryName,
|
|
72358
72374
|
document: queryDoc,
|
|
@@ -72772,7 +72788,7 @@ async function addListFragments(config2, documents) {
|
|
|
72772
72788
|
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql11.print).join("\n\n");
|
|
72773
72789
|
documents.push({
|
|
72774
72790
|
name: "generated::lists",
|
|
72775
|
-
kind:
|
|
72791
|
+
kind: ArtifactKind.Fragment,
|
|
72776
72792
|
generateArtifact: false,
|
|
72777
72793
|
generateStore: false,
|
|
72778
72794
|
document: generatedDoc,
|
|
@@ -73039,7 +73055,7 @@ function selection({
|
|
|
73039
73055
|
(directive) => directive.name.value === config2.paginateDirective
|
|
73040
73056
|
);
|
|
73041
73057
|
if (paginated && document.refetch && document.refetch.method === "offset") {
|
|
73042
|
-
fieldObj.updates = [
|
|
73058
|
+
fieldObj.updates = [RefetchUpdateMode.append];
|
|
73043
73059
|
}
|
|
73044
73060
|
let continueConnection = inConnection;
|
|
73045
73061
|
if ([
|
|
@@ -73049,7 +73065,7 @@ function selection({
|
|
|
73049
73065
|
"hasNextPage",
|
|
73050
73066
|
"hasPreviousPage"
|
|
73051
73067
|
].includes(attributeName) && inConnection && document.refetch) {
|
|
73052
|
-
fieldObj.updates = [
|
|
73068
|
+
fieldObj.updates = [RefetchUpdateMode.append, RefetchUpdateMode.prepend];
|
|
73053
73069
|
}
|
|
73054
73070
|
if (attributeName === "node" && inConnection) {
|
|
73055
73071
|
continueConnection = false;
|
|
@@ -73228,7 +73244,7 @@ function artifactGenerator(stats) {
|
|
|
73228
73244
|
);
|
|
73229
73245
|
let rootType = "";
|
|
73230
73246
|
let selectionSet;
|
|
73231
|
-
if (docKind !==
|
|
73247
|
+
if (docKind !== ArtifactKind.Fragment) {
|
|
73232
73248
|
const operation = operations[0];
|
|
73233
73249
|
if (operation.operation === "query") {
|
|
73234
73250
|
rootType = config2.schema.getQueryType()?.name;
|
|
@@ -73261,7 +73277,7 @@ function artifactGenerator(stats) {
|
|
|
73261
73277
|
let directive = fragments[0]?.directives?.find(
|
|
73262
73278
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
73263
73279
|
);
|
|
73264
|
-
if (docKind ===
|
|
73280
|
+
if (docKind === ArtifactKind.Fragment && directive) {
|
|
73265
73281
|
inputs = fragmentArgumentsDefinitions(config2, doc.filename, fragments[0]);
|
|
73266
73282
|
}
|
|
73267
73283
|
const mergedSelection = flattenSelections({
|
|
@@ -73309,7 +73325,7 @@ function artifactGenerator(stats) {
|
|
|
73309
73325
|
}
|
|
73310
73326
|
const result = { ...prev };
|
|
73311
73327
|
const dataToAdd = plugin2.artifactData({ config: config2, document: doc }) ?? {};
|
|
73312
|
-
if (Object.keys(dataToAdd)
|
|
73328
|
+
if (Object.keys(dataToAdd)) {
|
|
73313
73329
|
result[plugin2.name] = dataToAdd;
|
|
73314
73330
|
}
|
|
73315
73331
|
return result;
|
|
@@ -74558,7 +74574,7 @@ function listDefinitions(config2, body, docs) {
|
|
|
74558
74574
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
74559
74575
|
return AST12.tsTupleType(
|
|
74560
74576
|
docs.reduce((prev, doc) => {
|
|
74561
|
-
if (doc.kind !==
|
|
74577
|
+
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
74562
74578
|
return prev;
|
|
74563
74579
|
}
|
|
74564
74580
|
const definition = doc.document.definitions.find(
|
|
@@ -74589,7 +74605,7 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
74589
74605
|
}
|
|
74590
74606
|
function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
74591
74607
|
return docs.reduce((prev, doc) => {
|
|
74592
|
-
if (doc.kind !==
|
|
74608
|
+
if (doc.kind !== ArtifactKind.Fragment) {
|
|
74593
74609
|
return prev;
|
|
74594
74610
|
}
|
|
74595
74611
|
const definition = doc.document.definitions.find(
|
|
@@ -74800,10 +74816,10 @@ var graphql22 = __toESM(require_graphql2(), 1);
|
|
|
74800
74816
|
async function graphqlExtensions(config2, documents) {
|
|
74801
74817
|
let internalSchema = `
|
|
74802
74818
|
enum CachePolicy {
|
|
74803
|
-
${
|
|
74804
|
-
${
|
|
74805
|
-
${
|
|
74806
|
-
${
|
|
74819
|
+
${CachePolicy.CacheAndNetwork}
|
|
74820
|
+
${CachePolicy.CacheOnly}
|
|
74821
|
+
${CachePolicy.CacheOrNetwork}
|
|
74822
|
+
${CachePolicy.NetworkOnly}
|
|
74807
74823
|
}
|
|
74808
74824
|
|
|
74809
74825
|
"""
|
|
@@ -75719,7 +75735,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
75719
75735
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
75720
75736
|
function displayInvalidNodeFieldMessage(logLevel) {
|
|
75721
75737
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
75722
|
-
if (logLevel ===
|
|
75738
|
+
if (logLevel === LogLevel.Full) {
|
|
75723
75739
|
console.warn(invalidNodeFieldMessage);
|
|
75724
75740
|
} else {
|
|
75725
75741
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -75887,7 +75903,7 @@ async function runPipeline2(config2, docs) {
|
|
|
75887
75903
|
}
|
|
75888
75904
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
75889
75905
|
const printMessage = !config2.pluginMode || unchanged !== artifactStats.total.length;
|
|
75890
|
-
if (!printMessage || config2.logLevel ===
|
|
75906
|
+
if (!printMessage || config2.logLevel === LogLevel.Quiet) {
|
|
75891
75907
|
if (error) {
|
|
75892
75908
|
throw error;
|
|
75893
75909
|
}
|
|
@@ -75901,14 +75917,14 @@ async function runPipeline2(config2, docs) {
|
|
|
75901
75917
|
}
|
|
75902
75918
|
if (artifactStats.total.length === 0) {
|
|
75903
75919
|
console.log(`\u{1F4A1} No operation found. If that's unexpected, please check your config.`);
|
|
75904
|
-
} else if (
|
|
75920
|
+
} else if (config2.logLevel == LogLevel.Summary || config2.logLevel == LogLevel.ShortSummary) {
|
|
75905
75921
|
if (unchanged > 0 && printMessage && !config2.pluginMode) {
|
|
75906
75922
|
console.log(`\u{1F4C3} Unchanged: ${unchanged}`);
|
|
75907
75923
|
}
|
|
75908
75924
|
logStyled("CREATED", artifactStats.new, config2.logLevel, config2.pluginMode);
|
|
75909
75925
|
logStyled("UPDATED", artifactStats.changed, config2.logLevel, config2.pluginMode);
|
|
75910
75926
|
logStyled("DELETED", artifactStats.deleted, config2.logLevel, config2.pluginMode);
|
|
75911
|
-
} else if (config2.logLevel ===
|
|
75927
|
+
} else if (config2.logLevel === LogLevel.Full) {
|
|
75912
75928
|
for (const artifact of artifactStats.total) {
|
|
75913
75929
|
let emoji = "\u{1F4C3}";
|
|
75914
75930
|
if (artifactStats.changed.includes(artifact)) {
|
|
@@ -76018,14 +76034,14 @@ async function processGraphQLDocument(config2, filepath, document) {
|
|
|
76018
76034
|
});
|
|
76019
76035
|
}
|
|
76020
76036
|
}
|
|
76021
|
-
let kind =
|
|
76037
|
+
let kind = ArtifactKind.Fragment;
|
|
76022
76038
|
if (operations.length === 1) {
|
|
76023
76039
|
if (operations[0].kind === "OperationDefinition" && operations[0].operation === "query") {
|
|
76024
|
-
kind =
|
|
76040
|
+
kind = ArtifactKind.Query;
|
|
76025
76041
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "mutation") {
|
|
76026
|
-
kind =
|
|
76042
|
+
kind = ArtifactKind.Mutation;
|
|
76027
76043
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "subscription") {
|
|
76028
|
-
kind =
|
|
76044
|
+
kind = ArtifactKind.Subscription;
|
|
76029
76045
|
}
|
|
76030
76046
|
}
|
|
76031
76047
|
return {
|
|
@@ -76070,7 +76086,7 @@ function logStyled(kind, stat3, logLevel, plugin2) {
|
|
|
76070
76086
|
}
|
|
76071
76087
|
}
|
|
76072
76088
|
console.log(msg.join(""));
|
|
76073
|
-
if (!plugin2 && logLevel ===
|
|
76089
|
+
if (!plugin2 && logLevel === LogLevel.Summary) {
|
|
76074
76090
|
for (const artifact of stat3.slice(0, nbToDisplay)) {
|
|
76075
76091
|
console.log(` ${artifact}`);
|
|
76076
76092
|
}
|
|
@@ -76513,8 +76529,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
76513
76529
|
}
|
|
76514
76530
|
packageJSON.devDependencies = {
|
|
76515
76531
|
...packageJSON.devDependencies,
|
|
76516
|
-
houdini: "^1.0.0-next.
|
|
76517
|
-
"houdini-svelte": "^1.0.0-next.
|
|
76532
|
+
houdini: "^1.0.0-next.19",
|
|
76533
|
+
"houdini-svelte": "^1.0.0-next.19"
|
|
76518
76534
|
};
|
|
76519
76535
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
76520
76536
|
}
|
package/build/cmd-esm/index.js
CHANGED
|
@@ -68358,10 +68358,27 @@ function computeID(configFile, type, data) {
|
|
|
68358
68358
|
}
|
|
68359
68359
|
|
|
68360
68360
|
// src/runtime/lib/types.ts
|
|
68361
|
-
var
|
|
68362
|
-
|
|
68363
|
-
|
|
68364
|
-
|
|
68361
|
+
var CachePolicy = {
|
|
68362
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
68363
|
+
CacheOnly: "CacheOnly",
|
|
68364
|
+
NetworkOnly: "NetworkOnly",
|
|
68365
|
+
CacheAndNetwork: "CacheAndNetwork"
|
|
68366
|
+
};
|
|
68367
|
+
var ArtifactKind = {
|
|
68368
|
+
Query: "HoudiniQuery",
|
|
68369
|
+
Subscription: "HoudiniSubscription",
|
|
68370
|
+
Mutation: "HoudiniMutation",
|
|
68371
|
+
Fragment: "HoudiniFragment"
|
|
68372
|
+
};
|
|
68373
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
68374
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
68375
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
68376
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
68377
|
+
var RefetchUpdateMode = {
|
|
68378
|
+
append: "append",
|
|
68379
|
+
prepend: "prepend",
|
|
68380
|
+
replace: "replace"
|
|
68381
|
+
};
|
|
68365
68382
|
|
|
68366
68383
|
// src/lib/constants.ts
|
|
68367
68384
|
var siteURL = "https://houdinigraphql.com";
|
|
@@ -69941,13 +69958,12 @@ function plugin(name, hooks) {
|
|
|
69941
69958
|
}
|
|
69942
69959
|
|
|
69943
69960
|
// src/lib/types.ts
|
|
69944
|
-
var LogLevel =
|
|
69945
|
-
|
|
69946
|
-
|
|
69947
|
-
|
|
69948
|
-
|
|
69949
|
-
|
|
69950
|
-
})(LogLevel || {});
|
|
69961
|
+
var LogLevel = {
|
|
69962
|
+
Full: "full",
|
|
69963
|
+
Summary: "summary",
|
|
69964
|
+
ShortSummary: "short-summary",
|
|
69965
|
+
Quiet: "quiet"
|
|
69966
|
+
};
|
|
69951
69967
|
|
|
69952
69968
|
// src/lib/config.ts
|
|
69953
69969
|
var currentDir = global.__dirname || dirname(fileURLToPath(import.meta.url));
|
|
@@ -69998,7 +70014,7 @@ var Config = class {
|
|
|
69998
70014
|
scalars,
|
|
69999
70015
|
cacheBufferSize,
|
|
70000
70016
|
definitionsPath,
|
|
70001
|
-
defaultCachePolicy =
|
|
70017
|
+
defaultCachePolicy = CachePolicy.CacheOrNetwork,
|
|
70002
70018
|
defaultPartial = false,
|
|
70003
70019
|
defaultListPosition = "append",
|
|
70004
70020
|
defaultListTarget = null,
|
|
@@ -70020,7 +70036,7 @@ var Config = class {
|
|
|
70020
70036
|
Object.values(LogLevel)
|
|
70021
70037
|
)}`
|
|
70022
70038
|
);
|
|
70023
|
-
logLevel =
|
|
70039
|
+
logLevel = LogLevel.Summary;
|
|
70024
70040
|
}
|
|
70025
70041
|
this.schemaPath = schemaPath;
|
|
70026
70042
|
this.filepath = filepath;
|
|
@@ -70036,7 +70052,7 @@ var Config = class {
|
|
|
70036
70052
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
70037
70053
|
this.defaultListTarget = defaultListTarget;
|
|
70038
70054
|
this.definitionsFolder = definitionsPath;
|
|
70039
|
-
this.logLevel = (logLevel ||
|
|
70055
|
+
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
70040
70056
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
70041
70057
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
70042
70058
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -71436,7 +71452,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
71436
71452
|
};
|
|
71437
71453
|
documents.push({
|
|
71438
71454
|
name: "generated::fragmentVariables",
|
|
71439
|
-
kind:
|
|
71455
|
+
kind: ArtifactKind.Fragment,
|
|
71440
71456
|
document: doc,
|
|
71441
71457
|
originalParsed: doc,
|
|
71442
71458
|
generateStore: false,
|
|
@@ -72357,7 +72373,7 @@ async function paginate(config2, documents) {
|
|
|
72357
72373
|
]
|
|
72358
72374
|
};
|
|
72359
72375
|
newDocs.push({
|
|
72360
|
-
kind:
|
|
72376
|
+
kind: ArtifactKind.Query,
|
|
72361
72377
|
filename: doc.filename,
|
|
72362
72378
|
name: refetchQueryName,
|
|
72363
72379
|
document: queryDoc,
|
|
@@ -72777,7 +72793,7 @@ async function addListFragments(config2, documents) {
|
|
|
72777
72793
|
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql11.print).join("\n\n");
|
|
72778
72794
|
documents.push({
|
|
72779
72795
|
name: "generated::lists",
|
|
72780
|
-
kind:
|
|
72796
|
+
kind: ArtifactKind.Fragment,
|
|
72781
72797
|
generateArtifact: false,
|
|
72782
72798
|
generateStore: false,
|
|
72783
72799
|
document: generatedDoc,
|
|
@@ -73044,7 +73060,7 @@ function selection({
|
|
|
73044
73060
|
(directive) => directive.name.value === config2.paginateDirective
|
|
73045
73061
|
);
|
|
73046
73062
|
if (paginated && document.refetch && document.refetch.method === "offset") {
|
|
73047
|
-
fieldObj.updates = [
|
|
73063
|
+
fieldObj.updates = [RefetchUpdateMode.append];
|
|
73048
73064
|
}
|
|
73049
73065
|
let continueConnection = inConnection;
|
|
73050
73066
|
if ([
|
|
@@ -73054,7 +73070,7 @@ function selection({
|
|
|
73054
73070
|
"hasNextPage",
|
|
73055
73071
|
"hasPreviousPage"
|
|
73056
73072
|
].includes(attributeName) && inConnection && document.refetch) {
|
|
73057
|
-
fieldObj.updates = [
|
|
73073
|
+
fieldObj.updates = [RefetchUpdateMode.append, RefetchUpdateMode.prepend];
|
|
73058
73074
|
}
|
|
73059
73075
|
if (attributeName === "node" && inConnection) {
|
|
73060
73076
|
continueConnection = false;
|
|
@@ -73233,7 +73249,7 @@ function artifactGenerator(stats) {
|
|
|
73233
73249
|
);
|
|
73234
73250
|
let rootType = "";
|
|
73235
73251
|
let selectionSet;
|
|
73236
|
-
if (docKind !==
|
|
73252
|
+
if (docKind !== ArtifactKind.Fragment) {
|
|
73237
73253
|
const operation = operations[0];
|
|
73238
73254
|
if (operation.operation === "query") {
|
|
73239
73255
|
rootType = config2.schema.getQueryType()?.name;
|
|
@@ -73266,7 +73282,7 @@ function artifactGenerator(stats) {
|
|
|
73266
73282
|
let directive = fragments[0]?.directives?.find(
|
|
73267
73283
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
73268
73284
|
);
|
|
73269
|
-
if (docKind ===
|
|
73285
|
+
if (docKind === ArtifactKind.Fragment && directive) {
|
|
73270
73286
|
inputs = fragmentArgumentsDefinitions(config2, doc.filename, fragments[0]);
|
|
73271
73287
|
}
|
|
73272
73288
|
const mergedSelection = flattenSelections({
|
|
@@ -73314,7 +73330,7 @@ function artifactGenerator(stats) {
|
|
|
73314
73330
|
}
|
|
73315
73331
|
const result = { ...prev };
|
|
73316
73332
|
const dataToAdd = plugin2.artifactData({ config: config2, document: doc }) ?? {};
|
|
73317
|
-
if (Object.keys(dataToAdd)
|
|
73333
|
+
if (Object.keys(dataToAdd)) {
|
|
73318
73334
|
result[plugin2.name] = dataToAdd;
|
|
73319
73335
|
}
|
|
73320
73336
|
return result;
|
|
@@ -74563,7 +74579,7 @@ function listDefinitions(config2, body, docs) {
|
|
|
74563
74579
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
74564
74580
|
return AST12.tsTupleType(
|
|
74565
74581
|
docs.reduce((prev, doc) => {
|
|
74566
|
-
if (doc.kind !==
|
|
74582
|
+
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
74567
74583
|
return prev;
|
|
74568
74584
|
}
|
|
74569
74585
|
const definition = doc.document.definitions.find(
|
|
@@ -74594,7 +74610,7 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
74594
74610
|
}
|
|
74595
74611
|
function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
74596
74612
|
return docs.reduce((prev, doc) => {
|
|
74597
|
-
if (doc.kind !==
|
|
74613
|
+
if (doc.kind !== ArtifactKind.Fragment) {
|
|
74598
74614
|
return prev;
|
|
74599
74615
|
}
|
|
74600
74616
|
const definition = doc.document.definitions.find(
|
|
@@ -74805,10 +74821,10 @@ var graphql22 = __toESM(require_graphql2(), 1);
|
|
|
74805
74821
|
async function graphqlExtensions(config2, documents) {
|
|
74806
74822
|
let internalSchema = `
|
|
74807
74823
|
enum CachePolicy {
|
|
74808
|
-
${
|
|
74809
|
-
${
|
|
74810
|
-
${
|
|
74811
|
-
${
|
|
74824
|
+
${CachePolicy.CacheAndNetwork}
|
|
74825
|
+
${CachePolicy.CacheOnly}
|
|
74826
|
+
${CachePolicy.CacheOrNetwork}
|
|
74827
|
+
${CachePolicy.NetworkOnly}
|
|
74812
74828
|
}
|
|
74813
74829
|
|
|
74814
74830
|
"""
|
|
@@ -75724,7 +75740,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
75724
75740
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
75725
75741
|
function displayInvalidNodeFieldMessage(logLevel) {
|
|
75726
75742
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
75727
|
-
if (logLevel ===
|
|
75743
|
+
if (logLevel === LogLevel.Full) {
|
|
75728
75744
|
console.warn(invalidNodeFieldMessage);
|
|
75729
75745
|
} else {
|
|
75730
75746
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -75892,7 +75908,7 @@ async function runPipeline2(config2, docs) {
|
|
|
75892
75908
|
}
|
|
75893
75909
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
75894
75910
|
const printMessage = !config2.pluginMode || unchanged !== artifactStats.total.length;
|
|
75895
|
-
if (!printMessage || config2.logLevel ===
|
|
75911
|
+
if (!printMessage || config2.logLevel === LogLevel.Quiet) {
|
|
75896
75912
|
if (error) {
|
|
75897
75913
|
throw error;
|
|
75898
75914
|
}
|
|
@@ -75906,14 +75922,14 @@ async function runPipeline2(config2, docs) {
|
|
|
75906
75922
|
}
|
|
75907
75923
|
if (artifactStats.total.length === 0) {
|
|
75908
75924
|
console.log(`\u{1F4A1} No operation found. If that's unexpected, please check your config.`);
|
|
75909
|
-
} else if (
|
|
75925
|
+
} else if (config2.logLevel == LogLevel.Summary || config2.logLevel == LogLevel.ShortSummary) {
|
|
75910
75926
|
if (unchanged > 0 && printMessage && !config2.pluginMode) {
|
|
75911
75927
|
console.log(`\u{1F4C3} Unchanged: ${unchanged}`);
|
|
75912
75928
|
}
|
|
75913
75929
|
logStyled("CREATED", artifactStats.new, config2.logLevel, config2.pluginMode);
|
|
75914
75930
|
logStyled("UPDATED", artifactStats.changed, config2.logLevel, config2.pluginMode);
|
|
75915
75931
|
logStyled("DELETED", artifactStats.deleted, config2.logLevel, config2.pluginMode);
|
|
75916
|
-
} else if (config2.logLevel ===
|
|
75932
|
+
} else if (config2.logLevel === LogLevel.Full) {
|
|
75917
75933
|
for (const artifact of artifactStats.total) {
|
|
75918
75934
|
let emoji = "\u{1F4C3}";
|
|
75919
75935
|
if (artifactStats.changed.includes(artifact)) {
|
|
@@ -76023,14 +76039,14 @@ async function processGraphQLDocument(config2, filepath, document) {
|
|
|
76023
76039
|
});
|
|
76024
76040
|
}
|
|
76025
76041
|
}
|
|
76026
|
-
let kind =
|
|
76042
|
+
let kind = ArtifactKind.Fragment;
|
|
76027
76043
|
if (operations.length === 1) {
|
|
76028
76044
|
if (operations[0].kind === "OperationDefinition" && operations[0].operation === "query") {
|
|
76029
|
-
kind =
|
|
76045
|
+
kind = ArtifactKind.Query;
|
|
76030
76046
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "mutation") {
|
|
76031
|
-
kind =
|
|
76047
|
+
kind = ArtifactKind.Mutation;
|
|
76032
76048
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "subscription") {
|
|
76033
|
-
kind =
|
|
76049
|
+
kind = ArtifactKind.Subscription;
|
|
76034
76050
|
}
|
|
76035
76051
|
}
|
|
76036
76052
|
return {
|
|
@@ -76075,7 +76091,7 @@ function logStyled(kind, stat3, logLevel, plugin2) {
|
|
|
76075
76091
|
}
|
|
76076
76092
|
}
|
|
76077
76093
|
console.log(msg.join(""));
|
|
76078
|
-
if (!plugin2 && logLevel ===
|
|
76094
|
+
if (!plugin2 && logLevel === LogLevel.Summary) {
|
|
76079
76095
|
for (const artifact of stat3.slice(0, nbToDisplay)) {
|
|
76080
76096
|
console.log(` ${artifact}`);
|
|
76081
76097
|
}
|
|
@@ -76518,8 +76534,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
76518
76534
|
}
|
|
76519
76535
|
packageJSON.devDependencies = {
|
|
76520
76536
|
...packageJSON.devDependencies,
|
|
76521
|
-
houdini: "^1.0.0-next.
|
|
76522
|
-
"houdini-svelte": "^1.0.0-next.
|
|
76537
|
+
houdini: "^1.0.0-next.19",
|
|
76538
|
+
"houdini-svelte": "^1.0.0-next.19"
|
|
76523
76539
|
};
|
|
76524
76540
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
76525
76541
|
}
|