houdini 1.0.0-next.17 → 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/documentStore.js +0 -1
- package/build/runtime-cjs/client/index.js +0 -1
- package/build/runtime-cjs/client/plugins/cache.js +0 -1
- 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/documentStore.js +0 -1
- package/build/runtime-esm/client/index.js +0 -1
- package/build/runtime-esm/client/plugins/cache.js +0 -1
- 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/test-cjs/index.js
CHANGED
|
@@ -54089,6 +54089,29 @@ function computeID(configFile, type, data) {
|
|
|
54089
54089
|
return id.slice(0, -2);
|
|
54090
54090
|
}
|
|
54091
54091
|
|
|
54092
|
+
// src/runtime/lib/types.ts
|
|
54093
|
+
var CachePolicy = {
|
|
54094
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
54095
|
+
CacheOnly: "CacheOnly",
|
|
54096
|
+
NetworkOnly: "NetworkOnly",
|
|
54097
|
+
CacheAndNetwork: "CacheAndNetwork"
|
|
54098
|
+
};
|
|
54099
|
+
var ArtifactKind = {
|
|
54100
|
+
Query: "HoudiniQuery",
|
|
54101
|
+
Subscription: "HoudiniSubscription",
|
|
54102
|
+
Mutation: "HoudiniMutation",
|
|
54103
|
+
Fragment: "HoudiniFragment"
|
|
54104
|
+
};
|
|
54105
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
54106
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
54107
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
54108
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
54109
|
+
var RefetchUpdateMode = {
|
|
54110
|
+
append: "append",
|
|
54111
|
+
prepend: "prepend",
|
|
54112
|
+
replace: "replace"
|
|
54113
|
+
};
|
|
54114
|
+
|
|
54092
54115
|
// src/lib/constants.ts
|
|
54093
54116
|
var siteURL = "https://houdinigraphql.com";
|
|
54094
54117
|
var houdini_mode = {
|
|
@@ -54411,13 +54434,12 @@ async function glob(pattern) {
|
|
|
54411
54434
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
54412
54435
|
|
|
54413
54436
|
// src/lib/types.ts
|
|
54414
|
-
var LogLevel =
|
|
54415
|
-
|
|
54416
|
-
|
|
54417
|
-
|
|
54418
|
-
|
|
54419
|
-
|
|
54420
|
-
})(LogLevel || {});
|
|
54437
|
+
var LogLevel = {
|
|
54438
|
+
Full: "full",
|
|
54439
|
+
Summary: "summary",
|
|
54440
|
+
ShortSummary: "short-summary",
|
|
54441
|
+
Quiet: "quiet"
|
|
54442
|
+
};
|
|
54421
54443
|
|
|
54422
54444
|
// src/lib/config.ts
|
|
54423
54445
|
var import_meta = {};
|
|
@@ -54469,7 +54491,7 @@ var Config = class {
|
|
|
54469
54491
|
scalars,
|
|
54470
54492
|
cacheBufferSize,
|
|
54471
54493
|
definitionsPath,
|
|
54472
|
-
defaultCachePolicy =
|
|
54494
|
+
defaultCachePolicy = CachePolicy.CacheOrNetwork,
|
|
54473
54495
|
defaultPartial = false,
|
|
54474
54496
|
defaultListPosition = "append",
|
|
54475
54497
|
defaultListTarget = null,
|
|
@@ -54491,7 +54513,7 @@ var Config = class {
|
|
|
54491
54513
|
Object.values(LogLevel)
|
|
54492
54514
|
)}`
|
|
54493
54515
|
);
|
|
54494
|
-
logLevel =
|
|
54516
|
+
logLevel = LogLevel.Summary;
|
|
54495
54517
|
}
|
|
54496
54518
|
this.schemaPath = schemaPath;
|
|
54497
54519
|
this.filepath = filepath;
|
|
@@ -54507,7 +54529,7 @@ var Config = class {
|
|
|
54507
54529
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
54508
54530
|
this.defaultListTarget = defaultListTarget;
|
|
54509
54531
|
this.definitionsFolder = definitionsPath;
|
|
54510
|
-
this.logLevel = (logLevel ||
|
|
54532
|
+
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
54511
54533
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
54512
54534
|
this.routesDir = join(this.projectRoot, "src", "routes");
|
|
54513
54535
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -55506,7 +55528,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
55506
55528
|
};
|
|
55507
55529
|
documents.push({
|
|
55508
55530
|
name: "generated::fragmentVariables",
|
|
55509
|
-
kind:
|
|
55531
|
+
kind: ArtifactKind.Fragment,
|
|
55510
55532
|
document: doc,
|
|
55511
55533
|
originalParsed: doc,
|
|
55512
55534
|
generateStore: false,
|
|
@@ -56427,7 +56449,7 @@ async function paginate(config2, documents) {
|
|
|
56427
56449
|
]
|
|
56428
56450
|
};
|
|
56429
56451
|
newDocs.push({
|
|
56430
|
-
kind:
|
|
56452
|
+
kind: ArtifactKind.Query,
|
|
56431
56453
|
filename: doc.filename,
|
|
56432
56454
|
name: refetchQueryName,
|
|
56433
56455
|
document: queryDoc,
|
|
@@ -56847,7 +56869,7 @@ async function addListFragments(config2, documents) {
|
|
|
56847
56869
|
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql9.print).join("\n\n");
|
|
56848
56870
|
documents.push({
|
|
56849
56871
|
name: "generated::lists",
|
|
56850
|
-
kind:
|
|
56872
|
+
kind: ArtifactKind.Fragment,
|
|
56851
56873
|
generateArtifact: false,
|
|
56852
56874
|
generateStore: false,
|
|
56853
56875
|
document: generatedDoc,
|
|
@@ -57114,7 +57136,7 @@ function selection({
|
|
|
57114
57136
|
(directive) => directive.name.value === config2.paginateDirective
|
|
57115
57137
|
);
|
|
57116
57138
|
if (paginated && document.refetch && document.refetch.method === "offset") {
|
|
57117
|
-
fieldObj.updates = [
|
|
57139
|
+
fieldObj.updates = [RefetchUpdateMode.append];
|
|
57118
57140
|
}
|
|
57119
57141
|
let continueConnection = inConnection;
|
|
57120
57142
|
if ([
|
|
@@ -57124,7 +57146,7 @@ function selection({
|
|
|
57124
57146
|
"hasNextPage",
|
|
57125
57147
|
"hasPreviousPage"
|
|
57126
57148
|
].includes(attributeName) && inConnection && document.refetch) {
|
|
57127
|
-
fieldObj.updates = [
|
|
57149
|
+
fieldObj.updates = [RefetchUpdateMode.append, RefetchUpdateMode.prepend];
|
|
57128
57150
|
}
|
|
57129
57151
|
if (attributeName === "node" && inConnection) {
|
|
57130
57152
|
continueConnection = false;
|
|
@@ -57303,7 +57325,7 @@ function artifactGenerator(stats) {
|
|
|
57303
57325
|
);
|
|
57304
57326
|
let rootType = "";
|
|
57305
57327
|
let selectionSet;
|
|
57306
|
-
if (docKind !==
|
|
57328
|
+
if (docKind !== ArtifactKind.Fragment) {
|
|
57307
57329
|
const operation = operations[0];
|
|
57308
57330
|
if (operation.operation === "query") {
|
|
57309
57331
|
rootType = config2.schema.getQueryType()?.name;
|
|
@@ -57336,7 +57358,7 @@ function artifactGenerator(stats) {
|
|
|
57336
57358
|
let directive = fragments[0]?.directives?.find(
|
|
57337
57359
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
57338
57360
|
);
|
|
57339
|
-
if (docKind ===
|
|
57361
|
+
if (docKind === ArtifactKind.Fragment && directive) {
|
|
57340
57362
|
inputs = fragmentArgumentsDefinitions(config2, doc.filename, fragments[0]);
|
|
57341
57363
|
}
|
|
57342
57364
|
const mergedSelection = flattenSelections({
|
|
@@ -57384,7 +57406,7 @@ function artifactGenerator(stats) {
|
|
|
57384
57406
|
}
|
|
57385
57407
|
const result = { ...prev };
|
|
57386
57408
|
const dataToAdd = plugin2.artifactData({ config: config2, document: doc }) ?? {};
|
|
57387
|
-
if (Object.keys(dataToAdd)
|
|
57409
|
+
if (Object.keys(dataToAdd)) {
|
|
57388
57410
|
result[plugin2.name] = dataToAdd;
|
|
57389
57411
|
}
|
|
57390
57412
|
return result;
|
|
@@ -58633,7 +58655,7 @@ function listDefinitions(config2, body, docs) {
|
|
|
58633
58655
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
58634
58656
|
return AST12.tsTupleType(
|
|
58635
58657
|
docs.reduce((prev, doc) => {
|
|
58636
|
-
if (doc.kind !==
|
|
58658
|
+
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
58637
58659
|
return prev;
|
|
58638
58660
|
}
|
|
58639
58661
|
const definition = doc.document.definitions.find(
|
|
@@ -58664,7 +58686,7 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
58664
58686
|
}
|
|
58665
58687
|
function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
58666
58688
|
return docs.reduce((prev, doc) => {
|
|
58667
|
-
if (doc.kind !==
|
|
58689
|
+
if (doc.kind !== ArtifactKind.Fragment) {
|
|
58668
58690
|
return prev;
|
|
58669
58691
|
}
|
|
58670
58692
|
const definition = doc.document.definitions.find(
|
|
@@ -58875,10 +58897,10 @@ var graphql20 = __toESM(require_graphql2(), 1);
|
|
|
58875
58897
|
async function graphqlExtensions(config2, documents) {
|
|
58876
58898
|
let internalSchema = `
|
|
58877
58899
|
enum CachePolicy {
|
|
58878
|
-
${
|
|
58879
|
-
${
|
|
58880
|
-
${
|
|
58881
|
-
${
|
|
58900
|
+
${CachePolicy.CacheAndNetwork}
|
|
58901
|
+
${CachePolicy.CacheOnly}
|
|
58902
|
+
${CachePolicy.CacheOrNetwork}
|
|
58903
|
+
${CachePolicy.NetworkOnly}
|
|
58882
58904
|
}
|
|
58883
58905
|
|
|
58884
58906
|
"""
|
|
@@ -59794,7 +59816,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
59794
59816
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
59795
59817
|
function displayInvalidNodeFieldMessage(logLevel) {
|
|
59796
59818
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
59797
|
-
if (logLevel ===
|
|
59819
|
+
if (logLevel === LogLevel.Full) {
|
|
59798
59820
|
console.warn(invalidNodeFieldMessage);
|
|
59799
59821
|
} else {
|
|
59800
59822
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -59958,7 +59980,7 @@ async function runPipeline2(config2, docs) {
|
|
|
59958
59980
|
}
|
|
59959
59981
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
59960
59982
|
const printMessage = !config2.pluginMode || unchanged !== artifactStats.total.length;
|
|
59961
|
-
if (!printMessage || config2.logLevel ===
|
|
59983
|
+
if (!printMessage || config2.logLevel === LogLevel.Quiet) {
|
|
59962
59984
|
if (error) {
|
|
59963
59985
|
throw error;
|
|
59964
59986
|
}
|
|
@@ -59972,14 +59994,14 @@ async function runPipeline2(config2, docs) {
|
|
|
59972
59994
|
}
|
|
59973
59995
|
if (artifactStats.total.length === 0) {
|
|
59974
59996
|
console.log(`\u{1F4A1} No operation found. If that's unexpected, please check your config.`);
|
|
59975
|
-
} else if (
|
|
59997
|
+
} else if (config2.logLevel == LogLevel.Summary || config2.logLevel == LogLevel.ShortSummary) {
|
|
59976
59998
|
if (unchanged > 0 && printMessage && !config2.pluginMode) {
|
|
59977
59999
|
console.log(`\u{1F4C3} Unchanged: ${unchanged}`);
|
|
59978
60000
|
}
|
|
59979
60001
|
logStyled("CREATED", artifactStats.new, config2.logLevel, config2.pluginMode);
|
|
59980
60002
|
logStyled("UPDATED", artifactStats.changed, config2.logLevel, config2.pluginMode);
|
|
59981
60003
|
logStyled("DELETED", artifactStats.deleted, config2.logLevel, config2.pluginMode);
|
|
59982
|
-
} else if (config2.logLevel ===
|
|
60004
|
+
} else if (config2.logLevel === LogLevel.Full) {
|
|
59983
60005
|
for (const artifact of artifactStats.total) {
|
|
59984
60006
|
let emoji = "\u{1F4C3}";
|
|
59985
60007
|
if (artifactStats.changed.includes(artifact)) {
|
|
@@ -60023,7 +60045,7 @@ function logStyled(kind, stat2, logLevel, plugin2) {
|
|
|
60023
60045
|
}
|
|
60024
60046
|
}
|
|
60025
60047
|
console.log(msg.join(""));
|
|
60026
|
-
if (!plugin2 && logLevel ===
|
|
60048
|
+
if (!plugin2 && logLevel === LogLevel.Summary) {
|
|
60027
60049
|
for (const artifact of stat2.slice(0, nbToDisplay)) {
|
|
60028
60050
|
console.log(` ${artifact}`);
|
|
60029
60051
|
}
|
|
@@ -60306,14 +60328,14 @@ function mockCollectedDoc(query) {
|
|
|
60306
60328
|
const parsed = graphql25.parse(query);
|
|
60307
60329
|
const name = parsed.definitions[0].name.value;
|
|
60308
60330
|
const operations = parsed.definitions;
|
|
60309
|
-
let kind =
|
|
60331
|
+
let kind = ArtifactKind.Fragment;
|
|
60310
60332
|
if (operations.length === 1) {
|
|
60311
60333
|
if (operations[0].kind === "OperationDefinition" && operations[0].operation === "query") {
|
|
60312
|
-
kind =
|
|
60334
|
+
kind = ArtifactKind.Query;
|
|
60313
60335
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "mutation") {
|
|
60314
|
-
kind =
|
|
60336
|
+
kind = ArtifactKind.Mutation;
|
|
60315
60337
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "subscription") {
|
|
60316
|
-
kind =
|
|
60338
|
+
kind = ArtifactKind.Subscription;
|
|
60317
60339
|
}
|
|
60318
60340
|
}
|
|
60319
60341
|
return {
|
package/build/test-esm/index.js
CHANGED
|
@@ -54085,6 +54085,29 @@ function computeID(configFile, type, data) {
|
|
|
54085
54085
|
return id.slice(0, -2);
|
|
54086
54086
|
}
|
|
54087
54087
|
|
|
54088
|
+
// src/runtime/lib/types.ts
|
|
54089
|
+
var CachePolicy = {
|
|
54090
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
54091
|
+
CacheOnly: "CacheOnly",
|
|
54092
|
+
NetworkOnly: "NetworkOnly",
|
|
54093
|
+
CacheAndNetwork: "CacheAndNetwork"
|
|
54094
|
+
};
|
|
54095
|
+
var ArtifactKind = {
|
|
54096
|
+
Query: "HoudiniQuery",
|
|
54097
|
+
Subscription: "HoudiniSubscription",
|
|
54098
|
+
Mutation: "HoudiniMutation",
|
|
54099
|
+
Fragment: "HoudiniFragment"
|
|
54100
|
+
};
|
|
54101
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
54102
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
54103
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
54104
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
54105
|
+
var RefetchUpdateMode = {
|
|
54106
|
+
append: "append",
|
|
54107
|
+
prepend: "prepend",
|
|
54108
|
+
replace: "replace"
|
|
54109
|
+
};
|
|
54110
|
+
|
|
54088
54111
|
// src/lib/constants.ts
|
|
54089
54112
|
var siteURL = "https://houdinigraphql.com";
|
|
54090
54113
|
var houdini_mode = {
|
|
@@ -54407,13 +54430,12 @@ async function glob(pattern) {
|
|
|
54407
54430
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
54408
54431
|
|
|
54409
54432
|
// src/lib/types.ts
|
|
54410
|
-
var LogLevel =
|
|
54411
|
-
|
|
54412
|
-
|
|
54413
|
-
|
|
54414
|
-
|
|
54415
|
-
|
|
54416
|
-
})(LogLevel || {});
|
|
54433
|
+
var LogLevel = {
|
|
54434
|
+
Full: "full",
|
|
54435
|
+
Summary: "summary",
|
|
54436
|
+
ShortSummary: "short-summary",
|
|
54437
|
+
Quiet: "quiet"
|
|
54438
|
+
};
|
|
54417
54439
|
|
|
54418
54440
|
// src/lib/config.ts
|
|
54419
54441
|
var currentDir = global.__dirname || dirname(fileURLToPath(import.meta.url));
|
|
@@ -54464,7 +54486,7 @@ var Config = class {
|
|
|
54464
54486
|
scalars,
|
|
54465
54487
|
cacheBufferSize,
|
|
54466
54488
|
definitionsPath,
|
|
54467
|
-
defaultCachePolicy =
|
|
54489
|
+
defaultCachePolicy = CachePolicy.CacheOrNetwork,
|
|
54468
54490
|
defaultPartial = false,
|
|
54469
54491
|
defaultListPosition = "append",
|
|
54470
54492
|
defaultListTarget = null,
|
|
@@ -54486,7 +54508,7 @@ var Config = class {
|
|
|
54486
54508
|
Object.values(LogLevel)
|
|
54487
54509
|
)}`
|
|
54488
54510
|
);
|
|
54489
|
-
logLevel =
|
|
54511
|
+
logLevel = LogLevel.Summary;
|
|
54490
54512
|
}
|
|
54491
54513
|
this.schemaPath = schemaPath;
|
|
54492
54514
|
this.filepath = filepath;
|
|
@@ -54502,7 +54524,7 @@ var Config = class {
|
|
|
54502
54524
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
54503
54525
|
this.defaultListTarget = defaultListTarget;
|
|
54504
54526
|
this.definitionsFolder = definitionsPath;
|
|
54505
|
-
this.logLevel = (logLevel ||
|
|
54527
|
+
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
54506
54528
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
54507
54529
|
this.routesDir = join(this.projectRoot, "src", "routes");
|
|
54508
54530
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -55501,7 +55523,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
55501
55523
|
};
|
|
55502
55524
|
documents.push({
|
|
55503
55525
|
name: "generated::fragmentVariables",
|
|
55504
|
-
kind:
|
|
55526
|
+
kind: ArtifactKind.Fragment,
|
|
55505
55527
|
document: doc,
|
|
55506
55528
|
originalParsed: doc,
|
|
55507
55529
|
generateStore: false,
|
|
@@ -56422,7 +56444,7 @@ async function paginate(config2, documents) {
|
|
|
56422
56444
|
]
|
|
56423
56445
|
};
|
|
56424
56446
|
newDocs.push({
|
|
56425
|
-
kind:
|
|
56447
|
+
kind: ArtifactKind.Query,
|
|
56426
56448
|
filename: doc.filename,
|
|
56427
56449
|
name: refetchQueryName,
|
|
56428
56450
|
document: queryDoc,
|
|
@@ -56842,7 +56864,7 @@ async function addListFragments(config2, documents) {
|
|
|
56842
56864
|
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql9.print).join("\n\n");
|
|
56843
56865
|
documents.push({
|
|
56844
56866
|
name: "generated::lists",
|
|
56845
|
-
kind:
|
|
56867
|
+
kind: ArtifactKind.Fragment,
|
|
56846
56868
|
generateArtifact: false,
|
|
56847
56869
|
generateStore: false,
|
|
56848
56870
|
document: generatedDoc,
|
|
@@ -57109,7 +57131,7 @@ function selection({
|
|
|
57109
57131
|
(directive) => directive.name.value === config2.paginateDirective
|
|
57110
57132
|
);
|
|
57111
57133
|
if (paginated && document.refetch && document.refetch.method === "offset") {
|
|
57112
|
-
fieldObj.updates = [
|
|
57134
|
+
fieldObj.updates = [RefetchUpdateMode.append];
|
|
57113
57135
|
}
|
|
57114
57136
|
let continueConnection = inConnection;
|
|
57115
57137
|
if ([
|
|
@@ -57119,7 +57141,7 @@ function selection({
|
|
|
57119
57141
|
"hasNextPage",
|
|
57120
57142
|
"hasPreviousPage"
|
|
57121
57143
|
].includes(attributeName) && inConnection && document.refetch) {
|
|
57122
|
-
fieldObj.updates = [
|
|
57144
|
+
fieldObj.updates = [RefetchUpdateMode.append, RefetchUpdateMode.prepend];
|
|
57123
57145
|
}
|
|
57124
57146
|
if (attributeName === "node" && inConnection) {
|
|
57125
57147
|
continueConnection = false;
|
|
@@ -57298,7 +57320,7 @@ function artifactGenerator(stats) {
|
|
|
57298
57320
|
);
|
|
57299
57321
|
let rootType = "";
|
|
57300
57322
|
let selectionSet;
|
|
57301
|
-
if (docKind !==
|
|
57323
|
+
if (docKind !== ArtifactKind.Fragment) {
|
|
57302
57324
|
const operation = operations[0];
|
|
57303
57325
|
if (operation.operation === "query") {
|
|
57304
57326
|
rootType = config2.schema.getQueryType()?.name;
|
|
@@ -57331,7 +57353,7 @@ function artifactGenerator(stats) {
|
|
|
57331
57353
|
let directive = fragments[0]?.directives?.find(
|
|
57332
57354
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
57333
57355
|
);
|
|
57334
|
-
if (docKind ===
|
|
57356
|
+
if (docKind === ArtifactKind.Fragment && directive) {
|
|
57335
57357
|
inputs = fragmentArgumentsDefinitions(config2, doc.filename, fragments[0]);
|
|
57336
57358
|
}
|
|
57337
57359
|
const mergedSelection = flattenSelections({
|
|
@@ -57379,7 +57401,7 @@ function artifactGenerator(stats) {
|
|
|
57379
57401
|
}
|
|
57380
57402
|
const result = { ...prev };
|
|
57381
57403
|
const dataToAdd = plugin2.artifactData({ config: config2, document: doc }) ?? {};
|
|
57382
|
-
if (Object.keys(dataToAdd)
|
|
57404
|
+
if (Object.keys(dataToAdd)) {
|
|
57383
57405
|
result[plugin2.name] = dataToAdd;
|
|
57384
57406
|
}
|
|
57385
57407
|
return result;
|
|
@@ -58628,7 +58650,7 @@ function listDefinitions(config2, body, docs) {
|
|
|
58628
58650
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
58629
58651
|
return AST12.tsTupleType(
|
|
58630
58652
|
docs.reduce((prev, doc) => {
|
|
58631
|
-
if (doc.kind !==
|
|
58653
|
+
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
58632
58654
|
return prev;
|
|
58633
58655
|
}
|
|
58634
58656
|
const definition = doc.document.definitions.find(
|
|
@@ -58659,7 +58681,7 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
58659
58681
|
}
|
|
58660
58682
|
function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
58661
58683
|
return docs.reduce((prev, doc) => {
|
|
58662
|
-
if (doc.kind !==
|
|
58684
|
+
if (doc.kind !== ArtifactKind.Fragment) {
|
|
58663
58685
|
return prev;
|
|
58664
58686
|
}
|
|
58665
58687
|
const definition = doc.document.definitions.find(
|
|
@@ -58870,10 +58892,10 @@ var graphql20 = __toESM(require_graphql2(), 1);
|
|
|
58870
58892
|
async function graphqlExtensions(config2, documents) {
|
|
58871
58893
|
let internalSchema = `
|
|
58872
58894
|
enum CachePolicy {
|
|
58873
|
-
${
|
|
58874
|
-
${
|
|
58875
|
-
${
|
|
58876
|
-
${
|
|
58895
|
+
${CachePolicy.CacheAndNetwork}
|
|
58896
|
+
${CachePolicy.CacheOnly}
|
|
58897
|
+
${CachePolicy.CacheOrNetwork}
|
|
58898
|
+
${CachePolicy.NetworkOnly}
|
|
58877
58899
|
}
|
|
58878
58900
|
|
|
58879
58901
|
"""
|
|
@@ -59789,7 +59811,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
59789
59811
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
59790
59812
|
function displayInvalidNodeFieldMessage(logLevel) {
|
|
59791
59813
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
59792
|
-
if (logLevel ===
|
|
59814
|
+
if (logLevel === LogLevel.Full) {
|
|
59793
59815
|
console.warn(invalidNodeFieldMessage);
|
|
59794
59816
|
} else {
|
|
59795
59817
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -59953,7 +59975,7 @@ async function runPipeline2(config2, docs) {
|
|
|
59953
59975
|
}
|
|
59954
59976
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
59955
59977
|
const printMessage = !config2.pluginMode || unchanged !== artifactStats.total.length;
|
|
59956
|
-
if (!printMessage || config2.logLevel ===
|
|
59978
|
+
if (!printMessage || config2.logLevel === LogLevel.Quiet) {
|
|
59957
59979
|
if (error) {
|
|
59958
59980
|
throw error;
|
|
59959
59981
|
}
|
|
@@ -59967,14 +59989,14 @@ async function runPipeline2(config2, docs) {
|
|
|
59967
59989
|
}
|
|
59968
59990
|
if (artifactStats.total.length === 0) {
|
|
59969
59991
|
console.log(`\u{1F4A1} No operation found. If that's unexpected, please check your config.`);
|
|
59970
|
-
} else if (
|
|
59992
|
+
} else if (config2.logLevel == LogLevel.Summary || config2.logLevel == LogLevel.ShortSummary) {
|
|
59971
59993
|
if (unchanged > 0 && printMessage && !config2.pluginMode) {
|
|
59972
59994
|
console.log(`\u{1F4C3} Unchanged: ${unchanged}`);
|
|
59973
59995
|
}
|
|
59974
59996
|
logStyled("CREATED", artifactStats.new, config2.logLevel, config2.pluginMode);
|
|
59975
59997
|
logStyled("UPDATED", artifactStats.changed, config2.logLevel, config2.pluginMode);
|
|
59976
59998
|
logStyled("DELETED", artifactStats.deleted, config2.logLevel, config2.pluginMode);
|
|
59977
|
-
} else if (config2.logLevel ===
|
|
59999
|
+
} else if (config2.logLevel === LogLevel.Full) {
|
|
59978
60000
|
for (const artifact of artifactStats.total) {
|
|
59979
60001
|
let emoji = "\u{1F4C3}";
|
|
59980
60002
|
if (artifactStats.changed.includes(artifact)) {
|
|
@@ -60018,7 +60040,7 @@ function logStyled(kind, stat2, logLevel, plugin2) {
|
|
|
60018
60040
|
}
|
|
60019
60041
|
}
|
|
60020
60042
|
console.log(msg.join(""));
|
|
60021
|
-
if (!plugin2 && logLevel ===
|
|
60043
|
+
if (!plugin2 && logLevel === LogLevel.Summary) {
|
|
60022
60044
|
for (const artifact of stat2.slice(0, nbToDisplay)) {
|
|
60023
60045
|
console.log(` ${artifact}`);
|
|
60024
60046
|
}
|
|
@@ -60301,14 +60323,14 @@ function mockCollectedDoc(query) {
|
|
|
60301
60323
|
const parsed = graphql25.parse(query);
|
|
60302
60324
|
const name = parsed.definitions[0].name.value;
|
|
60303
60325
|
const operations = parsed.definitions;
|
|
60304
|
-
let kind =
|
|
60326
|
+
let kind = ArtifactKind.Fragment;
|
|
60305
60327
|
if (operations.length === 1) {
|
|
60306
60328
|
if (operations[0].kind === "OperationDefinition" && operations[0].operation === "query") {
|
|
60307
|
-
kind =
|
|
60329
|
+
kind = ArtifactKind.Query;
|
|
60308
60330
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "mutation") {
|
|
60309
|
-
kind =
|
|
60331
|
+
kind = ArtifactKind.Mutation;
|
|
60310
60332
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "subscription") {
|
|
60311
|
-
kind =
|
|
60333
|
+
kind = ArtifactKind.Subscription;
|
|
60312
60334
|
}
|
|
60313
60335
|
}
|
|
60314
60336
|
return {
|