houdini 1.2.12 → 1.2.14
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/adapter/index.d.ts +3 -0
- package/build/adapter-cjs/index.js +33 -0
- package/build/adapter-esm/index.js +9 -0
- package/build/cmd/init.d.ts +1 -0
- package/build/cmd-cjs/index.js +53 -48
- package/build/cmd-esm/index.js +51 -46
- package/build/codegen-cjs/index.js +23 -25
- package/build/codegen-esm/index.js +23 -24
- package/build/lib/index.d.ts +3 -1
- package/build/{router → lib/router}/conventions.d.ts +3 -5
- package/build/{router → lib/router}/index.d.ts +1 -1
- package/build/{router → lib/router}/manifest.d.ts +2 -2
- package/build/{router → lib/router}/server.d.ts +2 -2
- package/build/{router → lib/router}/types.d.ts +2 -1
- package/build/lib/types.d.ts +1 -1
- package/build/lib-cjs/index.js +148 -32
- package/build/lib-esm/index.js +142 -29
- package/build/runtime/lib/types.d.ts +1 -1
- package/build/runtime/router/match.d.ts +38 -0
- package/build/runtime/router/server.d.ts +22 -25
- package/build/runtime/router/session.d.ts +22 -0
- package/build/runtime/router/types.d.ts +23 -0
- package/build/runtime-cjs/lib/types.d.ts +1 -1
- package/build/runtime-cjs/lib/types.js +2 -0
- package/build/runtime-cjs/router/match.d.ts +38 -0
- package/build/runtime-cjs/router/match.js +149 -0
- package/build/runtime-cjs/router/server.d.ts +22 -25
- package/build/runtime-cjs/router/server.js +71 -49
- package/build/runtime-cjs/router/session.d.ts +22 -0
- package/build/runtime-cjs/router/session.js +77 -0
- package/build/runtime-cjs/router/types.d.ts +23 -0
- package/build/runtime-cjs/router/types.js +16 -0
- package/build/runtime-esm/lib/types.d.ts +1 -1
- package/build/runtime-esm/lib/types.js +1 -0
- package/build/runtime-esm/router/match.d.ts +38 -0
- package/build/runtime-esm/router/match.js +122 -0
- package/build/runtime-esm/router/server.d.ts +22 -25
- package/build/runtime-esm/router/server.js +64 -47
- package/build/runtime-esm/router/session.d.ts +22 -0
- package/build/runtime-esm/router/session.js +52 -0
- package/build/runtime-esm/router/types.d.ts +23 -0
- package/build/runtime-esm/router/types.js +0 -0
- package/build/test-cjs/index.js +27 -25
- package/build/test-esm/index.js +27 -24
- package/build/vite-cjs/index.js +40 -46
- package/build/vite-esm/index.js +39 -44
- package/package.json +10 -9
- package/build/router-cjs/index.js +0 -57736
- package/build/router-esm/index.js +0 -57726
- /package/build/{router-cjs → adapter-cjs}/package.json +0 -0
- /package/build/{router-esm → adapter-esm}/package.json +0 -0
package/build/test-esm/index.js
CHANGED
|
@@ -57113,7 +57113,7 @@ var LogLevel = {
|
|
|
57113
57113
|
};
|
|
57114
57114
|
|
|
57115
57115
|
// src/lib/config.ts
|
|
57116
|
-
var currentDir =
|
|
57116
|
+
var currentDir = dirname(fileURLToPath(import.meta.url));
|
|
57117
57117
|
var Config = class {
|
|
57118
57118
|
filepath;
|
|
57119
57119
|
rootDir;
|
|
@@ -57972,13 +57972,10 @@ async function cleanupFiles(pathFolder, listOfObj) {
|
|
|
57972
57972
|
// src/lib/walk.ts
|
|
57973
57973
|
import * as graphql4 from "graphql";
|
|
57974
57974
|
|
|
57975
|
-
// src/router/manifest.ts
|
|
57975
|
+
// src/lib/router/manifest.ts
|
|
57976
57976
|
var t = __toESM(require_lib6(), 1);
|
|
57977
57977
|
import * as graphql5 from "graphql";
|
|
57978
57978
|
|
|
57979
|
-
// src/router/server.ts
|
|
57980
|
-
import { build } from "vite";
|
|
57981
|
-
|
|
57982
57979
|
// src/codegen/generators/artifacts/index.ts
|
|
57983
57980
|
var recast5 = __toESM(require_main2(), 1);
|
|
57984
57981
|
import * as graphql15 from "graphql";
|
|
@@ -58985,9 +58982,11 @@ function serializeValue(value) {
|
|
|
58985
58982
|
}
|
|
58986
58983
|
if (typeof value === "object" && value !== null) {
|
|
58987
58984
|
return AST4.objectExpression(
|
|
58988
|
-
Object.entries(value).filter(
|
|
58989
|
-
([key, value2]) =>
|
|
58990
|
-
)
|
|
58985
|
+
Object.entries(value).filter(
|
|
58986
|
+
([key, value2]) => typeof value2 !== "undefined" && key !== "prev" && key !== "next"
|
|
58987
|
+
).map(([key, val]) => {
|
|
58988
|
+
return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
|
|
58989
|
+
})
|
|
58991
58990
|
);
|
|
58992
58991
|
}
|
|
58993
58992
|
if (typeof value === "string") {
|
|
@@ -59534,7 +59533,7 @@ async function paginate(config2, documents) {
|
|
|
59534
59533
|
value: "__typename"
|
|
59535
59534
|
}
|
|
59536
59535
|
},
|
|
59537
|
-
...(typeConfig?.keys || [
|
|
59536
|
+
...(typeConfig?.keys || [config2.defaultKeys[0]]).map((key) => ({
|
|
59538
59537
|
kind: graphql11.Kind.FIELD,
|
|
59539
59538
|
name: {
|
|
59540
59539
|
kind: graphql11.Kind.NAME,
|
|
@@ -63218,7 +63217,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
63218
63217
|
if (missing.length > 0) {
|
|
63219
63218
|
ctx.reportError(
|
|
63220
63219
|
new graphql26.GraphQLError(
|
|
63221
|
-
|
|
63220
|
+
`The following arguments are missing from the "${fragmentName}" fragment: ` + JSON.stringify(missing)
|
|
63222
63221
|
)
|
|
63223
63222
|
);
|
|
63224
63223
|
return;
|
|
@@ -63454,7 +63453,7 @@ function nodeDirectives(config2, directives) {
|
|
|
63454
63453
|
}
|
|
63455
63454
|
if (!possibleNodes.includes(definitionType)) {
|
|
63456
63455
|
ctx.reportError(
|
|
63457
|
-
new graphql26.GraphQLError(paginateOnNonNodeMessage(
|
|
63456
|
+
new graphql26.GraphQLError(paginateOnNonNodeMessage(node.name.value))
|
|
63458
63457
|
);
|
|
63459
63458
|
}
|
|
63460
63459
|
}
|
|
@@ -63589,45 +63588,45 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
63589
63588
|
return null;
|
|
63590
63589
|
}
|
|
63591
63590
|
if (!graphql26.isInterfaceType(nodeInterface)) {
|
|
63592
|
-
displayInvalidNodeFieldMessage(config2
|
|
63591
|
+
displayInvalidNodeFieldMessage(config2);
|
|
63593
63592
|
return null;
|
|
63594
63593
|
}
|
|
63595
63594
|
const queryType = schema.getQueryType();
|
|
63596
63595
|
if (!queryType) {
|
|
63597
|
-
displayInvalidNodeFieldMessage(config2
|
|
63596
|
+
displayInvalidNodeFieldMessage(config2);
|
|
63598
63597
|
return null;
|
|
63599
63598
|
}
|
|
63600
63599
|
const nodeField = queryType.getFields()["node"];
|
|
63601
63600
|
if (!nodeField) {
|
|
63602
|
-
displayInvalidNodeFieldMessage(config2
|
|
63601
|
+
displayInvalidNodeFieldMessage(config2);
|
|
63603
63602
|
return null;
|
|
63604
63603
|
}
|
|
63605
63604
|
const args = nodeField.args;
|
|
63606
63605
|
if (args.length === 0) {
|
|
63607
|
-
displayInvalidNodeFieldMessage(config2
|
|
63606
|
+
displayInvalidNodeFieldMessage(config2);
|
|
63608
63607
|
return null;
|
|
63609
63608
|
}
|
|
63610
|
-
const idArg = args.find((arg) => arg.name ===
|
|
63609
|
+
const idArg = args.find((arg) => arg.name === config2.defaultKeys[0]);
|
|
63611
63610
|
if (!idArg) {
|
|
63612
|
-
displayInvalidNodeFieldMessage(config2
|
|
63611
|
+
displayInvalidNodeFieldMessage(config2);
|
|
63613
63612
|
return null;
|
|
63614
63613
|
}
|
|
63615
63614
|
const idType = unwrapType(config2, idArg.type);
|
|
63616
63615
|
if (idType.type.name !== "ID") {
|
|
63617
|
-
displayInvalidNodeFieldMessage(config2
|
|
63616
|
+
displayInvalidNodeFieldMessage(config2);
|
|
63618
63617
|
return null;
|
|
63619
63618
|
}
|
|
63620
63619
|
const fieldReturnType = unwrapType(config2, nodeField.type);
|
|
63621
63620
|
if (fieldReturnType.type.name !== "Node") {
|
|
63622
|
-
displayInvalidNodeFieldMessage(config2
|
|
63621
|
+
displayInvalidNodeFieldMessage(config2);
|
|
63623
63622
|
return null;
|
|
63624
63623
|
}
|
|
63625
63624
|
return nodeInterface;
|
|
63626
63625
|
}
|
|
63627
63626
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
63628
|
-
function displayInvalidNodeFieldMessage(
|
|
63627
|
+
function displayInvalidNodeFieldMessage(config2) {
|
|
63629
63628
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
63630
|
-
if (logLevel === LogLevel.Full) {
|
|
63629
|
+
if (config2.logLevel === LogLevel.Full) {
|
|
63631
63630
|
console.warn(invalidNodeFieldMessage);
|
|
63632
63631
|
} else {
|
|
63633
63632
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -63641,18 +63640,18 @@ var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interfa
|
|
|
63641
63640
|
If you are trying to provide the Node interface and its field, they must look like the following:
|
|
63642
63641
|
|
|
63643
63642
|
interface Node {
|
|
63644
|
-
|
|
63643
|
+
id: ID!
|
|
63645
63644
|
}
|
|
63646
63645
|
|
|
63647
63646
|
extend type Query {
|
|
63648
|
-
|
|
63647
|
+
node(id: ID!): Node
|
|
63649
63648
|
}
|
|
63650
63649
|
|
|
63651
63650
|
For more information, please visit these links:
|
|
63652
63651
|
- https://graphql.org/learn/global-object-identification/
|
|
63653
63652
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
63654
63653
|
`;
|
|
63655
|
-
var paginateOnNonNodeMessage = (
|
|
63654
|
+
var paginateOnNonNodeMessage = (directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
|
|
63656
63655
|
If this is happening inside of a fragment, make sure that the fragment either implements the Node interface or you
|
|
63657
63656
|
have defined a resolver entry for the fragment type.
|
|
63658
63657
|
|
|
@@ -63882,6 +63881,10 @@ function testConfigFile({ plugins, ...config2 } = {}) {
|
|
|
63882
63881
|
|
|
63883
63882
|
directive @live on QUERY
|
|
63884
63883
|
|
|
63884
|
+
input MyInput {
|
|
63885
|
+
string: String
|
|
63886
|
+
}
|
|
63887
|
+
|
|
63885
63888
|
type User implements Node & Friend & CatOwner {
|
|
63886
63889
|
id: ID!
|
|
63887
63890
|
name: String!
|
package/build/vite-cjs/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createRequire as conflict_free } from 'module'; const require = conflict_free(import.meta.url);
|
|
2
1
|
"use strict";
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
@@ -69514,7 +69513,7 @@ var LogLevel = {
|
|
|
69514
69513
|
|
|
69515
69514
|
// src/lib/config.ts
|
|
69516
69515
|
var import_meta = {};
|
|
69517
|
-
var currentDir =
|
|
69516
|
+
var currentDir = dirname((0, import_node_url2.fileURLToPath)(import_meta.url));
|
|
69518
69517
|
var Config = class {
|
|
69519
69518
|
filepath;
|
|
69520
69519
|
rootDir;
|
|
@@ -70788,9 +70787,10 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
70788
70787
|
});
|
|
70789
70788
|
}
|
|
70790
70789
|
|
|
70791
|
-
// src/router/conventions.ts
|
|
70790
|
+
// src/lib/router/conventions.ts
|
|
70792
70791
|
var conventions_exports = {};
|
|
70793
70792
|
__export(conventions_exports, {
|
|
70793
|
+
adapter_config_path: () => adapter_config_path,
|
|
70794
70794
|
fallback_unit_path: () => fallback_unit_path,
|
|
70795
70795
|
is_layout: () => is_layout,
|
|
70796
70796
|
layout_unit_path: () => layout_unit_path,
|
|
@@ -70802,13 +70802,10 @@ __export(conventions_exports, {
|
|
|
70802
70802
|
read_layoutView: () => read_layoutView,
|
|
70803
70803
|
read_pageQuery: () => read_pageQuery,
|
|
70804
70804
|
read_pageView: () => read_pageView,
|
|
70805
|
-
render_app_path: () => render_app_path,
|
|
70806
|
-
render_client_path: () => render_client_path,
|
|
70807
|
-
render_server_path: () => render_server_path,
|
|
70808
|
-
render_yoga_path: () => render_yoga_path,
|
|
70809
70805
|
router_index_path: () => router_index_path,
|
|
70810
70806
|
router_path: () => router_path,
|
|
70811
|
-
serialized_manifest_path: () => serialized_manifest_path
|
|
70807
|
+
serialized_manifest_path: () => serialized_manifest_path,
|
|
70808
|
+
server_adapter_path: () => server_adapter_path
|
|
70812
70809
|
});
|
|
70813
70810
|
function router_path(config4) {
|
|
70814
70811
|
return path_exports.join(base_dir(config4), "Router.jsx");
|
|
@@ -70816,17 +70813,11 @@ function router_path(config4) {
|
|
|
70816
70813
|
function page_entry_path(config4, id, base) {
|
|
70817
70814
|
return path_exports.join(page_entries_dir(config4, base), `${id}.jsx`);
|
|
70818
70815
|
}
|
|
70819
|
-
function
|
|
70820
|
-
return path_exports.join(units_dir(config4, base), "render", "client.jsx");
|
|
70821
|
-
}
|
|
70822
|
-
function render_server_path(config4, base) {
|
|
70816
|
+
function server_adapter_path(config4, base) {
|
|
70823
70817
|
return path_exports.join(units_dir(config4, base), "render", "server.js");
|
|
70824
70818
|
}
|
|
70825
|
-
function
|
|
70826
|
-
return path_exports.join(units_dir(config4, base), "render", "
|
|
70827
|
-
}
|
|
70828
|
-
function render_app_path(config4, base) {
|
|
70829
|
-
return path_exports.join(units_dir(config4, base), "render", "App.jsx");
|
|
70819
|
+
function adapter_config_path(config4, base) {
|
|
70820
|
+
return path_exports.join(units_dir(config4, base), "render", "config.js");
|
|
70830
70821
|
}
|
|
70831
70822
|
function page_unit_path(config4, id, base) {
|
|
70832
70823
|
return path_exports.join(page_units_dir(config4, base), `${id}.jsx`);
|
|
@@ -70910,7 +70901,7 @@ function serialized_manifest_path(config4, base = base_dir(config4)) {
|
|
|
70910
70901
|
return path_exports.join(base, "manifest.json");
|
|
70911
70902
|
}
|
|
70912
70903
|
|
|
70913
|
-
// src/router/manifest.ts
|
|
70904
|
+
// src/lib/router/manifest.ts
|
|
70914
70905
|
var t2 = __toESM(require_lib6(), 1);
|
|
70915
70906
|
var graphql5 = __toESM(require("graphql"), 1);
|
|
70916
70907
|
async function load_manifest(args) {
|
|
@@ -71136,15 +71127,15 @@ async function extractQueries(source) {
|
|
|
71136
71127
|
return props.filter((p) => p !== "children");
|
|
71137
71128
|
}
|
|
71138
71129
|
|
|
71139
|
-
// src/router/server.ts
|
|
71130
|
+
// src/lib/router/server.ts
|
|
71140
71131
|
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
71141
|
-
|
|
71142
|
-
function isViteSchemaBuild() {
|
|
71132
|
+
function isSecondaryBuild() {
|
|
71143
71133
|
return process.env.HOUDINI_SCHEMA_BUILD === "true";
|
|
71144
71134
|
}
|
|
71145
71135
|
async function loadLocalSchema(config4) {
|
|
71136
|
+
const { build } = await import("vite");
|
|
71146
71137
|
process.env.HOUDINI_SCHEMA_BUILD = "true";
|
|
71147
|
-
await
|
|
71138
|
+
await build({
|
|
71148
71139
|
logLevel: "silent",
|
|
71149
71140
|
build: {
|
|
71150
71141
|
outDir: import_node_path2.default.join(config4.rootDir, "temp"),
|
|
@@ -72173,9 +72164,11 @@ function serializeValue(value) {
|
|
|
72173
72164
|
}
|
|
72174
72165
|
if (typeof value === "object" && value !== null) {
|
|
72175
72166
|
return AST4.objectExpression(
|
|
72176
|
-
Object.entries(value).filter(
|
|
72177
|
-
([key, value2]) =>
|
|
72178
|
-
)
|
|
72167
|
+
Object.entries(value).filter(
|
|
72168
|
+
([key, value2]) => typeof value2 !== "undefined" && key !== "prev" && key !== "next"
|
|
72169
|
+
).map(([key, val]) => {
|
|
72170
|
+
return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
|
|
72171
|
+
})
|
|
72179
72172
|
);
|
|
72180
72173
|
}
|
|
72181
72174
|
if (typeof value === "string") {
|
|
@@ -72722,7 +72715,7 @@ async function paginate(config4, documents) {
|
|
|
72722
72715
|
value: "__typename"
|
|
72723
72716
|
}
|
|
72724
72717
|
},
|
|
72725
|
-
...(typeConfig?.keys || [
|
|
72718
|
+
...(typeConfig?.keys || [config4.defaultKeys[0]]).map((key) => ({
|
|
72726
72719
|
kind: graphql11.Kind.FIELD,
|
|
72727
72720
|
name: {
|
|
72728
72721
|
kind: graphql11.Kind.NAME,
|
|
@@ -76406,7 +76399,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
76406
76399
|
if (missing.length > 0) {
|
|
76407
76400
|
ctx.reportError(
|
|
76408
76401
|
new graphql26.GraphQLError(
|
|
76409
|
-
|
|
76402
|
+
`The following arguments are missing from the "${fragmentName}" fragment: ` + JSON.stringify(missing)
|
|
76410
76403
|
)
|
|
76411
76404
|
);
|
|
76412
76405
|
return;
|
|
@@ -76642,7 +76635,7 @@ function nodeDirectives(config4, directives) {
|
|
|
76642
76635
|
}
|
|
76643
76636
|
if (!possibleNodes.includes(definitionType)) {
|
|
76644
76637
|
ctx.reportError(
|
|
76645
|
-
new graphql26.GraphQLError(paginateOnNonNodeMessage(
|
|
76638
|
+
new graphql26.GraphQLError(paginateOnNonNodeMessage(node.name.value))
|
|
76646
76639
|
);
|
|
76647
76640
|
}
|
|
76648
76641
|
}
|
|
@@ -76777,45 +76770,45 @@ function getAndVerifyNodeInterface(config4) {
|
|
|
76777
76770
|
return null;
|
|
76778
76771
|
}
|
|
76779
76772
|
if (!graphql26.isInterfaceType(nodeInterface)) {
|
|
76780
|
-
displayInvalidNodeFieldMessage(config4
|
|
76773
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76781
76774
|
return null;
|
|
76782
76775
|
}
|
|
76783
76776
|
const queryType = schema.getQueryType();
|
|
76784
76777
|
if (!queryType) {
|
|
76785
|
-
displayInvalidNodeFieldMessage(config4
|
|
76778
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76786
76779
|
return null;
|
|
76787
76780
|
}
|
|
76788
76781
|
const nodeField = queryType.getFields()["node"];
|
|
76789
76782
|
if (!nodeField) {
|
|
76790
|
-
displayInvalidNodeFieldMessage(config4
|
|
76783
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76791
76784
|
return null;
|
|
76792
76785
|
}
|
|
76793
76786
|
const args = nodeField.args;
|
|
76794
76787
|
if (args.length === 0) {
|
|
76795
|
-
displayInvalidNodeFieldMessage(config4
|
|
76788
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76796
76789
|
return null;
|
|
76797
76790
|
}
|
|
76798
|
-
const idArg = args.find((arg) => arg.name ===
|
|
76791
|
+
const idArg = args.find((arg) => arg.name === config4.defaultKeys[0]);
|
|
76799
76792
|
if (!idArg) {
|
|
76800
|
-
displayInvalidNodeFieldMessage(config4
|
|
76793
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76801
76794
|
return null;
|
|
76802
76795
|
}
|
|
76803
76796
|
const idType = unwrapType(config4, idArg.type);
|
|
76804
76797
|
if (idType.type.name !== "ID") {
|
|
76805
|
-
displayInvalidNodeFieldMessage(config4
|
|
76798
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76806
76799
|
return null;
|
|
76807
76800
|
}
|
|
76808
76801
|
const fieldReturnType = unwrapType(config4, nodeField.type);
|
|
76809
76802
|
if (fieldReturnType.type.name !== "Node") {
|
|
76810
|
-
displayInvalidNodeFieldMessage(config4
|
|
76803
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76811
76804
|
return null;
|
|
76812
76805
|
}
|
|
76813
76806
|
return nodeInterface;
|
|
76814
76807
|
}
|
|
76815
76808
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
76816
|
-
function displayInvalidNodeFieldMessage(
|
|
76809
|
+
function displayInvalidNodeFieldMessage(config4) {
|
|
76817
76810
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
76818
|
-
if (logLevel === LogLevel.Full) {
|
|
76811
|
+
if (config4.logLevel === LogLevel.Full) {
|
|
76819
76812
|
console.warn(invalidNodeFieldMessage);
|
|
76820
76813
|
} else {
|
|
76821
76814
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -76829,18 +76822,18 @@ var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interfa
|
|
|
76829
76822
|
If you are trying to provide the Node interface and its field, they must look like the following:
|
|
76830
76823
|
|
|
76831
76824
|
interface Node {
|
|
76832
|
-
|
|
76825
|
+
id: ID!
|
|
76833
76826
|
}
|
|
76834
76827
|
|
|
76835
76828
|
extend type Query {
|
|
76836
|
-
|
|
76829
|
+
node(id: ID!): Node
|
|
76837
76830
|
}
|
|
76838
76831
|
|
|
76839
76832
|
For more information, please visit these links:
|
|
76840
76833
|
- https://graphql.org/learn/global-object-identification/
|
|
76841
76834
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
76842
76835
|
`;
|
|
76843
|
-
var paginateOnNonNodeMessage = (
|
|
76836
|
+
var paginateOnNonNodeMessage = (directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
|
|
76844
76837
|
If this is happening inside of a fragment, make sure that the fragment either implements the Node interface or you
|
|
76845
76838
|
have defined a resolver entry for the fragment type.
|
|
76846
76839
|
|
|
@@ -77228,7 +77221,7 @@ function Plugin(opts = {}) {
|
|
|
77228
77221
|
}
|
|
77229
77222
|
},
|
|
77230
77223
|
async configResolved(conf) {
|
|
77231
|
-
if (!
|
|
77224
|
+
if (!isSecondaryBuild()) {
|
|
77232
77225
|
viteConfig = conf;
|
|
77233
77226
|
}
|
|
77234
77227
|
for (const plugin2 of config3.plugins) {
|
|
@@ -77239,7 +77232,7 @@ function Plugin(opts = {}) {
|
|
|
77239
77232
|
}
|
|
77240
77233
|
},
|
|
77241
77234
|
async closeBundle() {
|
|
77242
|
-
if (
|
|
77235
|
+
if (isSecondaryBuild() || viteEnv.mode !== "production") {
|
|
77243
77236
|
return;
|
|
77244
77237
|
}
|
|
77245
77238
|
for (const plugin2 of config3.plugins) {
|
|
@@ -77267,12 +77260,13 @@ function Plugin(opts = {}) {
|
|
|
77267
77260
|
sourceDir: viteConfig.build.outDir,
|
|
77268
77261
|
publicBase: viteConfig.base,
|
|
77269
77262
|
outDir: config3.routerBuildDirectory,
|
|
77270
|
-
manifest
|
|
77263
|
+
manifest,
|
|
77264
|
+
adapterPath: "../$houdini/plugins/houdini-react/units/render/config.js"
|
|
77271
77265
|
});
|
|
77272
77266
|
},
|
|
77273
77267
|
async buildStart(args) {
|
|
77274
|
-
if (viteEnv.mode === "production") {
|
|
77275
|
-
if (config3.localSchema
|
|
77268
|
+
if (viteEnv.mode === "production" && !isSecondaryBuild()) {
|
|
77269
|
+
if (config3.localSchema) {
|
|
77276
77270
|
config3.schema = await loadLocalSchema(config3);
|
|
77277
77271
|
}
|
|
77278
77272
|
try {
|
package/build/vite-esm/index.js
CHANGED
|
@@ -69508,7 +69508,7 @@ var LogLevel = {
|
|
|
69508
69508
|
};
|
|
69509
69509
|
|
|
69510
69510
|
// src/lib/config.ts
|
|
69511
|
-
var currentDir =
|
|
69511
|
+
var currentDir = dirname(fileURLToPath(import.meta.url));
|
|
69512
69512
|
var Config = class {
|
|
69513
69513
|
filepath;
|
|
69514
69514
|
rootDir;
|
|
@@ -70782,9 +70782,10 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
70782
70782
|
});
|
|
70783
70783
|
}
|
|
70784
70784
|
|
|
70785
|
-
// src/router/conventions.ts
|
|
70785
|
+
// src/lib/router/conventions.ts
|
|
70786
70786
|
var conventions_exports = {};
|
|
70787
70787
|
__export(conventions_exports, {
|
|
70788
|
+
adapter_config_path: () => adapter_config_path,
|
|
70788
70789
|
fallback_unit_path: () => fallback_unit_path,
|
|
70789
70790
|
is_layout: () => is_layout,
|
|
70790
70791
|
layout_unit_path: () => layout_unit_path,
|
|
@@ -70796,13 +70797,10 @@ __export(conventions_exports, {
|
|
|
70796
70797
|
read_layoutView: () => read_layoutView,
|
|
70797
70798
|
read_pageQuery: () => read_pageQuery,
|
|
70798
70799
|
read_pageView: () => read_pageView,
|
|
70799
|
-
render_app_path: () => render_app_path,
|
|
70800
|
-
render_client_path: () => render_client_path,
|
|
70801
|
-
render_server_path: () => render_server_path,
|
|
70802
|
-
render_yoga_path: () => render_yoga_path,
|
|
70803
70800
|
router_index_path: () => router_index_path,
|
|
70804
70801
|
router_path: () => router_path,
|
|
70805
|
-
serialized_manifest_path: () => serialized_manifest_path
|
|
70802
|
+
serialized_manifest_path: () => serialized_manifest_path,
|
|
70803
|
+
server_adapter_path: () => server_adapter_path
|
|
70806
70804
|
});
|
|
70807
70805
|
function router_path(config4) {
|
|
70808
70806
|
return path_exports.join(base_dir(config4), "Router.jsx");
|
|
@@ -70810,17 +70808,11 @@ function router_path(config4) {
|
|
|
70810
70808
|
function page_entry_path(config4, id, base) {
|
|
70811
70809
|
return path_exports.join(page_entries_dir(config4, base), `${id}.jsx`);
|
|
70812
70810
|
}
|
|
70813
|
-
function
|
|
70814
|
-
return path_exports.join(units_dir(config4, base), "render", "client.jsx");
|
|
70815
|
-
}
|
|
70816
|
-
function render_server_path(config4, base) {
|
|
70811
|
+
function server_adapter_path(config4, base) {
|
|
70817
70812
|
return path_exports.join(units_dir(config4, base), "render", "server.js");
|
|
70818
70813
|
}
|
|
70819
|
-
function
|
|
70820
|
-
return path_exports.join(units_dir(config4, base), "render", "
|
|
70821
|
-
}
|
|
70822
|
-
function render_app_path(config4, base) {
|
|
70823
|
-
return path_exports.join(units_dir(config4, base), "render", "App.jsx");
|
|
70814
|
+
function adapter_config_path(config4, base) {
|
|
70815
|
+
return path_exports.join(units_dir(config4, base), "render", "config.js");
|
|
70824
70816
|
}
|
|
70825
70817
|
function page_unit_path(config4, id, base) {
|
|
70826
70818
|
return path_exports.join(page_units_dir(config4, base), `${id}.jsx`);
|
|
@@ -70904,7 +70896,7 @@ function serialized_manifest_path(config4, base = base_dir(config4)) {
|
|
|
70904
70896
|
return path_exports.join(base, "manifest.json");
|
|
70905
70897
|
}
|
|
70906
70898
|
|
|
70907
|
-
// src/router/manifest.ts
|
|
70899
|
+
// src/lib/router/manifest.ts
|
|
70908
70900
|
var t2 = __toESM(require_lib6(), 1);
|
|
70909
70901
|
import * as graphql5 from "graphql";
|
|
70910
70902
|
async function load_manifest(args) {
|
|
@@ -71130,13 +71122,13 @@ async function extractQueries(source) {
|
|
|
71130
71122
|
return props.filter((p) => p !== "children");
|
|
71131
71123
|
}
|
|
71132
71124
|
|
|
71133
|
-
// src/router/server.ts
|
|
71125
|
+
// src/lib/router/server.ts
|
|
71134
71126
|
import path2 from "node:path";
|
|
71135
|
-
|
|
71136
|
-
function isViteSchemaBuild() {
|
|
71127
|
+
function isSecondaryBuild() {
|
|
71137
71128
|
return process.env.HOUDINI_SCHEMA_BUILD === "true";
|
|
71138
71129
|
}
|
|
71139
71130
|
async function loadLocalSchema(config4) {
|
|
71131
|
+
const { build } = await import("vite");
|
|
71140
71132
|
process.env.HOUDINI_SCHEMA_BUILD = "true";
|
|
71141
71133
|
await build({
|
|
71142
71134
|
logLevel: "silent",
|
|
@@ -72167,9 +72159,11 @@ function serializeValue(value) {
|
|
|
72167
72159
|
}
|
|
72168
72160
|
if (typeof value === "object" && value !== null) {
|
|
72169
72161
|
return AST4.objectExpression(
|
|
72170
|
-
Object.entries(value).filter(
|
|
72171
|
-
([key, value2]) =>
|
|
72172
|
-
)
|
|
72162
|
+
Object.entries(value).filter(
|
|
72163
|
+
([key, value2]) => typeof value2 !== "undefined" && key !== "prev" && key !== "next"
|
|
72164
|
+
).map(([key, val]) => {
|
|
72165
|
+
return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
|
|
72166
|
+
})
|
|
72173
72167
|
);
|
|
72174
72168
|
}
|
|
72175
72169
|
if (typeof value === "string") {
|
|
@@ -72716,7 +72710,7 @@ async function paginate(config4, documents) {
|
|
|
72716
72710
|
value: "__typename"
|
|
72717
72711
|
}
|
|
72718
72712
|
},
|
|
72719
|
-
...(typeConfig?.keys || [
|
|
72713
|
+
...(typeConfig?.keys || [config4.defaultKeys[0]]).map((key) => ({
|
|
72720
72714
|
kind: graphql11.Kind.FIELD,
|
|
72721
72715
|
name: {
|
|
72722
72716
|
kind: graphql11.Kind.NAME,
|
|
@@ -76400,7 +76394,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
76400
76394
|
if (missing.length > 0) {
|
|
76401
76395
|
ctx.reportError(
|
|
76402
76396
|
new graphql26.GraphQLError(
|
|
76403
|
-
|
|
76397
|
+
`The following arguments are missing from the "${fragmentName}" fragment: ` + JSON.stringify(missing)
|
|
76404
76398
|
)
|
|
76405
76399
|
);
|
|
76406
76400
|
return;
|
|
@@ -76636,7 +76630,7 @@ function nodeDirectives(config4, directives) {
|
|
|
76636
76630
|
}
|
|
76637
76631
|
if (!possibleNodes.includes(definitionType)) {
|
|
76638
76632
|
ctx.reportError(
|
|
76639
|
-
new graphql26.GraphQLError(paginateOnNonNodeMessage(
|
|
76633
|
+
new graphql26.GraphQLError(paginateOnNonNodeMessage(node.name.value))
|
|
76640
76634
|
);
|
|
76641
76635
|
}
|
|
76642
76636
|
}
|
|
@@ -76771,45 +76765,45 @@ function getAndVerifyNodeInterface(config4) {
|
|
|
76771
76765
|
return null;
|
|
76772
76766
|
}
|
|
76773
76767
|
if (!graphql26.isInterfaceType(nodeInterface)) {
|
|
76774
|
-
displayInvalidNodeFieldMessage(config4
|
|
76768
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76775
76769
|
return null;
|
|
76776
76770
|
}
|
|
76777
76771
|
const queryType = schema.getQueryType();
|
|
76778
76772
|
if (!queryType) {
|
|
76779
|
-
displayInvalidNodeFieldMessage(config4
|
|
76773
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76780
76774
|
return null;
|
|
76781
76775
|
}
|
|
76782
76776
|
const nodeField = queryType.getFields()["node"];
|
|
76783
76777
|
if (!nodeField) {
|
|
76784
|
-
displayInvalidNodeFieldMessage(config4
|
|
76778
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76785
76779
|
return null;
|
|
76786
76780
|
}
|
|
76787
76781
|
const args = nodeField.args;
|
|
76788
76782
|
if (args.length === 0) {
|
|
76789
|
-
displayInvalidNodeFieldMessage(config4
|
|
76783
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76790
76784
|
return null;
|
|
76791
76785
|
}
|
|
76792
|
-
const idArg = args.find((arg) => arg.name ===
|
|
76786
|
+
const idArg = args.find((arg) => arg.name === config4.defaultKeys[0]);
|
|
76793
76787
|
if (!idArg) {
|
|
76794
|
-
displayInvalidNodeFieldMessage(config4
|
|
76788
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76795
76789
|
return null;
|
|
76796
76790
|
}
|
|
76797
76791
|
const idType = unwrapType(config4, idArg.type);
|
|
76798
76792
|
if (idType.type.name !== "ID") {
|
|
76799
|
-
displayInvalidNodeFieldMessage(config4
|
|
76793
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76800
76794
|
return null;
|
|
76801
76795
|
}
|
|
76802
76796
|
const fieldReturnType = unwrapType(config4, nodeField.type);
|
|
76803
76797
|
if (fieldReturnType.type.name !== "Node") {
|
|
76804
|
-
displayInvalidNodeFieldMessage(config4
|
|
76798
|
+
displayInvalidNodeFieldMessage(config4);
|
|
76805
76799
|
return null;
|
|
76806
76800
|
}
|
|
76807
76801
|
return nodeInterface;
|
|
76808
76802
|
}
|
|
76809
76803
|
var nbInvalidNodeFieldMessageDisplayed = 0;
|
|
76810
|
-
function displayInvalidNodeFieldMessage(
|
|
76804
|
+
function displayInvalidNodeFieldMessage(config4) {
|
|
76811
76805
|
if (nbInvalidNodeFieldMessageDisplayed === 0) {
|
|
76812
|
-
if (logLevel === LogLevel.Full) {
|
|
76806
|
+
if (config4.logLevel === LogLevel.Full) {
|
|
76813
76807
|
console.warn(invalidNodeFieldMessage);
|
|
76814
76808
|
} else {
|
|
76815
76809
|
console.warn(invalidNodeFieldMessageLight);
|
|
@@ -76823,18 +76817,18 @@ var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interfa
|
|
|
76823
76817
|
If you are trying to provide the Node interface and its field, they must look like the following:
|
|
76824
76818
|
|
|
76825
76819
|
interface Node {
|
|
76826
|
-
|
|
76820
|
+
id: ID!
|
|
76827
76821
|
}
|
|
76828
76822
|
|
|
76829
76823
|
extend type Query {
|
|
76830
|
-
|
|
76824
|
+
node(id: ID!): Node
|
|
76831
76825
|
}
|
|
76832
76826
|
|
|
76833
76827
|
For more information, please visit these links:
|
|
76834
76828
|
- https://graphql.org/learn/global-object-identification/
|
|
76835
76829
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
76836
76830
|
`;
|
|
76837
|
-
var paginateOnNonNodeMessage = (
|
|
76831
|
+
var paginateOnNonNodeMessage = (directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
|
|
76838
76832
|
If this is happening inside of a fragment, make sure that the fragment either implements the Node interface or you
|
|
76839
76833
|
have defined a resolver entry for the fragment type.
|
|
76840
76834
|
|
|
@@ -77222,7 +77216,7 @@ function Plugin(opts = {}) {
|
|
|
77222
77216
|
}
|
|
77223
77217
|
},
|
|
77224
77218
|
async configResolved(conf) {
|
|
77225
|
-
if (!
|
|
77219
|
+
if (!isSecondaryBuild()) {
|
|
77226
77220
|
viteConfig = conf;
|
|
77227
77221
|
}
|
|
77228
77222
|
for (const plugin2 of config3.plugins) {
|
|
@@ -77233,7 +77227,7 @@ function Plugin(opts = {}) {
|
|
|
77233
77227
|
}
|
|
77234
77228
|
},
|
|
77235
77229
|
async closeBundle() {
|
|
77236
|
-
if (
|
|
77230
|
+
if (isSecondaryBuild() || viteEnv.mode !== "production") {
|
|
77237
77231
|
return;
|
|
77238
77232
|
}
|
|
77239
77233
|
for (const plugin2 of config3.plugins) {
|
|
@@ -77261,12 +77255,13 @@ function Plugin(opts = {}) {
|
|
|
77261
77255
|
sourceDir: viteConfig.build.outDir,
|
|
77262
77256
|
publicBase: viteConfig.base,
|
|
77263
77257
|
outDir: config3.routerBuildDirectory,
|
|
77264
|
-
manifest
|
|
77258
|
+
manifest,
|
|
77259
|
+
adapterPath: "../$houdini/plugins/houdini-react/units/render/config.js"
|
|
77265
77260
|
});
|
|
77266
77261
|
},
|
|
77267
77262
|
async buildStart(args) {
|
|
77268
|
-
if (viteEnv.mode === "production") {
|
|
77269
|
-
if (config3.localSchema
|
|
77263
|
+
if (viteEnv.mode === "production" && !isSecondaryBuild()) {
|
|
77264
|
+
if (config3.localSchema) {
|
|
77270
77265
|
config3.schema = await loadLocalSchema(config3);
|
|
77271
77266
|
}
|
|
77272
77267
|
try {
|