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/vite-cjs/index.js
CHANGED
|
@@ -65217,10 +65217,27 @@ function computeID(configFile, type, data) {
|
|
|
65217
65217
|
}
|
|
65218
65218
|
|
|
65219
65219
|
// src/runtime/lib/types.ts
|
|
65220
|
-
var
|
|
65221
|
-
|
|
65222
|
-
|
|
65223
|
-
|
|
65220
|
+
var CachePolicy = {
|
|
65221
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
65222
|
+
CacheOnly: "CacheOnly",
|
|
65223
|
+
NetworkOnly: "NetworkOnly",
|
|
65224
|
+
CacheAndNetwork: "CacheAndNetwork"
|
|
65225
|
+
};
|
|
65226
|
+
var ArtifactKind = {
|
|
65227
|
+
Query: "HoudiniQuery",
|
|
65228
|
+
Subscription: "HoudiniSubscription",
|
|
65229
|
+
Mutation: "HoudiniMutation",
|
|
65230
|
+
Fragment: "HoudiniFragment"
|
|
65231
|
+
};
|
|
65232
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
65233
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
65234
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
65235
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
65236
|
+
var RefetchUpdateMode = {
|
|
65237
|
+
append: "append",
|
|
65238
|
+
prepend: "prepend",
|
|
65239
|
+
replace: "replace"
|
|
65240
|
+
};
|
|
65224
65241
|
|
|
65225
65242
|
// src/lib/constants.ts
|
|
65226
65243
|
var siteURL = "https://houdinigraphql.com";
|
|
@@ -66800,13 +66817,12 @@ function plugin(name, hooks) {
|
|
|
66800
66817
|
}
|
|
66801
66818
|
|
|
66802
66819
|
// src/lib/types.ts
|
|
66803
|
-
var LogLevel =
|
|
66804
|
-
|
|
66805
|
-
|
|
66806
|
-
|
|
66807
|
-
|
|
66808
|
-
|
|
66809
|
-
})(LogLevel || {});
|
|
66820
|
+
var LogLevel = {
|
|
66821
|
+
Full: "full",
|
|
66822
|
+
Summary: "summary",
|
|
66823
|
+
ShortSummary: "short-summary",
|
|
66824
|
+
Quiet: "quiet"
|
|
66825
|
+
};
|
|
66810
66826
|
|
|
66811
66827
|
// src/lib/config.ts
|
|
66812
66828
|
var import_meta = {};
|
|
@@ -66858,7 +66874,7 @@ var Config = class {
|
|
|
66858
66874
|
scalars,
|
|
66859
66875
|
cacheBufferSize,
|
|
66860
66876
|
definitionsPath,
|
|
66861
|
-
defaultCachePolicy =
|
|
66877
|
+
defaultCachePolicy = CachePolicy.CacheOrNetwork,
|
|
66862
66878
|
defaultPartial = false,
|
|
66863
66879
|
defaultListPosition = "append",
|
|
66864
66880
|
defaultListTarget = null,
|
|
@@ -66880,7 +66896,7 @@ var Config = class {
|
|
|
66880
66896
|
Object.values(LogLevel)
|
|
66881
66897
|
)}`
|
|
66882
66898
|
);
|
|
66883
|
-
logLevel =
|
|
66899
|
+
logLevel = LogLevel.Summary;
|
|
66884
66900
|
}
|
|
66885
66901
|
this.schemaPath = schemaPath;
|
|
66886
66902
|
this.filepath = filepath;
|
|
@@ -66896,7 +66912,7 @@ var Config = class {
|
|
|
66896
66912
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
66897
66913
|
this.defaultListTarget = defaultListTarget;
|
|
66898
66914
|
this.definitionsFolder = definitionsPath;
|
|
66899
|
-
this.logLevel = (logLevel ||
|
|
66915
|
+
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
66900
66916
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
66901
66917
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
66902
66918
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -68289,7 +68305,7 @@ async function fragmentVariables(config4, documents) {
|
|
|
68289
68305
|
};
|
|
68290
68306
|
documents.push({
|
|
68291
68307
|
name: "generated::fragmentVariables",
|
|
68292
|
-
kind:
|
|
68308
|
+
kind: ArtifactKind.Fragment,
|
|
68293
68309
|
document: doc,
|
|
68294
68310
|
originalParsed: doc,
|
|
68295
68311
|
generateStore: false,
|
|
@@ -69216,7 +69232,7 @@ async function paginate(config4, documents) {
|
|
|
69216
69232
|
]
|
|
69217
69233
|
};
|
|
69218
69234
|
newDocs.push({
|
|
69219
|
-
kind:
|
|
69235
|
+
kind: ArtifactKind.Query,
|
|
69220
69236
|
filename: doc.filename,
|
|
69221
69237
|
name: refetchQueryName,
|
|
69222
69238
|
document: queryDoc,
|
|
@@ -69636,7 +69652,7 @@ async function addListFragments(config4, documents) {
|
|
|
69636
69652
|
config4.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql11.print).join("\n\n");
|
|
69637
69653
|
documents.push({
|
|
69638
69654
|
name: "generated::lists",
|
|
69639
|
-
kind:
|
|
69655
|
+
kind: ArtifactKind.Fragment,
|
|
69640
69656
|
generateArtifact: false,
|
|
69641
69657
|
generateStore: false,
|
|
69642
69658
|
document: generatedDoc,
|
|
@@ -69903,7 +69919,7 @@ function selection({
|
|
|
69903
69919
|
(directive) => directive.name.value === config4.paginateDirective
|
|
69904
69920
|
);
|
|
69905
69921
|
if (paginated && document.refetch && document.refetch.method === "offset") {
|
|
69906
|
-
fieldObj.updates = [
|
|
69922
|
+
fieldObj.updates = [RefetchUpdateMode.append];
|
|
69907
69923
|
}
|
|
69908
69924
|
let continueConnection = inConnection;
|
|
69909
69925
|
if ([
|
|
@@ -69913,7 +69929,7 @@ function selection({
|
|
|
69913
69929
|
"hasNextPage",
|
|
69914
69930
|
"hasPreviousPage"
|
|
69915
69931
|
].includes(attributeName) && inConnection && document.refetch) {
|
|
69916
|
-
fieldObj.updates = [
|
|
69932
|
+
fieldObj.updates = [RefetchUpdateMode.append, RefetchUpdateMode.prepend];
|
|
69917
69933
|
}
|
|
69918
69934
|
if (attributeName === "node" && inConnection) {
|
|
69919
69935
|
continueConnection = false;
|
|
@@ -70092,7 +70108,7 @@ function artifactGenerator(stats) {
|
|
|
70092
70108
|
);
|
|
70093
70109
|
let rootType = "";
|
|
70094
70110
|
let selectionSet;
|
|
70095
|
-
if (docKind !==
|
|
70111
|
+
if (docKind !== ArtifactKind.Fragment) {
|
|
70096
70112
|
const operation = operations[0];
|
|
70097
70113
|
if (operation.operation === "query") {
|
|
70098
70114
|
rootType = config4.schema.getQueryType()?.name;
|
|
@@ -70125,7 +70141,7 @@ function artifactGenerator(stats) {
|
|
|
70125
70141
|
let directive = fragments[0]?.directives?.find(
|
|
70126
70142
|
(directive2) => directive2.name.value === config4.argumentsDirective
|
|
70127
70143
|
);
|
|
70128
|
-
if (docKind ===
|
|
70144
|
+
if (docKind === ArtifactKind.Fragment && directive) {
|
|
70129
70145
|
inputs = fragmentArgumentsDefinitions(config4, doc.filename, fragments[0]);
|
|
70130
70146
|
}
|
|
70131
70147
|
const mergedSelection = flattenSelections({
|
|
@@ -70173,7 +70189,7 @@ function artifactGenerator(stats) {
|
|
|
70173
70189
|
}
|
|
70174
70190
|
const result = { ...prev };
|
|
70175
70191
|
const dataToAdd = plugin2.artifactData({ config: config4, document: doc }) ?? {};
|
|
70176
|
-
if (Object.keys(dataToAdd)
|
|
70192
|
+
if (Object.keys(dataToAdd)) {
|
|
70177
70193
|
result[plugin2.name] = dataToAdd;
|
|
70178
70194
|
}
|
|
70179
70195
|
return result;
|
|
@@ -71422,7 +71438,7 @@ function listDefinitions(config4, body, docs) {
|
|
|
71422
71438
|
function queryDefinitions(config4, body, docs, returnType) {
|
|
71423
71439
|
return AST12.tsTupleType(
|
|
71424
71440
|
docs.reduce((prev, doc) => {
|
|
71425
|
-
if (doc.kind !==
|
|
71441
|
+
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
71426
71442
|
return prev;
|
|
71427
71443
|
}
|
|
71428
71444
|
const definition = doc.document.definitions.find(
|
|
@@ -71453,7 +71469,7 @@ function queryDefinitions(config4, body, docs, returnType) {
|
|
|
71453
71469
|
}
|
|
71454
71470
|
function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
71455
71471
|
return docs.reduce((prev, doc) => {
|
|
71456
|
-
if (doc.kind !==
|
|
71472
|
+
if (doc.kind !== ArtifactKind.Fragment) {
|
|
71457
71473
|
return prev;
|
|
71458
71474
|
}
|
|
71459
71475
|
const definition = doc.document.definitions.find(
|
|
@@ -71664,10 +71680,10 @@ var graphql22 = __toESM(require_graphql2(), 1);
|
|
|
71664
71680
|
async function graphqlExtensions(config4, documents) {
|
|
71665
71681
|
let internalSchema = `
|
|
71666
71682
|
enum CachePolicy {
|
|
71667
|
-
${
|
|
71668
|
-
${
|
|
71669
|
-
${
|
|
71670
|
-
${
|
|
71683
|
+
${CachePolicy.CacheAndNetwork}
|
|
71684
|
+
${CachePolicy.CacheOnly}
|
|
71685
|
+
${CachePolicy.CacheOrNetwork}
|
|
71686
|
+
${CachePolicy.NetworkOnly}
|
|
71671
71687
|
}
|
|
71672
71688
|
|
|
71673
71689
|
"""
|
|
@@ -72583,7 +72599,7 @@ function getAndVerifyNodeInterface(config4) {
|
|
|
72583
72599
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
72584
72600
|
function displayInvalidNodeFieldMessage(logLevel) {
|
|
72585
72601
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
72586
|
-
if (logLevel ===
|
|
72602
|
+
if (logLevel === LogLevel.Full) {
|
|
72587
72603
|
console.warn(invalidNodeFieldMessage);
|
|
72588
72604
|
} else {
|
|
72589
72605
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -72751,7 +72767,7 @@ async function runPipeline2(config4, docs) {
|
|
|
72751
72767
|
}
|
|
72752
72768
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
72753
72769
|
const printMessage = !config4.pluginMode || unchanged !== artifactStats.total.length;
|
|
72754
|
-
if (!printMessage || config4.logLevel ===
|
|
72770
|
+
if (!printMessage || config4.logLevel === LogLevel.Quiet) {
|
|
72755
72771
|
if (error) {
|
|
72756
72772
|
throw error;
|
|
72757
72773
|
}
|
|
@@ -72765,14 +72781,14 @@ async function runPipeline2(config4, docs) {
|
|
|
72765
72781
|
}
|
|
72766
72782
|
if (artifactStats.total.length === 0) {
|
|
72767
72783
|
console.log(`\u{1F4A1} No operation found. If that's unexpected, please check your config.`);
|
|
72768
|
-
} else if (
|
|
72784
|
+
} else if (config4.logLevel == LogLevel.Summary || config4.logLevel == LogLevel.ShortSummary) {
|
|
72769
72785
|
if (unchanged > 0 && printMessage && !config4.pluginMode) {
|
|
72770
72786
|
console.log(`\u{1F4C3} Unchanged: ${unchanged}`);
|
|
72771
72787
|
}
|
|
72772
72788
|
logStyled("CREATED", artifactStats.new, config4.logLevel, config4.pluginMode);
|
|
72773
72789
|
logStyled("UPDATED", artifactStats.changed, config4.logLevel, config4.pluginMode);
|
|
72774
72790
|
logStyled("DELETED", artifactStats.deleted, config4.logLevel, config4.pluginMode);
|
|
72775
|
-
} else if (config4.logLevel ===
|
|
72791
|
+
} else if (config4.logLevel === LogLevel.Full) {
|
|
72776
72792
|
for (const artifact of artifactStats.total) {
|
|
72777
72793
|
let emoji = "\u{1F4C3}";
|
|
72778
72794
|
if (artifactStats.changed.includes(artifact)) {
|
|
@@ -72882,14 +72898,14 @@ async function processGraphQLDocument(config4, filepath, document) {
|
|
|
72882
72898
|
});
|
|
72883
72899
|
}
|
|
72884
72900
|
}
|
|
72885
|
-
let kind =
|
|
72901
|
+
let kind = ArtifactKind.Fragment;
|
|
72886
72902
|
if (operations.length === 1) {
|
|
72887
72903
|
if (operations[0].kind === "OperationDefinition" && operations[0].operation === "query") {
|
|
72888
|
-
kind =
|
|
72904
|
+
kind = ArtifactKind.Query;
|
|
72889
72905
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "mutation") {
|
|
72890
|
-
kind =
|
|
72906
|
+
kind = ArtifactKind.Mutation;
|
|
72891
72907
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "subscription") {
|
|
72892
|
-
kind =
|
|
72908
|
+
kind = ArtifactKind.Subscription;
|
|
72893
72909
|
}
|
|
72894
72910
|
}
|
|
72895
72911
|
return {
|
|
@@ -72934,7 +72950,7 @@ function logStyled(kind, stat3, logLevel, plugin2) {
|
|
|
72934
72950
|
}
|
|
72935
72951
|
}
|
|
72936
72952
|
console.log(msg.join(""));
|
|
72937
|
-
if (!plugin2 && logLevel ===
|
|
72953
|
+
if (!plugin2 && logLevel === LogLevel.Summary) {
|
|
72938
72954
|
for (const artifact of stat3.slice(0, nbToDisplay)) {
|
|
72939
72955
|
console.log(` ${artifact}`);
|
|
72940
72956
|
}
|
package/build/vite-esm/index.js
CHANGED
|
@@ -65212,10 +65212,27 @@ function computeID(configFile, type, data) {
|
|
|
65212
65212
|
}
|
|
65213
65213
|
|
|
65214
65214
|
// src/runtime/lib/types.ts
|
|
65215
|
-
var
|
|
65216
|
-
|
|
65217
|
-
|
|
65218
|
-
|
|
65215
|
+
var CachePolicy = {
|
|
65216
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
65217
|
+
CacheOnly: "CacheOnly",
|
|
65218
|
+
NetworkOnly: "NetworkOnly",
|
|
65219
|
+
CacheAndNetwork: "CacheAndNetwork"
|
|
65220
|
+
};
|
|
65221
|
+
var ArtifactKind = {
|
|
65222
|
+
Query: "HoudiniQuery",
|
|
65223
|
+
Subscription: "HoudiniSubscription",
|
|
65224
|
+
Mutation: "HoudiniMutation",
|
|
65225
|
+
Fragment: "HoudiniFragment"
|
|
65226
|
+
};
|
|
65227
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
65228
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
65229
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
65230
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
65231
|
+
var RefetchUpdateMode = {
|
|
65232
|
+
append: "append",
|
|
65233
|
+
prepend: "prepend",
|
|
65234
|
+
replace: "replace"
|
|
65235
|
+
};
|
|
65219
65236
|
|
|
65220
65237
|
// src/lib/constants.ts
|
|
65221
65238
|
var siteURL = "https://houdinigraphql.com";
|
|
@@ -66795,13 +66812,12 @@ function plugin(name, hooks) {
|
|
|
66795
66812
|
}
|
|
66796
66813
|
|
|
66797
66814
|
// src/lib/types.ts
|
|
66798
|
-
var LogLevel =
|
|
66799
|
-
|
|
66800
|
-
|
|
66801
|
-
|
|
66802
|
-
|
|
66803
|
-
|
|
66804
|
-
})(LogLevel || {});
|
|
66815
|
+
var LogLevel = {
|
|
66816
|
+
Full: "full",
|
|
66817
|
+
Summary: "summary",
|
|
66818
|
+
ShortSummary: "short-summary",
|
|
66819
|
+
Quiet: "quiet"
|
|
66820
|
+
};
|
|
66805
66821
|
|
|
66806
66822
|
// src/lib/config.ts
|
|
66807
66823
|
var currentDir = global.__dirname || dirname(fileURLToPath(import.meta.url));
|
|
@@ -66852,7 +66868,7 @@ var Config = class {
|
|
|
66852
66868
|
scalars,
|
|
66853
66869
|
cacheBufferSize,
|
|
66854
66870
|
definitionsPath,
|
|
66855
|
-
defaultCachePolicy =
|
|
66871
|
+
defaultCachePolicy = CachePolicy.CacheOrNetwork,
|
|
66856
66872
|
defaultPartial = false,
|
|
66857
66873
|
defaultListPosition = "append",
|
|
66858
66874
|
defaultListTarget = null,
|
|
@@ -66874,7 +66890,7 @@ var Config = class {
|
|
|
66874
66890
|
Object.values(LogLevel)
|
|
66875
66891
|
)}`
|
|
66876
66892
|
);
|
|
66877
|
-
logLevel =
|
|
66893
|
+
logLevel = LogLevel.Summary;
|
|
66878
66894
|
}
|
|
66879
66895
|
this.schemaPath = schemaPath;
|
|
66880
66896
|
this.filepath = filepath;
|
|
@@ -66890,7 +66906,7 @@ var Config = class {
|
|
|
66890
66906
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
66891
66907
|
this.defaultListTarget = defaultListTarget;
|
|
66892
66908
|
this.definitionsFolder = definitionsPath;
|
|
66893
|
-
this.logLevel = (logLevel ||
|
|
66909
|
+
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
66894
66910
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
66895
66911
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
66896
66912
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -68283,7 +68299,7 @@ async function fragmentVariables(config4, documents) {
|
|
|
68283
68299
|
};
|
|
68284
68300
|
documents.push({
|
|
68285
68301
|
name: "generated::fragmentVariables",
|
|
68286
|
-
kind:
|
|
68302
|
+
kind: ArtifactKind.Fragment,
|
|
68287
68303
|
document: doc,
|
|
68288
68304
|
originalParsed: doc,
|
|
68289
68305
|
generateStore: false,
|
|
@@ -69210,7 +69226,7 @@ async function paginate(config4, documents) {
|
|
|
69210
69226
|
]
|
|
69211
69227
|
};
|
|
69212
69228
|
newDocs.push({
|
|
69213
|
-
kind:
|
|
69229
|
+
kind: ArtifactKind.Query,
|
|
69214
69230
|
filename: doc.filename,
|
|
69215
69231
|
name: refetchQueryName,
|
|
69216
69232
|
document: queryDoc,
|
|
@@ -69630,7 +69646,7 @@ async function addListFragments(config4, documents) {
|
|
|
69630
69646
|
config4.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql11.print).join("\n\n");
|
|
69631
69647
|
documents.push({
|
|
69632
69648
|
name: "generated::lists",
|
|
69633
|
-
kind:
|
|
69649
|
+
kind: ArtifactKind.Fragment,
|
|
69634
69650
|
generateArtifact: false,
|
|
69635
69651
|
generateStore: false,
|
|
69636
69652
|
document: generatedDoc,
|
|
@@ -69897,7 +69913,7 @@ function selection({
|
|
|
69897
69913
|
(directive) => directive.name.value === config4.paginateDirective
|
|
69898
69914
|
);
|
|
69899
69915
|
if (paginated && document.refetch && document.refetch.method === "offset") {
|
|
69900
|
-
fieldObj.updates = [
|
|
69916
|
+
fieldObj.updates = [RefetchUpdateMode.append];
|
|
69901
69917
|
}
|
|
69902
69918
|
let continueConnection = inConnection;
|
|
69903
69919
|
if ([
|
|
@@ -69907,7 +69923,7 @@ function selection({
|
|
|
69907
69923
|
"hasNextPage",
|
|
69908
69924
|
"hasPreviousPage"
|
|
69909
69925
|
].includes(attributeName) && inConnection && document.refetch) {
|
|
69910
|
-
fieldObj.updates = [
|
|
69926
|
+
fieldObj.updates = [RefetchUpdateMode.append, RefetchUpdateMode.prepend];
|
|
69911
69927
|
}
|
|
69912
69928
|
if (attributeName === "node" && inConnection) {
|
|
69913
69929
|
continueConnection = false;
|
|
@@ -70086,7 +70102,7 @@ function artifactGenerator(stats) {
|
|
|
70086
70102
|
);
|
|
70087
70103
|
let rootType = "";
|
|
70088
70104
|
let selectionSet;
|
|
70089
|
-
if (docKind !==
|
|
70105
|
+
if (docKind !== ArtifactKind.Fragment) {
|
|
70090
70106
|
const operation = operations[0];
|
|
70091
70107
|
if (operation.operation === "query") {
|
|
70092
70108
|
rootType = config4.schema.getQueryType()?.name;
|
|
@@ -70119,7 +70135,7 @@ function artifactGenerator(stats) {
|
|
|
70119
70135
|
let directive = fragments[0]?.directives?.find(
|
|
70120
70136
|
(directive2) => directive2.name.value === config4.argumentsDirective
|
|
70121
70137
|
);
|
|
70122
|
-
if (docKind ===
|
|
70138
|
+
if (docKind === ArtifactKind.Fragment && directive) {
|
|
70123
70139
|
inputs = fragmentArgumentsDefinitions(config4, doc.filename, fragments[0]);
|
|
70124
70140
|
}
|
|
70125
70141
|
const mergedSelection = flattenSelections({
|
|
@@ -70167,7 +70183,7 @@ function artifactGenerator(stats) {
|
|
|
70167
70183
|
}
|
|
70168
70184
|
const result = { ...prev };
|
|
70169
70185
|
const dataToAdd = plugin2.artifactData({ config: config4, document: doc }) ?? {};
|
|
70170
|
-
if (Object.keys(dataToAdd)
|
|
70186
|
+
if (Object.keys(dataToAdd)) {
|
|
70171
70187
|
result[plugin2.name] = dataToAdd;
|
|
70172
70188
|
}
|
|
70173
70189
|
return result;
|
|
@@ -71416,7 +71432,7 @@ function listDefinitions(config4, body, docs) {
|
|
|
71416
71432
|
function queryDefinitions(config4, body, docs, returnType) {
|
|
71417
71433
|
return AST12.tsTupleType(
|
|
71418
71434
|
docs.reduce((prev, doc) => {
|
|
71419
|
-
if (doc.kind !==
|
|
71435
|
+
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
71420
71436
|
return prev;
|
|
71421
71437
|
}
|
|
71422
71438
|
const definition = doc.document.definitions.find(
|
|
@@ -71447,7 +71463,7 @@ function queryDefinitions(config4, body, docs, returnType) {
|
|
|
71447
71463
|
}
|
|
71448
71464
|
function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
71449
71465
|
return docs.reduce((prev, doc) => {
|
|
71450
|
-
if (doc.kind !==
|
|
71466
|
+
if (doc.kind !== ArtifactKind.Fragment) {
|
|
71451
71467
|
return prev;
|
|
71452
71468
|
}
|
|
71453
71469
|
const definition = doc.document.definitions.find(
|
|
@@ -71658,10 +71674,10 @@ var graphql22 = __toESM(require_graphql2(), 1);
|
|
|
71658
71674
|
async function graphqlExtensions(config4, documents) {
|
|
71659
71675
|
let internalSchema = `
|
|
71660
71676
|
enum CachePolicy {
|
|
71661
|
-
${
|
|
71662
|
-
${
|
|
71663
|
-
${
|
|
71664
|
-
${
|
|
71677
|
+
${CachePolicy.CacheAndNetwork}
|
|
71678
|
+
${CachePolicy.CacheOnly}
|
|
71679
|
+
${CachePolicy.CacheOrNetwork}
|
|
71680
|
+
${CachePolicy.NetworkOnly}
|
|
71665
71681
|
}
|
|
71666
71682
|
|
|
71667
71683
|
"""
|
|
@@ -72577,7 +72593,7 @@ function getAndVerifyNodeInterface(config4) {
|
|
|
72577
72593
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
72578
72594
|
function displayInvalidNodeFieldMessage(logLevel) {
|
|
72579
72595
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
72580
|
-
if (logLevel ===
|
|
72596
|
+
if (logLevel === LogLevel.Full) {
|
|
72581
72597
|
console.warn(invalidNodeFieldMessage);
|
|
72582
72598
|
} else {
|
|
72583
72599
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -72745,7 +72761,7 @@ async function runPipeline2(config4, docs) {
|
|
|
72745
72761
|
}
|
|
72746
72762
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
72747
72763
|
const printMessage = !config4.pluginMode || unchanged !== artifactStats.total.length;
|
|
72748
|
-
if (!printMessage || config4.logLevel ===
|
|
72764
|
+
if (!printMessage || config4.logLevel === LogLevel.Quiet) {
|
|
72749
72765
|
if (error) {
|
|
72750
72766
|
throw error;
|
|
72751
72767
|
}
|
|
@@ -72759,14 +72775,14 @@ async function runPipeline2(config4, docs) {
|
|
|
72759
72775
|
}
|
|
72760
72776
|
if (artifactStats.total.length === 0) {
|
|
72761
72777
|
console.log(`\u{1F4A1} No operation found. If that's unexpected, please check your config.`);
|
|
72762
|
-
} else if (
|
|
72778
|
+
} else if (config4.logLevel == LogLevel.Summary || config4.logLevel == LogLevel.ShortSummary) {
|
|
72763
72779
|
if (unchanged > 0 && printMessage && !config4.pluginMode) {
|
|
72764
72780
|
console.log(`\u{1F4C3} Unchanged: ${unchanged}`);
|
|
72765
72781
|
}
|
|
72766
72782
|
logStyled("CREATED", artifactStats.new, config4.logLevel, config4.pluginMode);
|
|
72767
72783
|
logStyled("UPDATED", artifactStats.changed, config4.logLevel, config4.pluginMode);
|
|
72768
72784
|
logStyled("DELETED", artifactStats.deleted, config4.logLevel, config4.pluginMode);
|
|
72769
|
-
} else if (config4.logLevel ===
|
|
72785
|
+
} else if (config4.logLevel === LogLevel.Full) {
|
|
72770
72786
|
for (const artifact of artifactStats.total) {
|
|
72771
72787
|
let emoji = "\u{1F4C3}";
|
|
72772
72788
|
if (artifactStats.changed.includes(artifact)) {
|
|
@@ -72876,14 +72892,14 @@ async function processGraphQLDocument(config4, filepath, document) {
|
|
|
72876
72892
|
});
|
|
72877
72893
|
}
|
|
72878
72894
|
}
|
|
72879
|
-
let kind =
|
|
72895
|
+
let kind = ArtifactKind.Fragment;
|
|
72880
72896
|
if (operations.length === 1) {
|
|
72881
72897
|
if (operations[0].kind === "OperationDefinition" && operations[0].operation === "query") {
|
|
72882
|
-
kind =
|
|
72898
|
+
kind = ArtifactKind.Query;
|
|
72883
72899
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "mutation") {
|
|
72884
|
-
kind =
|
|
72900
|
+
kind = ArtifactKind.Mutation;
|
|
72885
72901
|
} else if (operations[0].kind === "OperationDefinition" && operations[0].operation === "subscription") {
|
|
72886
|
-
kind =
|
|
72902
|
+
kind = ArtifactKind.Subscription;
|
|
72887
72903
|
}
|
|
72888
72904
|
}
|
|
72889
72905
|
return {
|
|
@@ -72928,7 +72944,7 @@ function logStyled(kind, stat3, logLevel, plugin2) {
|
|
|
72928
72944
|
}
|
|
72929
72945
|
}
|
|
72930
72946
|
console.log(msg.join(""));
|
|
72931
|
-
if (!plugin2 && logLevel ===
|
|
72947
|
+
if (!plugin2 && logLevel === LogLevel.Summary) {
|
|
72932
72948
|
for (const artifact of stat3.slice(0, nbToDisplay)) {
|
|
72933
72949
|
console.log(` ${artifact}`);
|
|
72934
72950
|
}
|