@constructive-io/graphql-codegen 4.0.2 → 4.1.0
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/cli/handler.d.ts +13 -0
- package/cli/handler.js +74 -0
- package/cli/index.js +11 -57
- package/core/codegen/barrel.d.ts +1 -0
- package/core/codegen/barrel.js +5 -2
- package/core/codegen/cli/arg-mapper.d.ts +4 -0
- package/core/codegen/cli/arg-mapper.js +117 -0
- package/core/codegen/cli/command-map-generator.d.ts +16 -0
- package/core/codegen/cli/command-map-generator.js +338 -0
- package/core/codegen/cli/custom-command-generator.d.ts +8 -0
- package/core/codegen/cli/custom-command-generator.js +155 -0
- package/core/codegen/cli/docs-generator.d.ts +26 -0
- package/core/codegen/cli/docs-generator.js +1399 -0
- package/core/codegen/cli/executor-generator.d.ts +11 -0
- package/core/codegen/cli/executor-generator.js +217 -0
- package/core/codegen/cli/index.d.ts +53 -0
- package/core/codegen/cli/index.js +153 -0
- package/core/codegen/cli/infra-generator.d.ts +9 -0
- package/core/codegen/cli/infra-generator.js +1195 -0
- package/core/codegen/cli/table-command-generator.d.ts +7 -0
- package/core/codegen/cli/table-command-generator.js +323 -0
- package/core/codegen/docs-utils.d.ts +30 -0
- package/core/codegen/docs-utils.js +122 -0
- package/core/codegen/hooks-docs-generator.d.ts +6 -0
- package/core/codegen/hooks-docs-generator.js +468 -0
- package/core/codegen/orm/docs-generator.d.ts +6 -0
- package/core/codegen/orm/docs-generator.js +416 -0
- package/core/codegen/target-docs-generator.d.ts +20 -0
- package/core/codegen/target-docs-generator.js +110 -0
- package/core/database/index.d.ts +0 -12
- package/core/database/index.js +2 -19
- package/core/generate.d.ts +34 -2
- package/core/generate.js +453 -12
- package/core/index.d.ts +0 -2
- package/core/index.js +0 -2
- package/core/introspect/source/database.js +2 -2
- package/core/introspect/source/pgpm-module.js +2 -2
- package/core/output/index.d.ts +1 -1
- package/core/output/index.js +1 -2
- package/core/output/writer.d.ts +0 -10
- package/core/output/writer.js +0 -31
- package/esm/cli/handler.d.ts +13 -0
- package/esm/cli/handler.js +71 -0
- package/esm/cli/index.js +11 -57
- package/esm/core/codegen/barrel.d.ts +1 -0
- package/esm/core/codegen/barrel.js +5 -2
- package/esm/core/codegen/cli/arg-mapper.d.ts +4 -0
- package/esm/core/codegen/cli/arg-mapper.js +80 -0
- package/esm/core/codegen/cli/command-map-generator.d.ts +16 -0
- package/esm/core/codegen/cli/command-map-generator.js +301 -0
- package/esm/core/codegen/cli/custom-command-generator.d.ts +8 -0
- package/esm/core/codegen/cli/custom-command-generator.js +119 -0
- package/esm/core/codegen/cli/docs-generator.d.ts +26 -0
- package/esm/core/codegen/cli/docs-generator.js +1387 -0
- package/esm/core/codegen/cli/executor-generator.d.ts +11 -0
- package/esm/core/codegen/cli/executor-generator.js +180 -0
- package/esm/core/codegen/cli/index.d.ts +53 -0
- package/esm/core/codegen/cli/index.js +128 -0
- package/esm/core/codegen/cli/infra-generator.d.ts +9 -0
- package/esm/core/codegen/cli/infra-generator.js +1156 -0
- package/esm/core/codegen/cli/table-command-generator.d.ts +7 -0
- package/esm/core/codegen/cli/table-command-generator.js +287 -0
- package/esm/core/codegen/docs-utils.d.ts +30 -0
- package/esm/core/codegen/docs-utils.js +112 -0
- package/esm/core/codegen/hooks-docs-generator.d.ts +6 -0
- package/esm/core/codegen/hooks-docs-generator.js +462 -0
- package/esm/core/codegen/orm/docs-generator.d.ts +6 -0
- package/esm/core/codegen/orm/docs-generator.js +410 -0
- package/esm/core/codegen/target-docs-generator.d.ts +20 -0
- package/esm/core/codegen/target-docs-generator.js +105 -0
- package/esm/core/database/index.d.ts +0 -12
- package/esm/core/database/index.js +1 -17
- package/esm/core/generate.d.ts +34 -2
- package/esm/core/generate.js +417 -12
- package/esm/core/index.d.ts +0 -2
- package/esm/core/index.js +0 -2
- package/esm/core/introspect/source/database.js +2 -2
- package/esm/core/introspect/source/pgpm-module.js +2 -2
- package/esm/core/output/index.d.ts +1 -1
- package/esm/core/output/index.js +1 -1
- package/esm/core/output/writer.d.ts +0 -10
- package/esm/core/output/writer.js +0 -30
- package/esm/generators/index.d.ts +0 -3
- package/esm/generators/index.js +0 -3
- package/esm/index.d.ts +4 -3
- package/esm/index.js +4 -2
- package/esm/types/config.d.ts +78 -0
- package/generators/index.d.ts +0 -3
- package/generators/index.js +0 -3
- package/index.d.ts +4 -3
- package/index.js +7 -2
- package/package.json +8 -7
- package/types/config.d.ts +78 -0
package/esm/types/config.d.ts
CHANGED
|
@@ -112,6 +112,64 @@ export interface DbConfig {
|
|
|
112
112
|
*/
|
|
113
113
|
keepDb?: boolean;
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Documentation generation options
|
|
117
|
+
* Controls which doc formats are generated alongside code for each generator target.
|
|
118
|
+
* Applied at the top level and affects all enabled generators (ORM, React Query, CLI).
|
|
119
|
+
*/
|
|
120
|
+
export interface DocsConfig {
|
|
121
|
+
/**
|
|
122
|
+
* Generate README.md — human-readable overview with setup, commands, examples
|
|
123
|
+
* @default true
|
|
124
|
+
*/
|
|
125
|
+
readme?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Generate AGENTS.md — structured markdown optimized for LLM consumption
|
|
128
|
+
* Includes: tool definitions, exact signatures, input/output schemas,
|
|
129
|
+
* workflow recipes, error handling, and machine-parseable sections
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
agents?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Generate mcp.json — MCP (Model Context Protocol) tool definitions
|
|
135
|
+
* Each CLI command becomes a tool with typed inputSchema (JSON Schema)
|
|
136
|
+
* Ready to plug into any MCP-compatible agent
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
mcp?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Generate skills/ directory — per-command .md skill files
|
|
142
|
+
* Each command gets its own skill file with description, usage, and examples
|
|
143
|
+
* Compatible with Devin and similar agent skill systems
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
146
|
+
skills?: boolean;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Infrastructure command name overrides for collision handling.
|
|
150
|
+
* When a target name collides with a default infra command name,
|
|
151
|
+
* the infra command is auto-renamed. These allow user overrides.
|
|
152
|
+
*/
|
|
153
|
+
export interface BuiltinNames {
|
|
154
|
+
auth?: string;
|
|
155
|
+
context?: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* CLI generation configuration
|
|
159
|
+
*/
|
|
160
|
+
export interface CliConfig {
|
|
161
|
+
/**
|
|
162
|
+
* Tool name for appstash config storage (e.g., 'myapp' stores at ~/.myapp/)
|
|
163
|
+
* @default derived from output directory name
|
|
164
|
+
*/
|
|
165
|
+
toolName?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Override infra command names (for collision handling)
|
|
168
|
+
* Defaults: auth -> 'auth' (renamed to 'credentials' on collision),
|
|
169
|
+
* context -> 'context' (renamed to 'env' on collision)
|
|
170
|
+
*/
|
|
171
|
+
builtinNames?: BuiltinNames;
|
|
172
|
+
}
|
|
115
173
|
/**
|
|
116
174
|
* Target configuration for graphql-codegen
|
|
117
175
|
* Represents a single schema source and output destination.
|
|
@@ -130,6 +188,12 @@ export interface GraphQLSDKConfigTarget {
|
|
|
130
188
|
* Path to GraphQL schema file (.graphql) for file-based generation
|
|
131
189
|
*/
|
|
132
190
|
schemaFile?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Path to a directory of .graphql schema files for multi-target generation.
|
|
193
|
+
* Each *.graphql file becomes its own target, named by the filename (without extension).
|
|
194
|
+
* e.g. schemas/app.graphql + schemas/admin.graphql → targets "app" and "admin"
|
|
195
|
+
*/
|
|
196
|
+
schemaDir?: string;
|
|
133
197
|
/**
|
|
134
198
|
* Database configuration for direct database introspection or PGPM module
|
|
135
199
|
* Use db.schemas or db.apiNames to specify which schemas to introspect
|
|
@@ -221,6 +285,20 @@ export interface GraphQLSDKConfigTarget {
|
|
|
221
285
|
* @default false
|
|
222
286
|
*/
|
|
223
287
|
reactQuery?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* CLI generation configuration
|
|
290
|
+
* When enabled, generates inquirerer-based CLI commands to {output}/cli
|
|
291
|
+
* Requires appstash for config storage and inquirerer for prompts
|
|
292
|
+
*/
|
|
293
|
+
cli?: CliConfig | boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Documentation generation options
|
|
296
|
+
* Controls which doc formats are generated alongside code for each generator target.
|
|
297
|
+
* Applied globally to all enabled generators (ORM, React Query, CLI).
|
|
298
|
+
* Set to `true` to enable all formats, or configure individually.
|
|
299
|
+
* @default { readme: true, agents: true, mcp: false, skills: false }
|
|
300
|
+
*/
|
|
301
|
+
docs?: DocsConfig | boolean;
|
|
224
302
|
/**
|
|
225
303
|
* Query key generation configuration
|
|
226
304
|
* Controls how query keys are structured for cache management
|
package/generators/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Query and mutation generator exports
|
|
3
|
-
*
|
|
4
|
-
* @deprecated Legacy v4 generators — use v5 ORM codegen pipeline instead.
|
|
5
|
-
* These are retained for backward compatibility with existing v4 consumers.
|
|
6
3
|
*/
|
|
7
4
|
export { convertToSelectionOptions, getAvailableRelations, isRelationalField, validateFieldSelection, } from './field-selector';
|
|
8
5
|
export { buildCount, buildFindOne, buildSelect, cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema, toCamelCasePlural, toOrderByTypeName, } from './select';
|
package/generators/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Query and mutation generator exports
|
|
4
|
-
*
|
|
5
|
-
* @deprecated Legacy v4 generators — use v5 ORM codegen pipeline instead.
|
|
6
|
-
* These are retained for backward compatibility with existing v4 consumers.
|
|
7
4
|
*/
|
|
8
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
6
|
exports.buildPostGraphileUpdate = exports.buildPostGraphileDelete = exports.buildPostGraphileCreate = exports.toOrderByTypeName = exports.toCamelCasePlural = exports.generateIntrospectionSchema = exports.createASTQueryBuilder = exports.cleanTableToMetaObject = exports.buildSelect = exports.buildFindOne = exports.buildCount = exports.validateFieldSelection = exports.isRelationalField = exports.getAvailableRelations = exports.convertToSelectionOptions = void 0;
|
package/index.d.ts
CHANGED
|
@@ -10,10 +10,11 @@ export * from './core';
|
|
|
10
10
|
export * from './generators';
|
|
11
11
|
export * from './client';
|
|
12
12
|
export { defineConfig } from './types/config';
|
|
13
|
-
export type { GenerateOptions, GenerateResult } from './core/generate';
|
|
14
|
-
export { generate } from './core/generate';
|
|
13
|
+
export type { GenerateOptions, GenerateResult, GenerateMultiOptions, GenerateMultiResult } from './core/generate';
|
|
14
|
+
export { generate, generateMulti, expandApiNamesToMultiTarget, expandSchemaDirToMultiTarget } from './core/generate';
|
|
15
15
|
export { findConfigFile, loadConfigFile } from './core/config';
|
|
16
|
+
export { runCodegenHandler } from './cli/handler';
|
|
16
17
|
export type { CodegenAnswers } from './cli/shared';
|
|
17
18
|
export { buildDbConfig, buildGenerateOptions, camelizeArgv, codegenQuestions, filterDefined, flattenDbFields, hasResolvedCodegenSource, hyphenateKeys, normalizeCodegenListOptions, printResult, seedArgvFromConfig, splitCommas, } from './cli/shared';
|
|
18
19
|
export type { BuildSchemaFromDatabaseOptions, BuildSchemaFromDatabaseResult, } from './core/database';
|
|
19
|
-
export { buildSchemaFromDatabase
|
|
20
|
+
export { buildSchemaFromDatabase } from './core/database';
|
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
21
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.
|
|
24
|
+
exports.buildSchemaFromDatabase = exports.splitCommas = exports.seedArgvFromConfig = exports.printResult = exports.normalizeCodegenListOptions = exports.hyphenateKeys = exports.hasResolvedCodegenSource = exports.flattenDbFields = exports.filterDefined = exports.codegenQuestions = exports.camelizeArgv = exports.buildGenerateOptions = exports.buildDbConfig = exports.runCodegenHandler = exports.loadConfigFile = exports.findConfigFile = exports.expandSchemaDirToMultiTarget = exports.expandApiNamesToMultiTarget = exports.generateMulti = exports.generate = exports.defineConfig = void 0;
|
|
25
25
|
// Core types
|
|
26
26
|
__exportStar(require("./types"), exports);
|
|
27
27
|
// Core query building
|
|
@@ -35,10 +35,16 @@ var config_1 = require("./types/config");
|
|
|
35
35
|
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return config_1.defineConfig; } });
|
|
36
36
|
var generate_1 = require("./core/generate");
|
|
37
37
|
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return generate_1.generate; } });
|
|
38
|
+
Object.defineProperty(exports, "generateMulti", { enumerable: true, get: function () { return generate_1.generateMulti; } });
|
|
39
|
+
Object.defineProperty(exports, "expandApiNamesToMultiTarget", { enumerable: true, get: function () { return generate_1.expandApiNamesToMultiTarget; } });
|
|
40
|
+
Object.defineProperty(exports, "expandSchemaDirToMultiTarget", { enumerable: true, get: function () { return generate_1.expandSchemaDirToMultiTarget; } });
|
|
38
41
|
// Config utilities
|
|
39
42
|
var config_2 = require("./core/config");
|
|
40
43
|
Object.defineProperty(exports, "findConfigFile", { enumerable: true, get: function () { return config_2.findConfigFile; } });
|
|
41
44
|
Object.defineProperty(exports, "loadConfigFile", { enumerable: true, get: function () { return config_2.loadConfigFile; } });
|
|
45
|
+
// CLI shared utilities (for packages/cli to import)
|
|
46
|
+
var handler_1 = require("./cli/handler");
|
|
47
|
+
Object.defineProperty(exports, "runCodegenHandler", { enumerable: true, get: function () { return handler_1.runCodegenHandler; } });
|
|
42
48
|
var shared_1 = require("./cli/shared");
|
|
43
49
|
Object.defineProperty(exports, "buildDbConfig", { enumerable: true, get: function () { return shared_1.buildDbConfig; } });
|
|
44
50
|
Object.defineProperty(exports, "buildGenerateOptions", { enumerable: true, get: function () { return shared_1.buildGenerateOptions; } });
|
|
@@ -54,4 +60,3 @@ Object.defineProperty(exports, "seedArgvFromConfig", { enumerable: true, get: fu
|
|
|
54
60
|
Object.defineProperty(exports, "splitCommas", { enumerable: true, get: function () { return shared_1.splitCommas; } });
|
|
55
61
|
var database_1 = require("./core/database");
|
|
56
62
|
Object.defineProperty(exports, "buildSchemaFromDatabase", { enumerable: true, get: function () { return database_1.buildSchemaFromDatabase; } });
|
|
57
|
-
Object.defineProperty(exports, "buildSchemaSDLFromDatabase", { enumerable: true, get: function () { return database_1.buildSchemaSDLFromDatabase; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-codegen",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "GraphQL SDK generator for Constructive databases with React Query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"lint": "eslint . --fix",
|
|
43
43
|
"fmt": "oxfmt --write .",
|
|
44
44
|
"fmt:check": "oxfmt --check .",
|
|
45
|
-
"test": "jest
|
|
45
|
+
"test": "jest",
|
|
46
46
|
"test:watch": "jest --watch",
|
|
47
47
|
"example:codegen:sdk": "tsx src/cli/index.ts --config examples/multi-target.config.ts --react-query",
|
|
48
48
|
"example:codegen:orm": "tsx src/cli/index.ts --config examples/multi-target.config.ts --orm",
|
|
@@ -56,23 +56,24 @@
|
|
|
56
56
|
"@0no-co/graphql.web": "^1.1.2",
|
|
57
57
|
"@babel/generator": "^7.28.6",
|
|
58
58
|
"@babel/types": "^7.28.6",
|
|
59
|
-
"@constructive-io/graphql-server": "^4.0.1",
|
|
60
59
|
"@constructive-io/graphql-types": "^3.0.0",
|
|
61
60
|
"@inquirerer/utils": "^3.2.3",
|
|
62
|
-
"@pgpmjs/core": "^6.
|
|
61
|
+
"@pgpmjs/core": "^6.1.0",
|
|
63
62
|
"ajv": "^8.17.1",
|
|
64
63
|
"deepmerge": "^4.3.1",
|
|
65
64
|
"find-and-require-package-json": "^0.9.0",
|
|
66
65
|
"gql-ast": "^3.0.0",
|
|
66
|
+
"graphile-schema": "^1.1.0",
|
|
67
67
|
"graphql": "^16.9.0",
|
|
68
68
|
"inflekt": "^0.3.1",
|
|
69
69
|
"inquirerer": "^4.4.0",
|
|
70
70
|
"jiti": "^2.6.1",
|
|
71
|
+
"komoji": "^0.8.0",
|
|
71
72
|
"oxfmt": "^0.26.0",
|
|
72
73
|
"pg-cache": "^3.0.0",
|
|
73
74
|
"pg-env": "^1.4.0",
|
|
74
|
-
"pgsql-client": "^3.
|
|
75
|
-
"pgsql-seed": "^2.
|
|
75
|
+
"pgsql-client": "^3.1.0",
|
|
76
|
+
"pgsql-seed": "^2.1.0",
|
|
76
77
|
"undici": "^7.19.0"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
|
@@ -99,5 +100,5 @@
|
|
|
99
100
|
"tsx": "^4.21.0",
|
|
100
101
|
"typescript": "^5.9.3"
|
|
101
102
|
},
|
|
102
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "6dac0247c675de94b41038ac1e5095dc5df0c753"
|
|
103
104
|
}
|
package/types/config.d.ts
CHANGED
|
@@ -112,6 +112,64 @@ export interface DbConfig {
|
|
|
112
112
|
*/
|
|
113
113
|
keepDb?: boolean;
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Documentation generation options
|
|
117
|
+
* Controls which doc formats are generated alongside code for each generator target.
|
|
118
|
+
* Applied at the top level and affects all enabled generators (ORM, React Query, CLI).
|
|
119
|
+
*/
|
|
120
|
+
export interface DocsConfig {
|
|
121
|
+
/**
|
|
122
|
+
* Generate README.md — human-readable overview with setup, commands, examples
|
|
123
|
+
* @default true
|
|
124
|
+
*/
|
|
125
|
+
readme?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Generate AGENTS.md — structured markdown optimized for LLM consumption
|
|
128
|
+
* Includes: tool definitions, exact signatures, input/output schemas,
|
|
129
|
+
* workflow recipes, error handling, and machine-parseable sections
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
agents?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Generate mcp.json — MCP (Model Context Protocol) tool definitions
|
|
135
|
+
* Each CLI command becomes a tool with typed inputSchema (JSON Schema)
|
|
136
|
+
* Ready to plug into any MCP-compatible agent
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
mcp?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Generate skills/ directory — per-command .md skill files
|
|
142
|
+
* Each command gets its own skill file with description, usage, and examples
|
|
143
|
+
* Compatible with Devin and similar agent skill systems
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
146
|
+
skills?: boolean;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Infrastructure command name overrides for collision handling.
|
|
150
|
+
* When a target name collides with a default infra command name,
|
|
151
|
+
* the infra command is auto-renamed. These allow user overrides.
|
|
152
|
+
*/
|
|
153
|
+
export interface BuiltinNames {
|
|
154
|
+
auth?: string;
|
|
155
|
+
context?: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* CLI generation configuration
|
|
159
|
+
*/
|
|
160
|
+
export interface CliConfig {
|
|
161
|
+
/**
|
|
162
|
+
* Tool name for appstash config storage (e.g., 'myapp' stores at ~/.myapp/)
|
|
163
|
+
* @default derived from output directory name
|
|
164
|
+
*/
|
|
165
|
+
toolName?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Override infra command names (for collision handling)
|
|
168
|
+
* Defaults: auth -> 'auth' (renamed to 'credentials' on collision),
|
|
169
|
+
* context -> 'context' (renamed to 'env' on collision)
|
|
170
|
+
*/
|
|
171
|
+
builtinNames?: BuiltinNames;
|
|
172
|
+
}
|
|
115
173
|
/**
|
|
116
174
|
* Target configuration for graphql-codegen
|
|
117
175
|
* Represents a single schema source and output destination.
|
|
@@ -130,6 +188,12 @@ export interface GraphQLSDKConfigTarget {
|
|
|
130
188
|
* Path to GraphQL schema file (.graphql) for file-based generation
|
|
131
189
|
*/
|
|
132
190
|
schemaFile?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Path to a directory of .graphql schema files for multi-target generation.
|
|
193
|
+
* Each *.graphql file becomes its own target, named by the filename (without extension).
|
|
194
|
+
* e.g. schemas/app.graphql + schemas/admin.graphql → targets "app" and "admin"
|
|
195
|
+
*/
|
|
196
|
+
schemaDir?: string;
|
|
133
197
|
/**
|
|
134
198
|
* Database configuration for direct database introspection or PGPM module
|
|
135
199
|
* Use db.schemas or db.apiNames to specify which schemas to introspect
|
|
@@ -221,6 +285,20 @@ export interface GraphQLSDKConfigTarget {
|
|
|
221
285
|
* @default false
|
|
222
286
|
*/
|
|
223
287
|
reactQuery?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* CLI generation configuration
|
|
290
|
+
* When enabled, generates inquirerer-based CLI commands to {output}/cli
|
|
291
|
+
* Requires appstash for config storage and inquirerer for prompts
|
|
292
|
+
*/
|
|
293
|
+
cli?: CliConfig | boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Documentation generation options
|
|
296
|
+
* Controls which doc formats are generated alongside code for each generator target.
|
|
297
|
+
* Applied globally to all enabled generators (ORM, React Query, CLI).
|
|
298
|
+
* Set to `true` to enable all formats, or configure individually.
|
|
299
|
+
* @default { readme: true, agents: true, mcp: false, skills: false }
|
|
300
|
+
*/
|
|
301
|
+
docs?: DocsConfig | boolean;
|
|
224
302
|
/**
|
|
225
303
|
* Query key generation configuration
|
|
226
304
|
* Controls how query keys are structured for cache management
|