houdini 2.0.0-go.13 → 2.0.0-go.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/cmd/generate.js +4 -7
- package/build/cmd/init.js +2 -2
- package/build/lib/codegen.js +10 -0
- package/build/lib/database.d.ts +1 -1
- package/build/lib/database.js +79 -41
- package/build/lib/error.js +2 -1
- package/build/lib/plugins.js +1 -3
- package/build/package.json +1 -1
- package/build/runtime/cache/index.d.ts +8 -8
- package/build/runtime/cache/index.js +13 -13
- package/build/runtime/cache/lists.d.ts +2 -2
- package/build/runtime/cache/lists.js +2 -2
- package/build/runtime/cache/storage.d.ts +1 -1
- package/build/runtime/cache/storage.js +1 -1
- package/build/runtime/cache/subscription.d.ts +2 -2
- package/build/runtime/cache/subscription.js +3 -3
- package/build/runtime/client.d.ts +2 -2
- package/build/runtime/documentStore.d.ts +3 -3
- package/build/runtime/documentStore.js +4 -4
- package/build/runtime/flatten.d.ts +1 -1
- package/build/runtime/index.d.ts +12 -12
- package/build/runtime/index.js +12 -12
- package/build/runtime/pageInfo.d.ts +1 -1
- package/build/runtime/pageInfo.js +1 -1
- package/build/runtime/pagination.d.ts +2 -2
- package/build/runtime/pagination.js +3 -3
- package/build/runtime/scalars.d.ts +1 -1
- package/build/runtime/scalars.js +3 -3
- package/build/runtime/selection.d.ts +1 -1
- package/build/runtime/types.d.ts +1 -1
- package/build/runtime/types.js +1 -1
- package/build/vite/hmr.js +12 -15
- package/package.json +2 -2
package/build/cmd/generate.js
CHANGED
|
@@ -24,12 +24,7 @@ async function generate(args = {
|
|
|
24
24
|
try {
|
|
25
25
|
let config = await get_config();
|
|
26
26
|
const [db, dbFilepath] = await init_db(config, args.preserveDatabase);
|
|
27
|
-
const { trigger_hook, close } = await codegen_setup(
|
|
28
|
-
config,
|
|
29
|
-
mode,
|
|
30
|
-
db,
|
|
31
|
-
dbFilepath
|
|
32
|
-
);
|
|
27
|
+
const { trigger_hook, close } = await codegen_setup(config, mode, db, dbFilepath);
|
|
33
28
|
on_close = async () => {
|
|
34
29
|
try {
|
|
35
30
|
await close();
|
|
@@ -42,7 +37,9 @@ async function generate(args = {
|
|
|
42
37
|
process.on("SIGTERM", on_close);
|
|
43
38
|
if (args.afterPhase && !PIPELINE_HOOKS.includes(args.afterPhase)) {
|
|
44
39
|
throw new Error(
|
|
45
|
-
`Invalid --after-phase: ${args.afterPhase}. Valid phases are: ${PIPELINE_HOOKS.join(
|
|
40
|
+
`Invalid --after-phase: ${args.afterPhase}. Valid phases are: ${PIPELINE_HOOKS.join(
|
|
41
|
+
", "
|
|
42
|
+
)}`
|
|
46
43
|
);
|
|
47
44
|
}
|
|
48
45
|
if (args.beforePhase && !PIPELINE_HOOKS.includes(args.beforePhase)) {
|
package/build/cmd/init.js
CHANGED
|
@@ -420,12 +420,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
420
420
|
}
|
|
421
421
|
packageJSON2.devDependencies = {
|
|
422
422
|
...packageJSON2.devDependencies,
|
|
423
|
-
houdini: "^2.0.0-go.
|
|
423
|
+
houdini: "^2.0.0-go.14"
|
|
424
424
|
};
|
|
425
425
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
426
426
|
packageJSON2.devDependencies = {
|
|
427
427
|
...packageJSON2.devDependencies,
|
|
428
|
-
"houdini-svelte": "^2.0.0-go.
|
|
428
|
+
"houdini-svelte": "^2.0.0-go.15"
|
|
429
429
|
};
|
|
430
430
|
} else {
|
|
431
431
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
package/build/lib/codegen.js
CHANGED
|
@@ -315,6 +315,16 @@ async function run_pipeline(trigger_hook, options = {}) {
|
|
|
315
315
|
if (hook === "Validate" || hook === "GenerateDocuments") {
|
|
316
316
|
opts.parallel_safe = true;
|
|
317
317
|
}
|
|
318
|
+
if (hook === "GenerateDocuments" && i + 1 <= endIndex && PIPELINE_HOOKS[i + 1] === "GenerateRuntime") {
|
|
319
|
+
const [gdResult, grResult] = await Promise.all([
|
|
320
|
+
trigger_hook("GenerateDocuments", { task_id, parallel_safe: true }),
|
|
321
|
+
trigger_hook("GenerateRuntime", { task_id })
|
|
322
|
+
]);
|
|
323
|
+
results["GenerateDocuments"] = gdResult;
|
|
324
|
+
results["GenerateRuntime"] = grResult;
|
|
325
|
+
i++;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
318
328
|
results[hook] = await trigger_hook(hook, opts);
|
|
319
329
|
}
|
|
320
330
|
return results;
|
package/build/lib/database.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type sqlite from 'node:sqlite';
|
|
2
2
|
import type { PluginSpec } from './codegen.js';
|
|
3
3
|
import type { Config } from './config.js';
|
|
4
|
-
export declare const create_schema = "\nCREATE TABLE IF NOT EXISTS plugins (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n port INTEGER NOT NULL,\n hooks JSON NOT NULL,\n plugin_order TEXT NOT NULL CHECK (plugin_order IN ('before', 'after', 'core')),\n include_runtime TEXT,\n include_static_runtime TEXT,\n config JSON,\n\t config_module TEXT,\n\t\tclient_plugins JSON\n);\n\n-- Watch Schema Config\nCREATE TABLE IF NOT EXISTS watch_schema_config (\n url TEXT NOT NULL,\n headers JSON,\n interval INTEGER,\n timeout INTEGER\n);\n\n-- Router Config\nCREATE TABLE IF NOT EXISTS router_config (\n api_endpoint TEXT,\n redirect TEXT UNIQUE,\n session_keys TEXT NOT NULL UNIQUE,\n url TEXT,\n mutation TEXT UNIQUE\n);\n\n-- Runtime Scalar Definition\nCREATE TABLE IF NOT EXISTS runtime_scalar_definitions (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n type TEXT NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS component_fields (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tdocument INTEGER NOT NULL,\n type TEXT,\n\tprop TEXT,\n field TEXT,\n\tinline BOOLEAN default false,\n type_field TEXT,\n fragment TEXT,\n\tUNIQUE (document),\n\tFOREIGN KEY (document) REFERENCES raw_documents(id) ON DELETE CASCADE\n);\n\n-- Static Config (main config table)\nCREATE TABLE IF NOT EXISTS config (\n include JSON NOT NULL,\n exclude JSON NOT NULL,\n schema_path TEXT NOT NULL,\n definitions_path TEXT,\n cache_buffer_size INTEGER,\n default_cache_policy TEXT,\n default_partial BOOLEAN,\n default_lifetime INTEGER,\n default_list_position TEXT CHECK (default_list_position IN ('APPEND', 'PREPEND')),\n default_list_target TEXT CHECK (default_list_target IN ('ALL', 'NULL')),\n default_paginate_mode TEXT CHECK (default_paginate_mode IN ('Infinite', 'SinglePage')),\n suppress_pagination_deduplication BOOLEAN,\n log_level TEXT CHECK (log_level IN ('QUIET', 'FULL', 'SUMMARY', 'SHORT_SUMMARY')),\n default_fragment_masking BOOLEAN,\n default_keys JSON,\n persisted_queries_path TEXT NOT NULL,\n project_root TEXT,\n runtime_dir TEXT,\n\t\tpath TEXT\n);\n\nCREATE TABLE IF NOT EXISTS scalar_config (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n type TEXT NOT NULL,\n\tinput_types JSON\n);\n\n-- Types configuration\nCREATE TABLE IF NOT EXISTS type_configs (\n name TEXT NOT NULL,\n keys JSON NOT NULL,\n\tresolve_query TEXT\n);\n\n-- A table of original document contents (to be populated by plugins)\nCREATE TABLE IF NOT EXISTS raw_documents (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n offset_line INTEGER,\n offset_column INTEGER,\n filepath TEXT NOT NULL,\n content TEXT NOT NULL,\n current_task TEXT,\n loaded_with TEXT\n);\n\n-----------------------------------------------------------\n-- Schema Definition Tables\n-----------------------------------------------------------\n\nCREATE TABLE IF NOT EXISTS types (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n kind TEXT NOT NULL CHECK (kind IN ('OBJECT', 'INTERFACE', 'UNION', 'ENUM', 'SCALAR', 'INPUT')),\n operation TEXT,\n\tdescription TEXT,\n\tinternal BOOLEAN default false,\n\tbuilt_in BOOLEAN default false\n);\n\nCREATE TABLE IF NOT EXISTS type_fields (\n id TEXT PRIMARY KEY, -- will be something like User.name so we don't have to look up the generated id\n parent TEXT NOT NULL, -- will be User\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n\t type_modifiers TEXT,\n default_value TEXT,\n description TEXT,\n\t internal BOOLEAN default false,\n document INT,\n\n FOREIGN KEY (document) REFERENCES raw_documents(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (type) REFERENCES types(name) ON DELETE CASCADE,\n UNIQUE (parent, name)\n);\n\nCREATE TABLE IF NOT EXISTS type_field_arguments (\n id TEXT PRIMARY KEY,\n field TEXT NOT NULL,\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n type_modifiers TEXT,\n FOREIGN KEY (field) REFERENCES type_fields(id) ON DELETE CASCADE,\n UNIQUE (field, name)\n);\n\n\nCREATE TABLE IF NOT EXISTS enum_values (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent TEXT NOT NULL,\n value TEXT NOT NULL,\n description TEXT,\n FOREIGN KEY (parent) REFERENCES types(name) ON DELETE CASCADE,\n UNIQUE (parent, value)\n);\n\nCREATE TABLE IF NOT EXISTS possible_types (\n type TEXT NOT NULL,\n member TEXT NOT NULL,\n FOREIGN KEY (type) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (member) REFERENCES types(name) ON DELETE CASCADE,\n PRIMARY KEY (type, member)\n);\n\nCREATE TABLE IF NOT EXISTS directives (\n name TEXT NOT NULL UNIQUE PRIMARY KEY,\n\tinternal BOOLEAN default false,\n visible BOOLEAN default true,\n repeatable BOOLEAN default false,\n\tdescription TEXT\n);\n\nCREATE TABLE IF NOT EXISTS directive_arguments (\n parent TEXT NOT NULL,\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n\ttype_modifiers TEXT,\n default_value TEXT,\n FOREIGN KEY (parent) REFERENCES directives(name),\n PRIMARY KEY (parent, name),\n UNIQUE (parent, name)\n);\n\nCREATE TABLE IF NOT EXISTS directive_locations (\n directive TEXT NOT NULL,\n location TEXT NOT NULL CHECK (location IN ('QUERY', 'MUTATION', 'SUBSCRIPTION', 'FIELD', 'FRAGMENT_DEFINITION', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT', 'SCHEMA', 'SCALAR', 'OBJECT', 'FIELD_DEFINITION', 'ARGUMENT_DEFINITION', 'INTERFACE', 'UNION', 'ENUM', 'ENUM_VALUE', 'INPUT_OBJECT', 'INPUT_FIELD_DEFINITION')),\n FOREIGN KEY (directive) REFERENCES directives(name),\n PRIMARY KEY (directive, location)\n);\n\nCREATE TABLE IF NOT EXISTS document_variable_directives (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tparent INTEGER NOT NULL,\n\tdirective TEXT NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n\tFOREIGN KEY (parent) REFERENCES document_variables(id) ON DELETE CASCADE,\n\tFOREIGN KEY (directive) REFERENCES directives(name) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_variable_directive_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES document_variable_directives(id) ON DELETE CASCADE\n);\n\n-----------------------------------------------------------\n-- Document Tables\n-----------------------------------------------------------\n\nCREATE TABLE IF NOT EXISTS document_variables (\n \tid INTEGER PRIMARY KEY AUTOINCREMENT,\n document TEXT NOT NULL,\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n type_modifiers TEXT,\n default_value INT,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n\n FOREIGN KEY (default_value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n UNIQUE (document, name)\n);\n\n-- this is pulled out separately from operations and fragments so foreign keys can be used\nCREATE TABLE IF NOT EXISTS documents (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT NOT NULL,\n kind TEXT NOT NULL CHECK (kind IN ('query', 'mutation', 'subscription', 'fragment')),\n raw_document INTEGER,\n type_condition TEXT,\n hash TEXT,\n printed TEXT,\n\t\tinternal boolean default false,\n\t\tvisible boolean default true,\n\t\tprocessed boolean default false,\n FOREIGN KEY (type_condition) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (raw_document) REFERENCES raw_documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selections (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n field_name TEXT NOT NULL,\n\tkind TEXT NOT NULL CHECK (kind IN ('field', 'fragment', 'inline_fragment')),\n alias TEXT,\n type TEXT, -- should be something like User.Avatar\n fragment_ref TEXT, -- used when fragment arguments cause a hash to be inlined (removing the ability to track what the original fragment is)\n\t\tfragment_args JSON -- used to store the arguments that are used when fragment variables are expanded\n);\n\nCREATE TABLE IF NOT EXISTS selection_directives (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n selection_id INTEGER NOT NULL,\n directive TEXT NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n FOREIGN KEY (selection_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (directive) REFERENCES directives(name) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selection_directive_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n document INTEGER NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES selection_directives(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_directives (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tdocument int NOT NULL,\n\tdirective TEXT NOT NULL,\n\trow INTEGER NOT NULL,\n\tcolumn INTEGER NOT NULL,\n\tFOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n\tFOREIGN KEY (directive) REFERENCES directives(name) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_directive_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES document_directives(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selection_refs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent_id INTEGER,\n child_id INTEGER NOT NULL,\n path_index INTEGER NOT NULL,\n document INTEGER NOT NULL,\n\trow INTEGER NOT NULL,\n\tcolumn INTEGER NOT NULL,\n\tinternal BOOLEAN NOT NULL DEFAULT false,\n FOREIGN KEY (parent_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (child_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selection_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n selection_id INTEGER NOT NULL,\n document INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n field_argument TEXT NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (selection_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\n\nCREATE TABLE IF NOT EXISTS argument_values (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n kind TEXT NOT NULL CHECK (kind IN ('Variable', 'Int', 'Float', 'String', 'Block', 'Boolean', 'Null', 'Enum', 'List', 'Object')),\n raw TEXT NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n expected_type TEXT NOT NULL,\n expected_type_modifiers TEXT,\n document INTEGER NOT NULL,\n\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS argument_value_children (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT,\n parent INTEGER NOT NULL,\n value INTEGER NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n document INTEGER NOT NULL,\n\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS discovered_lists (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT,\n node_type TEXT NOT NULL,\n edge_type TEXT,\n connection_type TEXT NOT NULL,\n node INTEGER NOT NULL,\n page_size INTEGER NOT NULL,\n document INTEGER NOT NULL,\n mode TEXT NOT NULL,\n embedded BOOLEAN NOT NULL,\n target_type TEXT NOT NULL,\n connection BOOLEAN default false,\n list_field INTEGER NOT NULL,\n paginate TEXT,\n supports_forward BOOLEAN default false,\n supports_backward BOOLEAN default false,\n cursor_type TEXT,\n\n FOREIGN KEY (list_field) REFERENCES selections(id) ON DELETE CASCADE,\n\t FOREIGN KEY (node) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (node_type) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_dependencies (\n document INTEGER NOT NULL,\n depends_on TEXT NOT NULL,\n\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n UNIQUE (document, depends_on)\n);\n\n-----------------------------------------------------------\n-- Indices\n-----------------------------------------------------------\n\nCREATE INDEX IF NOT EXISTS idx_component_fields_type_fields ON component_fields(type_field);\nCREATE INDEX IF NOT EXISTS idx_discovered_lists_document ON discovered_lists(document);\nCREATE INDEX IF NOT EXISTS idx_discovered_lists_node ON discovered_lists(node);\nCREATE INDEX IF NOT EXISTS idx_discovered_lists_list_field ON discovered_lists(list_field);\nCREATE INDEX IF NOT EXISTS idx_discovered_lists_connection ON discovered_lists(connection);\nCREATE INDEX IF NOT EXISTS idx_document_directive_arguments_value on document_directive_arguments(value);\nCREATE INDEX IF NOT EXISTS idx_type_field_arguments_id ON type_field_arguments(id);\nCREATE INDEX IF NOT EXISTS idx_type_fields_id ON type_fields(id);\nCREATE INDEX IF NOT EXISTS idx_types_kind_operation ON types(kind, operation);\nCREATE INDEX IF NOT EXISTS idx_documents_kind ON documents(kind);\nCREATE INDEX IF NOT EXISTS idx_documents_type_condition ON documents(type_condition);\nCREATE INDEX IF NOT EXISTS idx_raw_documents_current_task ON raw_documents(current_task);\nCREATE INDEX IF NOT EXISTS idx_documents_raw_document ON documents(raw_document);\nCREATE INDEX IF NOT EXISTS idx_selection_refs_parent_id ON selection_refs(parent_id);\nCREATE INDEX IF NOT EXISTS idx_selection_refs_child_id ON selection_refs(child_id);\nCREATE INDEX IF NOT EXISTS idx_selection_refs_document ON selection_refs(document);\n-- Composite index for common query patterns in CollectDocuments\nCREATE INDEX IF NOT EXISTS idx_selection_refs_document_parent_id ON selection_refs(document, parent_id);\nCREATE INDEX IF NOT EXISTS idx_document_variable_directives_parent ON document_variable_directives(parent);\nCREATE INDEX IF NOT EXISTS idx_document_variable_directives_directive ON document_variable_directives(directive);\nCREATE INDEX IF NOT EXISTS idx_document_variable_directive_arguments_parent ON document_variable_directive_arguments(parent);\nCREATE INDEX IF NOT EXISTS idx_selections_type ON selections(type);\nCREATE INDEX IF NOT EXISTS idx_document_directives_document ON document_directives(document);\nCREATE INDEX IF NOT EXISTS idx_document_directives_directive ON document_directives(directive);\nCREATE INDEX IF NOT EXISTS idx_document_directive_arguments_parent ON document_directive_arguments(parent);\nCREATE INDEX IF NOT EXISTS idx_document_directive_arguments_parent_name ON document_directive_arguments(parent, name);\nCREATE INDEX IF NOT EXISTS idx_type_fields_parent ON type_fields(parent);\nCREATE INDEX IF NOT EXISTS idx_selections_alias ON selections(alias);\nCREATE INDEX IF NOT EXISTS idx_selection_directives_selection ON selection_directives(selection_id);\nCREATE INDEX IF NOT EXISTS idx_selection_arguments_selection ON selection_arguments(selection_id);\nCREATE INDEX IF NOT EXISTS idx_selection_directive_args_parent ON selection_directive_arguments(parent);\nCREATE INDEX IF NOT EXISTS idx_possible_types_type ON possible_types(type);\nCREATE INDEX IF NOT EXISTS idx_possible_types_member ON possible_types(member);\nCREATE INDEX IF NOT EXISTS idx_enum_values_parent ON enum_values(parent);\nCREATE INDEX IF NOT EXISTS idx_type_fields_name ON type_fields(name);\nCREATE INDEX IF NOT EXISTS idx_type_configs_name ON type_configs(name);\nCREATE INDEX IF NOT EXISTS idx_argument_value_children_parent ON argument_value_children(parent);\nCREATE INDEX IF NOT EXISTS idx_argument_values_kind_raw ON argument_values(kind, raw);\nCREATE INDEX IF NOT EXISTS idx_document_variables_document_name ON document_variables(document, name);\nCREATE INDEX IF NOT EXISTS idx_selection_arguments_value ON selection_arguments(value);\nCREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_parent_name ON selection_directive_arguments(parent, name);\nCREATE INDEX IF NOT EXISTS idx_selection_directives_directive ON selection_directives(directive);\nCREATE INDEX IF NOT EXISTS idx_argument_values_document ON argument_values(document);\nCREATE INDEX IF NOT EXISTS idx_types_name ON types(name);\nCREATE INDEX IF NOT EXISTS idx_enum_values_parent_value ON enum_values(parent, value);\nCREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_value ON selection_directive_arguments(value);\nCREATE INDEX IF NOT EXISTS idx_argument_value_children_value ON argument_value_children(value);\nCREATE INDEX IF NOT EXISTS idx_document_dependency_document on document_dependencies(document);\nCREATE INDEX IF NOT EXISTS idx_document_dependency_depends_on on document_dependencies(depends_on);\n-- Performance optimization: composite index for argument_values joins with documents\nCREATE INDEX IF NOT EXISTS idx_argument_values_document_id ON argument_values(document, id);\n-- Additional performance optimizations for the recursive CTE query\nCREATE INDEX IF NOT EXISTS idx_argument_value_children_parent_value ON argument_value_children(parent, value);\n-- Complex query optimizations based on query analysis\nCREATE INDEX IF NOT EXISTS idx_selections_field_name_kind ON selections(field_name, kind);\nCREATE INDEX IF NOT EXISTS idx_documents_name_kind ON documents(name, kind);\nCREATE INDEX IF NOT EXISTS idx_document_variables_document_id ON document_variables(document, id);\nCREATE INDEX IF NOT EXISTS idx_argument_values_expected_type_document ON argument_values(expected_type, document);\nCREATE INDEX IF NOT EXISTS idx_document_variables_document_type_modifiers_default ON document_variables(document, type_modifiers, default_value);\n";
|
|
4
|
+
export declare const create_schema = "\nCREATE TABLE IF NOT EXISTS plugins (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n port INTEGER NOT NULL,\n hooks JSON NOT NULL,\n plugin_order TEXT NOT NULL CHECK (plugin_order IN ('before', 'after', 'core')),\n include_runtime TEXT,\n include_static_runtime TEXT,\n config JSON,\n\t config_module TEXT,\n\t\tclient_plugins JSON\n);\n\n-- Watch Schema Config\nCREATE TABLE IF NOT EXISTS watch_schema_config (\n url TEXT NOT NULL,\n headers JSON,\n interval INTEGER,\n timeout INTEGER\n);\n\n-- Router Config\nCREATE TABLE IF NOT EXISTS router_config (\n api_endpoint TEXT,\n redirect TEXT UNIQUE,\n session_keys TEXT NOT NULL UNIQUE,\n url TEXT,\n mutation TEXT UNIQUE\n);\n\n-- Runtime Scalar Definition\nCREATE TABLE IF NOT EXISTS runtime_scalar_definitions (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n type TEXT NOT NULL\n);\n\nCREATE TABLE IF NOT EXISTS component_fields (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tdocument INTEGER NOT NULL,\n type TEXT,\n\tprop TEXT,\n field TEXT,\n\tinline BOOLEAN default false,\n type_field TEXT,\n fragment TEXT,\n\tUNIQUE (document),\n\tFOREIGN KEY (document) REFERENCES raw_documents(id) ON DELETE CASCADE\n);\n\n-- Static Config (main config table)\nCREATE TABLE IF NOT EXISTS config (\n include JSON NOT NULL,\n exclude JSON NOT NULL,\n schema_path TEXT NOT NULL,\n definitions_path TEXT,\n cache_buffer_size INTEGER,\n default_cache_policy TEXT,\n default_partial BOOLEAN,\n default_lifetime INTEGER,\n default_list_position TEXT CHECK (default_list_position IN ('APPEND', 'PREPEND')),\n default_list_target TEXT CHECK (default_list_target IN ('ALL', 'NULL')),\n default_paginate_mode TEXT CHECK (default_paginate_mode IN ('Infinite', 'SinglePage')),\n suppress_pagination_deduplication BOOLEAN,\n log_level TEXT CHECK (log_level IN ('QUIET', 'FULL', 'SUMMARY', 'SHORT_SUMMARY')),\n default_fragment_masking BOOLEAN,\n default_keys JSON,\n persisted_queries_path TEXT NOT NULL,\n project_root TEXT,\n runtime_dir TEXT,\n\t\tpath TEXT\n);\n\nCREATE TABLE IF NOT EXISTS scalar_config (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n type TEXT NOT NULL,\n\tinput_types JSON\n);\n\n-- Types configuration\nCREATE TABLE IF NOT EXISTS type_configs (\n name TEXT NOT NULL,\n keys JSON NOT NULL,\n\tresolve_query TEXT\n);\n\n-- A table of original document contents (to be populated by plugins)\nCREATE TABLE IF NOT EXISTS raw_documents (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n offset_line INTEGER,\n offset_column INTEGER,\n filepath TEXT NOT NULL,\n content TEXT NOT NULL,\n current_task TEXT,\n loaded_with TEXT\n);\n\n-----------------------------------------------------------\n-- Schema Definition Tables\n-----------------------------------------------------------\n\nCREATE TABLE IF NOT EXISTS types (\n name TEXT NOT NULL PRIMARY KEY UNIQUE,\n kind TEXT NOT NULL CHECK (kind IN ('OBJECT', 'INTERFACE', 'UNION', 'ENUM', 'SCALAR', 'INPUT')),\n operation TEXT,\n\tdescription TEXT,\n\tinternal BOOLEAN default false,\n\tbuilt_in BOOLEAN default false\n);\n\nCREATE TABLE IF NOT EXISTS type_fields (\n id TEXT PRIMARY KEY, -- will be something like User.name so we don't have to look up the generated id\n parent TEXT NOT NULL, -- will be User\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n\t type_modifiers TEXT,\n default_value TEXT,\n description TEXT,\n\t internal BOOLEAN default false,\n document INT,\n\n FOREIGN KEY (document) REFERENCES raw_documents(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (type) REFERENCES types(name) ON DELETE CASCADE,\n UNIQUE (parent, name)\n);\n\nCREATE TABLE IF NOT EXISTS type_field_arguments (\n id TEXT PRIMARY KEY,\n field TEXT NOT NULL,\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n type_modifiers TEXT,\n FOREIGN KEY (field) REFERENCES type_fields(id) ON DELETE CASCADE,\n UNIQUE (field, name)\n);\n\n\nCREATE TABLE IF NOT EXISTS enum_values (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent TEXT NOT NULL,\n value TEXT NOT NULL,\n description TEXT,\n FOREIGN KEY (parent) REFERENCES types(name) ON DELETE CASCADE,\n UNIQUE (parent, value)\n);\n\nCREATE TABLE IF NOT EXISTS possible_types (\n type TEXT NOT NULL,\n member TEXT NOT NULL,\n FOREIGN KEY (type) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (member) REFERENCES types(name) ON DELETE CASCADE,\n PRIMARY KEY (type, member)\n);\n\nCREATE TABLE IF NOT EXISTS directives (\n name TEXT NOT NULL UNIQUE PRIMARY KEY,\n\tinternal BOOLEAN default false,\n visible BOOLEAN default true,\n repeatable BOOLEAN default false,\n\tdescription TEXT\n);\n\nCREATE TABLE IF NOT EXISTS directive_arguments (\n parent TEXT NOT NULL,\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n\ttype_modifiers TEXT,\n default_value TEXT,\n FOREIGN KEY (parent) REFERENCES directives(name),\n PRIMARY KEY (parent, name),\n UNIQUE (parent, name)\n);\n\nCREATE TABLE IF NOT EXISTS directive_locations (\n directive TEXT NOT NULL,\n location TEXT NOT NULL CHECK (location IN ('QUERY', 'MUTATION', 'SUBSCRIPTION', 'FIELD', 'FRAGMENT_DEFINITION', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT', 'SCHEMA', 'SCALAR', 'OBJECT', 'FIELD_DEFINITION', 'ARGUMENT_DEFINITION', 'INTERFACE', 'UNION', 'ENUM', 'ENUM_VALUE', 'INPUT_OBJECT', 'INPUT_FIELD_DEFINITION')),\n FOREIGN KEY (directive) REFERENCES directives(name),\n PRIMARY KEY (directive, location)\n);\n\nCREATE TABLE IF NOT EXISTS document_variable_directives (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tparent INTEGER NOT NULL,\n\tdirective TEXT NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n\tFOREIGN KEY (parent) REFERENCES document_variables(id) ON DELETE CASCADE,\n\tFOREIGN KEY (directive) REFERENCES directives(name) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_variable_directive_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES document_variable_directives(id) ON DELETE CASCADE\n);\n\n-----------------------------------------------------------\n-- Document Tables\n-----------------------------------------------------------\n\nCREATE TABLE IF NOT EXISTS document_variables (\n \tid INTEGER PRIMARY KEY AUTOINCREMENT,\n document TEXT NOT NULL,\n name TEXT NOT NULL,\n type TEXT NOT NULL,\n type_modifiers TEXT,\n default_value INT,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n\n FOREIGN KEY (default_value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n UNIQUE (document, name)\n);\n\n-- this is pulled out separately from operations and fragments so foreign keys can be used\nCREATE TABLE IF NOT EXISTS documents (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT NOT NULL,\n kind TEXT NOT NULL CHECK (kind IN ('query', 'mutation', 'subscription', 'fragment')),\n raw_document INTEGER,\n type_condition TEXT,\n hash TEXT,\n printed TEXT,\n\t\tinternal boolean default false,\n\t\tvisible boolean default true,\n\t\tprocessed boolean default false,\n FOREIGN KEY (type_condition) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (raw_document) REFERENCES raw_documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selections (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n field_name TEXT NOT NULL,\n\tkind TEXT NOT NULL CHECK (kind IN ('field', 'fragment', 'inline_fragment')),\n alias TEXT,\n type TEXT, -- should be something like User.Avatar\n fragment_ref TEXT, -- used when fragment arguments cause a hash to be inlined (removing the ability to track what the original fragment is)\n\t\tfragment_args JSON -- used to store the arguments that are used when fragment variables are expanded\n);\n\nCREATE TABLE IF NOT EXISTS selection_directives (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n selection_id INTEGER NOT NULL,\n directive TEXT NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n FOREIGN KEY (selection_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (directive) REFERENCES directives(name) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selection_directive_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n document INTEGER NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES selection_directives(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_directives (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tdocument int NOT NULL,\n\tdirective TEXT NOT NULL,\n\trow INTEGER NOT NULL,\n\tcolumn INTEGER NOT NULL,\n\tFOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n\tFOREIGN KEY (directive) REFERENCES directives(name) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_directive_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES document_directives(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selection_refs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parent_id INTEGER,\n child_id INTEGER NOT NULL,\n path_index INTEGER NOT NULL,\n document INTEGER NOT NULL,\n\trow INTEGER NOT NULL,\n\tcolumn INTEGER NOT NULL,\n\tinternal BOOLEAN NOT NULL DEFAULT false,\n FOREIGN KEY (parent_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (child_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS selection_arguments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n selection_id INTEGER NOT NULL,\n document INTEGER NOT NULL,\n name TEXT NOT NULL,\n value INTEGER NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n field_argument TEXT NOT NULL,\n\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (selection_id) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\n\nCREATE TABLE IF NOT EXISTS argument_values (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n kind TEXT NOT NULL CHECK (kind IN ('Variable', 'Int', 'Float', 'String', 'Block', 'Boolean', 'Null', 'Enum', 'List', 'Object')),\n raw TEXT NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n expected_type TEXT NOT NULL,\n expected_type_modifiers TEXT,\n document INTEGER NOT NULL,\n\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS argument_value_children (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT,\n parent INTEGER NOT NULL,\n value INTEGER NOT NULL,\n row INTEGER NOT NULL,\n column INTEGER NOT NULL,\n document INTEGER NOT NULL,\n\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n FOREIGN KEY (parent) REFERENCES argument_values(id) ON DELETE CASCADE,\n FOREIGN KEY (value) REFERENCES argument_values(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS discovered_lists (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT,\n node_type TEXT NOT NULL,\n edge_type TEXT,\n connection_type TEXT NOT NULL,\n node INTEGER NOT NULL,\n page_size INTEGER NOT NULL,\n document INTEGER NOT NULL,\n mode TEXT NOT NULL,\n embedded BOOLEAN NOT NULL,\n target_type TEXT NOT NULL,\n connection BOOLEAN default false,\n list_field INTEGER NOT NULL,\n paginate TEXT,\n supports_forward BOOLEAN default false,\n supports_backward BOOLEAN default false,\n cursor_type TEXT,\n\n FOREIGN KEY (list_field) REFERENCES selections(id) ON DELETE CASCADE,\n\t FOREIGN KEY (node) REFERENCES selections(id) ON DELETE CASCADE,\n FOREIGN KEY (node_type) REFERENCES types(name) ON DELETE CASCADE,\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE\n);\n\nCREATE TABLE IF NOT EXISTS document_dependencies (\n document INTEGER NOT NULL,\n depends_on TEXT NOT NULL,\n\n FOREIGN KEY (document) REFERENCES documents(id) ON DELETE CASCADE,\n UNIQUE (document, depends_on)\n);\n\n-----------------------------------------------------------\n-- Indices\n-----------------------------------------------------------\n\n-- component_fields\nCREATE INDEX IF NOT EXISTS idx_component_fields_type_fields ON component_fields(type_field);\n\n-- discovered_lists\nCREATE INDEX IF NOT EXISTS idx_discovered_lists_document ON discovered_lists(document);\nCREATE INDEX IF NOT EXISTS idx_discovered_lists_node ON discovered_lists(node);\nCREATE INDEX IF NOT EXISTS idx_discovered_lists_list_field ON discovered_lists(list_field);\n-- note: no index on discovered_lists(connection) \u2014 boolean column, ~2 distinct values\n\n-- types\nCREATE INDEX IF NOT EXISTS idx_types_kind_operation ON types(kind, operation);\n-- note: no index on types(name) \u2014 covered by PRIMARY KEY UNIQUE\n\n-- documents\nCREATE INDEX IF NOT EXISTS idx_documents_kind ON documents(kind);\nCREATE INDEX IF NOT EXISTS idx_documents_type_condition ON documents(type_condition);\nCREATE INDEX IF NOT EXISTS idx_documents_raw_document ON documents(raw_document);\nCREATE INDEX IF NOT EXISTS idx_documents_name_kind ON documents(name, kind);\n\n-- raw_documents\nCREATE INDEX IF NOT EXISTS idx_raw_documents_current_task ON raw_documents(current_task);\n\n-- selections\nCREATE INDEX IF NOT EXISTS idx_selections_type ON selections(type);\nCREATE INDEX IF NOT EXISTS idx_selections_alias ON selections(alias);\nCREATE INDEX IF NOT EXISTS idx_selections_field_name_kind ON selections(field_name, kind);\n\n-- selection_refs: composite covers document-only lookups, so no separate single-column index needed\nCREATE INDEX IF NOT EXISTS idx_selection_refs_parent_id ON selection_refs(parent_id);\n\nCREATE INDEX IF NOT EXISTS idx_selection_refs_child_id ON selection_refs(child_id);\nCREATE INDEX IF NOT EXISTS idx_selection_refs_document_parent_id ON selection_refs(document, parent_id);\n\n-- selection_directives / selection_directive_arguments / selection_arguments\nCREATE INDEX IF NOT EXISTS idx_selection_directives_selection ON selection_directives(selection_id);\nCREATE INDEX IF NOT EXISTS idx_selection_directives_directive ON selection_directives(directive);\nCREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_parent_name ON selection_directive_arguments(parent, name);\n-- note: no index on selection_directive_arguments(parent) alone \u2014 covered by (parent,name) composite\nCREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_value ON selection_directive_arguments(value);\n-- document FK on selection_directive_arguments and selection_arguments: used in WHERE/JOIN in CollectDocuments\nCREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_document ON selection_directive_arguments(document);\nCREATE INDEX IF NOT EXISTS idx_selection_arguments_document ON selection_arguments(document);\nCREATE INDEX IF NOT EXISTS idx_selection_arguments_selection ON selection_arguments(selection_id);\nCREATE INDEX IF NOT EXISTS idx_selection_arguments_value ON selection_arguments(value);\n\n-- type_fields / type_field_arguments\n-- note: no index on type_fields(id) or type_field_arguments(id) \u2014 covered by their TEXT PRIMARY KEYs\nCREATE INDEX IF NOT EXISTS idx_type_fields_parent ON type_fields(parent);\nCREATE INDEX IF NOT EXISTS idx_type_fields_name ON type_fields(name);\nCREATE INDEX IF NOT EXISTS idx_type_configs_name ON type_configs(name);\n\n-- possible_types\n-- note: no index on possible_types(type) \u2014 covered by PRIMARY KEY(type,member) leading column\nCREATE INDEX IF NOT EXISTS idx_possible_types_member ON possible_types(member);\n\n-- type_fields: type and document FK columns have no implicit index\nCREATE INDEX IF NOT EXISTS idx_type_fields_type ON type_fields(type);\nCREATE INDEX IF NOT EXISTS idx_type_fields_document ON type_fields(document);\n\n-- enum_values\n-- note: no index on enum_values(parent) or (parent,value) \u2014 both covered by UNIQUE(parent,value)\n\n-- document_directives / document_directive_arguments\nCREATE INDEX IF NOT EXISTS idx_document_directives_document ON document_directives(document);\nCREATE INDEX IF NOT EXISTS idx_document_directives_directive ON document_directives(directive);\nCREATE INDEX IF NOT EXISTS idx_document_directive_arguments_parent_name ON document_directive_arguments(parent, name);\n-- note: no index on document_directive_arguments(parent) alone \u2014 covered by (parent,name) composite\nCREATE INDEX IF NOT EXISTS idx_document_directive_arguments_value on document_directive_arguments(value);\n\n-- document_variables\n-- note: no index on document_variables(document,name) \u2014 covered by UNIQUE(document,name)\n-- default_value FK is used as a JOIN column in validate and fragmentArguments transforms\nCREATE INDEX IF NOT EXISTS idx_document_variables_default_value ON document_variables(default_value);\nCREATE INDEX IF NOT EXISTS idx_document_variables_document_id ON document_variables(document, id);\nCREATE INDEX IF NOT EXISTS idx_document_variables_document_type_modifiers_default ON document_variables(document, type_modifiers, default_value);\n\n-- document_variable_directives / document_variable_directive_arguments\nCREATE INDEX IF NOT EXISTS idx_document_variable_directives_parent ON document_variable_directives(parent);\nCREATE INDEX IF NOT EXISTS idx_document_variable_directives_directive ON document_variable_directives(directive);\nCREATE INDEX IF NOT EXISTS idx_document_variable_directive_arguments_parent ON document_variable_directive_arguments(parent);\n\n-- document_dependencies\n-- note: no index on document_dependencies(document) \u2014 covered by UNIQUE(document,depends_on) leading column\nCREATE INDEX IF NOT EXISTS idx_document_dependency_depends_on on document_dependencies(depends_on);\n\n-- argument_values: composite (document,id) covers document-only lookups\n-- note: no separate index on argument_values(document) alone\nCREATE INDEX IF NOT EXISTS idx_argument_values_kind_raw ON argument_values(kind, raw);\nCREATE INDEX IF NOT EXISTS idx_argument_values_document_id ON argument_values(document, id);\nCREATE INDEX IF NOT EXISTS idx_argument_values_expected_type_document ON argument_values(expected_type, document);\n\n-- argument_value_children: composite (parent,value) covers parent-only lookups\n-- note: no separate index on argument_value_children(parent) alone\nCREATE INDEX IF NOT EXISTS idx_argument_value_children_parent_value ON argument_value_children(parent, value);\nCREATE INDEX IF NOT EXISTS idx_argument_value_children_value ON argument_value_children(value);\n-- document FK: large table; index needed for efficient CASCADE DELETE from documents\nCREATE INDEX IF NOT EXISTS idx_argument_value_children_document ON argument_value_children(document);\n";
|
|
5
5
|
export declare function write_config(db: sqlite.DatabaseSync, config: Config, invoke_hook: (plugin: string, hook: string, args: Record<string, any>) => Promise<Record<string, any>>, plugins: Array<PluginSpec>, mode: string): Promise<void>;
|
package/build/lib/database.js
CHANGED
|
@@ -381,65 +381,103 @@ CREATE TABLE IF NOT EXISTS document_dependencies (
|
|
|
381
381
|
-- Indices
|
|
382
382
|
-----------------------------------------------------------
|
|
383
383
|
|
|
384
|
+
-- component_fields
|
|
384
385
|
CREATE INDEX IF NOT EXISTS idx_component_fields_type_fields ON component_fields(type_field);
|
|
386
|
+
|
|
387
|
+
-- discovered_lists
|
|
385
388
|
CREATE INDEX IF NOT EXISTS idx_discovered_lists_document ON discovered_lists(document);
|
|
386
389
|
CREATE INDEX IF NOT EXISTS idx_discovered_lists_node ON discovered_lists(node);
|
|
387
390
|
CREATE INDEX IF NOT EXISTS idx_discovered_lists_list_field ON discovered_lists(list_field);
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
CREATE INDEX IF NOT EXISTS idx_type_fields_id ON type_fields(id);
|
|
391
|
+
-- note: no index on discovered_lists(connection) \u2014 boolean column, ~2 distinct values
|
|
392
|
+
|
|
393
|
+
-- types
|
|
392
394
|
CREATE INDEX IF NOT EXISTS idx_types_kind_operation ON types(kind, operation);
|
|
395
|
+
-- note: no index on types(name) \u2014 covered by PRIMARY KEY UNIQUE
|
|
396
|
+
|
|
397
|
+
-- documents
|
|
393
398
|
CREATE INDEX IF NOT EXISTS idx_documents_kind ON documents(kind);
|
|
394
399
|
CREATE INDEX IF NOT EXISTS idx_documents_type_condition ON documents(type_condition);
|
|
395
|
-
CREATE INDEX IF NOT EXISTS idx_raw_documents_current_task ON raw_documents(current_task);
|
|
396
400
|
CREATE INDEX IF NOT EXISTS idx_documents_raw_document ON documents(raw_document);
|
|
401
|
+
CREATE INDEX IF NOT EXISTS idx_documents_name_kind ON documents(name, kind);
|
|
402
|
+
|
|
403
|
+
-- raw_documents
|
|
404
|
+
CREATE INDEX IF NOT EXISTS idx_raw_documents_current_task ON raw_documents(current_task);
|
|
405
|
+
|
|
406
|
+
-- selections
|
|
407
|
+
CREATE INDEX IF NOT EXISTS idx_selections_type ON selections(type);
|
|
408
|
+
CREATE INDEX IF NOT EXISTS idx_selections_alias ON selections(alias);
|
|
409
|
+
CREATE INDEX IF NOT EXISTS idx_selections_field_name_kind ON selections(field_name, kind);
|
|
410
|
+
|
|
411
|
+
-- selection_refs: composite covers document-only lookups, so no separate single-column index needed
|
|
397
412
|
CREATE INDEX IF NOT EXISTS idx_selection_refs_parent_id ON selection_refs(parent_id);
|
|
413
|
+
|
|
398
414
|
CREATE INDEX IF NOT EXISTS idx_selection_refs_child_id ON selection_refs(child_id);
|
|
399
|
-
CREATE INDEX IF NOT EXISTS idx_selection_refs_document ON selection_refs(document);
|
|
400
|
-
-- Composite index for common query patterns in CollectDocuments
|
|
401
415
|
CREATE INDEX IF NOT EXISTS idx_selection_refs_document_parent_id ON selection_refs(document, parent_id);
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
CREATE INDEX IF NOT EXISTS idx_document_variable_directive_arguments_parent ON document_variable_directive_arguments(parent);
|
|
405
|
-
CREATE INDEX IF NOT EXISTS idx_selections_type ON selections(type);
|
|
406
|
-
CREATE INDEX IF NOT EXISTS idx_document_directives_document ON document_directives(document);
|
|
407
|
-
CREATE INDEX IF NOT EXISTS idx_document_directives_directive ON document_directives(directive);
|
|
408
|
-
CREATE INDEX IF NOT EXISTS idx_document_directive_arguments_parent ON document_directive_arguments(parent);
|
|
409
|
-
CREATE INDEX IF NOT EXISTS idx_document_directive_arguments_parent_name ON document_directive_arguments(parent, name);
|
|
410
|
-
CREATE INDEX IF NOT EXISTS idx_type_fields_parent ON type_fields(parent);
|
|
411
|
-
CREATE INDEX IF NOT EXISTS idx_selections_alias ON selections(alias);
|
|
416
|
+
|
|
417
|
+
-- selection_directives / selection_directive_arguments / selection_arguments
|
|
412
418
|
CREATE INDEX IF NOT EXISTS idx_selection_directives_selection ON selection_directives(selection_id);
|
|
419
|
+
CREATE INDEX IF NOT EXISTS idx_selection_directives_directive ON selection_directives(directive);
|
|
420
|
+
CREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_parent_name ON selection_directive_arguments(parent, name);
|
|
421
|
+
-- note: no index on selection_directive_arguments(parent) alone \u2014 covered by (parent,name) composite
|
|
422
|
+
CREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_value ON selection_directive_arguments(value);
|
|
423
|
+
-- document FK on selection_directive_arguments and selection_arguments: used in WHERE/JOIN in CollectDocuments
|
|
424
|
+
CREATE INDEX IF NOT EXISTS idx_selection_directive_arguments_document ON selection_directive_arguments(document);
|
|
425
|
+
CREATE INDEX IF NOT EXISTS idx_selection_arguments_document ON selection_arguments(document);
|
|
413
426
|
CREATE INDEX IF NOT EXISTS idx_selection_arguments_selection ON selection_arguments(selection_id);
|
|
414
|
-
CREATE INDEX IF NOT EXISTS
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
427
|
+
CREATE INDEX IF NOT EXISTS idx_selection_arguments_value ON selection_arguments(value);
|
|
428
|
+
|
|
429
|
+
-- type_fields / type_field_arguments
|
|
430
|
+
-- note: no index on type_fields(id) or type_field_arguments(id) \u2014 covered by their TEXT PRIMARY KEYs
|
|
431
|
+
CREATE INDEX IF NOT EXISTS idx_type_fields_parent ON type_fields(parent);
|
|
418
432
|
CREATE INDEX IF NOT EXISTS idx_type_fields_name ON type_fields(name);
|
|
419
433
|
CREATE INDEX IF NOT EXISTS idx_type_configs_name ON type_configs(name);
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
CREATE INDEX IF NOT EXISTS
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
CREATE INDEX IF NOT EXISTS
|
|
427
|
-
CREATE INDEX IF NOT EXISTS
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
434
|
+
|
|
435
|
+
-- possible_types
|
|
436
|
+
-- note: no index on possible_types(type) \u2014 covered by PRIMARY KEY(type,member) leading column
|
|
437
|
+
CREATE INDEX IF NOT EXISTS idx_possible_types_member ON possible_types(member);
|
|
438
|
+
|
|
439
|
+
-- type_fields: type and document FK columns have no implicit index
|
|
440
|
+
CREATE INDEX IF NOT EXISTS idx_type_fields_type ON type_fields(type);
|
|
441
|
+
CREATE INDEX IF NOT EXISTS idx_type_fields_document ON type_fields(document);
|
|
442
|
+
|
|
443
|
+
-- enum_values
|
|
444
|
+
-- note: no index on enum_values(parent) or (parent,value) \u2014 both covered by UNIQUE(parent,value)
|
|
445
|
+
|
|
446
|
+
-- document_directives / document_directive_arguments
|
|
447
|
+
CREATE INDEX IF NOT EXISTS idx_document_directives_document ON document_directives(document);
|
|
448
|
+
CREATE INDEX IF NOT EXISTS idx_document_directives_directive ON document_directives(directive);
|
|
449
|
+
CREATE INDEX IF NOT EXISTS idx_document_directive_arguments_parent_name ON document_directive_arguments(parent, name);
|
|
450
|
+
-- note: no index on document_directive_arguments(parent) alone \u2014 covered by (parent,name) composite
|
|
451
|
+
CREATE INDEX IF NOT EXISTS idx_document_directive_arguments_value on document_directive_arguments(value);
|
|
452
|
+
|
|
453
|
+
-- document_variables
|
|
454
|
+
-- note: no index on document_variables(document,name) \u2014 covered by UNIQUE(document,name)
|
|
455
|
+
-- default_value FK is used as a JOIN column in validate and fragmentArguments transforms
|
|
456
|
+
CREATE INDEX IF NOT EXISTS idx_document_variables_default_value ON document_variables(default_value);
|
|
457
|
+
CREATE INDEX IF NOT EXISTS idx_document_variables_document_id ON document_variables(document, id);
|
|
458
|
+
CREATE INDEX IF NOT EXISTS idx_document_variables_document_type_modifiers_default ON document_variables(document, type_modifiers, default_value);
|
|
459
|
+
|
|
460
|
+
-- document_variable_directives / document_variable_directive_arguments
|
|
461
|
+
CREATE INDEX IF NOT EXISTS idx_document_variable_directives_parent ON document_variable_directives(parent);
|
|
462
|
+
CREATE INDEX IF NOT EXISTS idx_document_variable_directives_directive ON document_variable_directives(directive);
|
|
463
|
+
CREATE INDEX IF NOT EXISTS idx_document_variable_directive_arguments_parent ON document_variable_directive_arguments(parent);
|
|
464
|
+
|
|
465
|
+
-- document_dependencies
|
|
466
|
+
-- note: no index on document_dependencies(document) \u2014 covered by UNIQUE(document,depends_on) leading column
|
|
432
467
|
CREATE INDEX IF NOT EXISTS idx_document_dependency_depends_on on document_dependencies(depends_on);
|
|
433
|
-
|
|
468
|
+
|
|
469
|
+
-- argument_values: composite (document,id) covers document-only lookups
|
|
470
|
+
-- note: no separate index on argument_values(document) alone
|
|
471
|
+
CREATE INDEX IF NOT EXISTS idx_argument_values_kind_raw ON argument_values(kind, raw);
|
|
434
472
|
CREATE INDEX IF NOT EXISTS idx_argument_values_document_id ON argument_values(document, id);
|
|
435
|
-
-- Additional performance optimizations for the recursive CTE query
|
|
436
|
-
CREATE INDEX IF NOT EXISTS idx_argument_value_children_parent_value ON argument_value_children(parent, value);
|
|
437
|
-
-- Complex query optimizations based on query analysis
|
|
438
|
-
CREATE INDEX IF NOT EXISTS idx_selections_field_name_kind ON selections(field_name, kind);
|
|
439
|
-
CREATE INDEX IF NOT EXISTS idx_documents_name_kind ON documents(name, kind);
|
|
440
|
-
CREATE INDEX IF NOT EXISTS idx_document_variables_document_id ON document_variables(document, id);
|
|
441
473
|
CREATE INDEX IF NOT EXISTS idx_argument_values_expected_type_document ON argument_values(expected_type, document);
|
|
442
|
-
|
|
474
|
+
|
|
475
|
+
-- argument_value_children: composite (parent,value) covers parent-only lookups
|
|
476
|
+
-- note: no separate index on argument_value_children(parent) alone
|
|
477
|
+
CREATE INDEX IF NOT EXISTS idx_argument_value_children_parent_value ON argument_value_children(parent, value);
|
|
478
|
+
CREATE INDEX IF NOT EXISTS idx_argument_value_children_value ON argument_value_children(value);
|
|
479
|
+
-- document FK: large table; index needed for efficient CASCADE DELETE from documents
|
|
480
|
+
CREATE INDEX IF NOT EXISTS idx_argument_value_children_document ON argument_value_children(document);
|
|
443
481
|
`;
|
|
444
482
|
async function write_config(db, config, invoke_hook, plugins, mode) {
|
|
445
483
|
const env = {};
|
package/build/lib/error.js
CHANGED
|
@@ -50,7 +50,8 @@ function format_hook_error(rootDir, error, plugin, hook) {
|
|
|
50
50
|
const filepath = location.filepath.includes(rootDir) ? location.filepath : path.join(rootDir, location.filepath);
|
|
51
51
|
const contents = readFileSync(filepath);
|
|
52
52
|
if (!contents) {
|
|
53
|
-
|
|
53
|
+
message += `${location.filepath}`;
|
|
54
|
+
return;
|
|
54
55
|
}
|
|
55
56
|
const lines = contents.split("\n");
|
|
56
57
|
message += `${location.filepath}:${location.line}:${location.column}
|
package/build/lib/plugins.js
CHANGED
|
@@ -12,9 +12,7 @@ async function plugin_path(plugin_name, config_path) {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
const plugin_dir = find_module(plugin_name, config_path);
|
|
15
|
-
const package_json_src = await fs.readFile(
|
|
16
|
-
path.join(plugin_dir, "package.json")
|
|
17
|
-
);
|
|
15
|
+
const package_json_src = await fs.readFile(path.join(plugin_dir, "package.json"));
|
|
18
16
|
if (!package_json_src) {
|
|
19
17
|
throw new Error("There is no package.json.");
|
|
20
18
|
}
|
package/build/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ConfigFile } from 'houdini';
|
|
2
|
-
import type { GraphQLObject, GraphQLValue, NestedList, SubscriptionSelection, SubscriptionSpec, ValueMap, ValueNode } from '../types';
|
|
3
|
-
import { GarbageCollector } from './gc';
|
|
4
|
-
import type { ListCollection } from './lists';
|
|
5
|
-
import { ListManager } from './lists';
|
|
6
|
-
import { StaleManager } from './staleManager';
|
|
7
|
-
import type { Layer, LayerID } from './storage';
|
|
8
|
-
import { InMemoryStorage } from './storage';
|
|
9
|
-
import { InMemorySubscriptions, type FieldSelection } from './subscription';
|
|
2
|
+
import type { GraphQLObject, GraphQLValue, NestedList, SubscriptionSelection, SubscriptionSpec, ValueMap, ValueNode } from '../types.js';
|
|
3
|
+
import { GarbageCollector } from './gc.js';
|
|
4
|
+
import type { ListCollection } from './lists.js';
|
|
5
|
+
import { ListManager } from './lists.js';
|
|
6
|
+
import { StaleManager } from './staleManager.js';
|
|
7
|
+
import type { Layer, LayerID } from './storage.js';
|
|
8
|
+
import { InMemoryStorage } from './storage.js';
|
|
9
|
+
import { InMemorySubscriptions, type FieldSelection } from './subscription.js';
|
|
10
10
|
export declare class Cache {
|
|
11
11
|
#private;
|
|
12
12
|
_internal_unstable: CacheInternal;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { computeID, defaultConfigValues, keyFieldsForType } from "../config";
|
|
2
|
-
import { deepEquals } from "../deepEquals";
|
|
3
|
-
import { flatten } from "../flatten";
|
|
4
|
-
import { computeKey } from "../key";
|
|
5
|
-
import { getFieldsForType } from "../selection";
|
|
6
|
-
import { PendingValue } from "../types";
|
|
7
|
-
import { fragmentKey } from "../types";
|
|
8
|
-
import { GarbageCollector } from "./gc";
|
|
9
|
-
import { ListManager } from "./lists";
|
|
10
|
-
import { StaleManager } from "./staleManager";
|
|
11
|
-
import { InMemoryStorage } from "./storage";
|
|
12
|
-
import { evaluateKey, rootID } from "./stuff";
|
|
13
|
-
import { InMemorySubscriptions } from "./subscription";
|
|
1
|
+
import { computeID, defaultConfigValues, keyFieldsForType } from "../config.js";
|
|
2
|
+
import { deepEquals } from "../deepEquals.js";
|
|
3
|
+
import { flatten } from "../flatten.js";
|
|
4
|
+
import { computeKey } from "../key.js";
|
|
5
|
+
import { getFieldsForType } from "../selection.js";
|
|
6
|
+
import { PendingValue } from "../types.js";
|
|
7
|
+
import { fragmentKey } from "../types.js";
|
|
8
|
+
import { GarbageCollector } from "./gc.js";
|
|
9
|
+
import { ListManager } from "./lists.js";
|
|
10
|
+
import { StaleManager } from "./staleManager.js";
|
|
11
|
+
import { InMemoryStorage } from "./storage.js";
|
|
12
|
+
import { evaluateKey, rootID } from "./stuff.js";
|
|
13
|
+
import { InMemorySubscriptions } from "./subscription.js";
|
|
14
14
|
class Cache {
|
|
15
15
|
_internal_unstable;
|
|
16
16
|
constructor({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { SubscriptionSelection, ListWhen, SubscriptionSpec } from '../types';
|
|
1
|
+
import type { SubscriptionSelection, ListWhen, SubscriptionSpec } from '../types.js';
|
|
2
2
|
import type { Cache } from './index.js';
|
|
3
|
-
import type { Layer } from './storage';
|
|
3
|
+
import type { Layer } from './storage.js';
|
|
4
4
|
export declare class ListManager {
|
|
5
5
|
rootID: string;
|
|
6
6
|
cache: Cache;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GraphQLValue, SubscriptionSelection, SubscriptionSpec } from '../types';
|
|
2
|
-
import type { Cache } from './index';
|
|
1
|
+
import type { GraphQLValue, SubscriptionSelection, SubscriptionSpec } from '../types.js';
|
|
2
|
+
import type { Cache } from './index.js';
|
|
3
3
|
export type FieldSelection = [
|
|
4
4
|
SubscriptionSpec,
|
|
5
5
|
Required<SubscriptionSelection>['fields'] | undefined
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { flatten } from "../flatten";
|
|
2
|
-
import { getFieldsForType } from "../selection";
|
|
3
|
-
import { evaluateKey, rootID } from "./stuff";
|
|
1
|
+
import { flatten } from "../flatten.js";
|
|
2
|
+
import { getFieldsForType } from "../selection.js";
|
|
3
|
+
import { evaluateKey, rootID } from "./stuff.js";
|
|
4
4
|
class InMemorySubscriptions {
|
|
5
5
|
cache;
|
|
6
6
|
constructor(cache) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ConfigFile } from 'houdini';
|
|
2
|
-
import type { Cache } from './cache';
|
|
2
|
+
import type { Cache } from './cache/index.js';
|
|
3
3
|
import type { ClientHooks, ClientPlugin } from './documentStore.js';
|
|
4
4
|
import { DocumentStore } from './documentStore.js';
|
|
5
|
-
import type { DocumentArtifact, GraphQLVariables, GraphQLObject, NestedList } from './types';
|
|
5
|
+
import type { DocumentArtifact, GraphQLVariables, GraphQLObject, NestedList } from './types.js';
|
|
6
6
|
export { DocumentStore } from './documentStore.js';
|
|
7
7
|
export type { ClientPlugin, SendParams } from './documentStore.js';
|
|
8
8
|
export type HoudiniClientConstructorArgs = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ConfigFile } from 'houdini';
|
|
2
2
|
import type { HoudiniClient } from '.';
|
|
3
|
-
import type { Layer } from './cache/storage';
|
|
4
|
-
import { Writable } from './store';
|
|
5
|
-
import type { DocumentArtifact, QueryResult, GraphQLObject, SubscriptionSpec, CachePolicies, GraphQLVariables } from './types';
|
|
3
|
+
import type { Layer } from './cache/storage.js';
|
|
4
|
+
import { Writable } from './store.js';
|
|
5
|
+
import type { DocumentArtifact, QueryResult, GraphQLObject, SubscriptionSpec, CachePolicies, GraphQLVariables } from './types.js';
|
|
6
6
|
export declare class DocumentStore<_Data extends GraphQLObject, _Input extends GraphQLVariables | undefined> extends Writable<QueryResult<_Data, _Input>> {
|
|
7
7
|
#private;
|
|
8
8
|
readonly artifact: DocumentArtifact;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { deepEquals } from "./deepEquals";
|
|
2
|
-
import { marshalInputs } from "./scalars";
|
|
3
|
-
import { Writable } from "./store";
|
|
4
|
-
import { ArtifactKind, DedupeMatchMode } from "./types";
|
|
1
|
+
import { deepEquals } from "./deepEquals.js";
|
|
2
|
+
import { marshalInputs } from "./scalars.js";
|
|
3
|
+
import { Writable } from "./store.js";
|
|
4
|
+
import { ArtifactKind, DedupeMatchMode } from "./types.js";
|
|
5
5
|
const steps = {
|
|
6
6
|
forward: ["start", "beforeNetwork", "network"],
|
|
7
7
|
backwards: ["end", "afterNetwork"]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NestedList } from './types';
|
|
1
|
+
import type { NestedList } from './types.js';
|
|
2
2
|
export declare function flatten<T>(source?: NestedList<T>): T[];
|
package/build/runtime/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './client';
|
|
2
|
-
export { deepEquals } from './deepEquals';
|
|
3
|
-
export * from './scalars';
|
|
4
|
-
export * from './types';
|
|
5
|
-
export { computeID, keyFieldsForType, setMockConfig, getMockConfig, getCurrentConfig, } from './config';
|
|
6
|
-
export { getFieldsForType } from './selection';
|
|
7
|
-
export { flatten } from './flatten';
|
|
8
|
-
export * from './pageInfo';
|
|
9
|
-
export * from './pagination';
|
|
10
|
-
export * from './constants';
|
|
11
|
-
export * from './log';
|
|
12
|
-
export { LRUCache, createLRUCache } from './lru';
|
|
1
|
+
export * from './client.js';
|
|
2
|
+
export { deepEquals } from './deepEquals.js';
|
|
3
|
+
export * from './scalars.js';
|
|
4
|
+
export * from './types.js';
|
|
5
|
+
export { computeID, keyFieldsForType, setMockConfig, getMockConfig, getCurrentConfig, } from './config.js';
|
|
6
|
+
export { getFieldsForType } from './selection.js';
|
|
7
|
+
export { flatten } from './flatten.js';
|
|
8
|
+
export * from './pageInfo.js';
|
|
9
|
+
export * from './pagination.js';
|
|
10
|
+
export * from './constants.js';
|
|
11
|
+
export * from './log.js';
|
|
12
|
+
export { LRUCache, createLRUCache } from './lru.js';
|
package/build/runtime/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from "./client";
|
|
2
|
-
import { deepEquals } from "./deepEquals";
|
|
3
|
-
export * from "./scalars";
|
|
4
|
-
export * from "./types";
|
|
1
|
+
export * from "./client.js";
|
|
2
|
+
import { deepEquals } from "./deepEquals.js";
|
|
3
|
+
export * from "./scalars.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
5
|
import {
|
|
6
6
|
computeID,
|
|
7
7
|
keyFieldsForType,
|
|
8
8
|
setMockConfig,
|
|
9
9
|
getMockConfig,
|
|
10
10
|
getCurrentConfig
|
|
11
|
-
} from "./config";
|
|
12
|
-
import { getFieldsForType } from "./selection";
|
|
13
|
-
import { flatten } from "./flatten";
|
|
14
|
-
export * from "./pageInfo";
|
|
15
|
-
export * from "./pagination";
|
|
16
|
-
export * from "./constants";
|
|
17
|
-
export * from "./log";
|
|
18
|
-
import { LRUCache, createLRUCache } from "./lru";
|
|
11
|
+
} from "./config.js";
|
|
12
|
+
import { getFieldsForType } from "./selection.js";
|
|
13
|
+
import { flatten } from "./flatten.js";
|
|
14
|
+
export * from "./pageInfo.js";
|
|
15
|
+
export * from "./pagination.js";
|
|
16
|
+
export * from "./constants.js";
|
|
17
|
+
export * from "./log.js";
|
|
18
|
+
import { LRUCache, createLRUCache } from "./lru.js";
|
|
19
19
|
export {
|
|
20
20
|
LRUCache,
|
|
21
21
|
computeID,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SendParams } from './documentStore';
|
|
2
|
-
import type { CursorHandlers, FetchFn, GraphQLObject, GraphQLVariables, QueryArtifact, QueryResult, FetchParams } from './types';
|
|
1
|
+
import type { SendParams } from './documentStore.js';
|
|
2
|
+
import type { CursorHandlers, FetchFn, GraphQLObject, GraphQLVariables, QueryArtifact, QueryResult, FetchParams } from './types.js';
|
|
3
3
|
export declare function cursorHandlers<_Data extends GraphQLObject, _Input extends GraphQLVariables | null | undefined>({ artifact, fetchUpdate: parentFetchUpdate, fetch: parentFetch, getState, getVariables, getSession, }: {
|
|
4
4
|
artifact: QueryArtifact;
|
|
5
5
|
getState: () => _Data | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { deepEquals } from "./deepEquals";
|
|
2
|
-
import { countPage, extractPageInfo, missingPageSizeError } from "./pageInfo";
|
|
3
|
-
import { CachePolicy, DataSource } from "./types";
|
|
1
|
+
import { deepEquals } from "./deepEquals.js";
|
|
2
|
+
import { countPage, extractPageInfo, missingPageSizeError } from "./pageInfo.js";
|
|
3
|
+
import { CachePolicy, DataSource } from "./types.js";
|
|
4
4
|
function cursorHandlers({
|
|
5
5
|
artifact,
|
|
6
6
|
fetchUpdate: parentFetchUpdate,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConfigFile } from 'houdini';
|
|
2
|
-
import { type FragmentArtifact, type MutationArtifact, type QueryArtifact, type SubscriptionArtifact, type SubscriptionSelection } from './types';
|
|
2
|
+
import { type FragmentArtifact, type MutationArtifact, type QueryArtifact, type SubscriptionArtifact, type SubscriptionSelection } from './types.js';
|
|
3
3
|
export declare function marshalSelection({ selection, data, config, }: {
|
|
4
4
|
selection: SubscriptionSelection;
|
|
5
5
|
data: any;
|
package/build/runtime/scalars.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getCurrentConfig } from "./config";
|
|
2
|
-
import { getFieldsForType } from "./selection";
|
|
1
|
+
import { getCurrentConfig } from "./config.js";
|
|
2
|
+
import { getFieldsForType } from "./selection.js";
|
|
3
3
|
import {
|
|
4
4
|
fragmentKey
|
|
5
|
-
} from "./types";
|
|
5
|
+
} from "./types.js";
|
|
6
6
|
function marshalSelection({
|
|
7
7
|
selection,
|
|
8
8
|
data,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SubscriptionSelection } from './types';
|
|
1
|
+
import type { SubscriptionSelection } from './types.js';
|
|
2
2
|
export declare function getFieldsForType(selection: SubscriptionSelection, __typename: string | undefined | null, loading: boolean): Required<SubscriptionSelection>['fields'];
|
package/build/runtime/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const DedupeMatchMode: {
|
|
|
7
7
|
readonly None: "None";
|
|
8
8
|
};
|
|
9
9
|
export type DedupeMatchModes = ValuesOf<typeof DedupeMatchMode>;
|
|
10
|
-
export * from '../router/types';
|
|
10
|
+
export * from '../router/types.js';
|
|
11
11
|
declare global {
|
|
12
12
|
namespace App {
|
|
13
13
|
interface Session {
|
package/build/runtime/types.js
CHANGED
package/build/vite/hmr.js
CHANGED
|
@@ -184,35 +184,32 @@ function createDebounceHmr(debounceMs = 50) {
|
|
|
184
184
|
await Promise.all(
|
|
185
185
|
Array.from(filesToProcess.entries()).map(async ([filepath, readFn]) => {
|
|
186
186
|
try {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
} catch (error) {
|
|
190
|
-
filesWithContent[filepath] = "";
|
|
187
|
+
filesWithContent[filepath] = await readFn();
|
|
188
|
+
} catch {
|
|
191
189
|
}
|
|
192
190
|
})
|
|
193
191
|
);
|
|
194
192
|
try {
|
|
195
193
|
await callback(filesWithContent, currentBatchId.toString());
|
|
196
|
-
} catch {
|
|
194
|
+
} catch (err) {
|
|
195
|
+
console.error("[houdini] HMR pipeline error:", err);
|
|
197
196
|
}
|
|
198
|
-
|
|
197
|
+
while (pendingBatch) {
|
|
199
198
|
const { files: nextFiles, batchId: nextBatchId } = pendingBatch;
|
|
200
199
|
pendingBatch = null;
|
|
201
200
|
const nextFilesWithContent = {};
|
|
202
|
-
|
|
203
|
-
async ([filepath, readFn]) => {
|
|
201
|
+
await Promise.all(
|
|
202
|
+
Array.from(nextFiles.entries()).map(async ([filepath, readFn]) => {
|
|
204
203
|
try {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
} catch (error) {
|
|
208
|
-
nextFilesWithContent[filepath] = "";
|
|
204
|
+
nextFilesWithContent[filepath] = await readFn();
|
|
205
|
+
} catch {
|
|
209
206
|
}
|
|
210
|
-
}
|
|
207
|
+
})
|
|
211
208
|
);
|
|
212
|
-
await Promise.all(nextReadPromises);
|
|
213
209
|
try {
|
|
214
210
|
await callback(nextFilesWithContent, nextBatchId.toString());
|
|
215
|
-
} catch {
|
|
211
|
+
} catch (err) {
|
|
212
|
+
console.error("[houdini] HMR pipeline error:", err);
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
215
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini",
|
|
3
|
-
"version": "2.0.0-go.
|
|
3
|
+
"version": "2.0.0-go.14",
|
|
4
4
|
"description": "The disappearing GraphQL clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"npx-import": "^1.1.3",
|
|
56
56
|
"recast": "^0.23.1",
|
|
57
57
|
"ws": "^8.18.0",
|
|
58
|
-
"houdini-core": "^2.0.0-go.
|
|
58
|
+
"houdini-core": "^2.0.0-go.9"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"vite": "^7.0.0"
|