@constructive-io/graphql-codegen 4.6.0 → 4.7.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/client/error.d.ts +2 -93
- package/client/error.js +9 -273
- package/client/execute.d.ts +2 -55
- package/client/execute.js +5 -120
- package/client/typed-document.d.ts +2 -29
- package/client/typed-document.js +3 -39
- package/core/ast.d.ts +8 -10
- package/core/ast.js +17 -592
- package/core/custom-ast.d.ts +5 -33
- package/core/custom-ast.js +16 -203
- package/core/introspect/infer-tables.d.ts +2 -40
- package/core/introspect/infer-tables.js +4 -653
- package/core/introspect/schema-query.d.ts +3 -18
- package/core/introspect/schema-query.js +3 -118
- package/core/introspect/transform-schema.d.ts +2 -84
- package/core/introspect/transform-schema.js +14 -279
- package/core/introspect/transform.d.ts +2 -18
- package/core/introspect/transform.js +6 -39
- package/core/meta-object/convert.d.ts +2 -63
- package/core/meta-object/convert.js +4 -59
- package/core/meta-object/validate.d.ts +2 -7
- package/core/meta-object/validate.js +4 -30
- package/core/query-builder.d.ts +7 -46
- package/core/query-builder.js +8 -408
- package/core/types.d.ts +9 -139
- package/core/types.js +12 -26
- package/esm/client/error.d.ts +2 -93
- package/esm/client/error.js +2 -269
- package/esm/client/execute.d.ts +2 -55
- package/esm/client/execute.js +2 -118
- package/esm/client/typed-document.d.ts +2 -29
- package/esm/client/typed-document.js +2 -38
- package/esm/core/ast.d.ts +8 -10
- package/esm/core/ast.js +8 -550
- package/esm/core/custom-ast.d.ts +5 -33
- package/esm/core/custom-ast.js +5 -160
- package/esm/core/introspect/infer-tables.d.ts +2 -40
- package/esm/core/introspect/infer-tables.js +2 -652
- package/esm/core/introspect/schema-query.d.ts +3 -18
- package/esm/core/introspect/schema-query.js +2 -118
- package/esm/core/introspect/transform-schema.d.ts +2 -84
- package/esm/core/introspect/transform-schema.js +2 -269
- package/esm/core/introspect/transform.d.ts +2 -18
- package/esm/core/introspect/transform.js +2 -36
- package/esm/core/meta-object/convert.d.ts +2 -63
- package/esm/core/meta-object/convert.js +2 -58
- package/esm/core/meta-object/validate.d.ts +2 -7
- package/esm/core/meta-object/validate.js +2 -26
- package/esm/core/query-builder.d.ts +7 -46
- package/esm/core/query-builder.js +5 -373
- package/esm/core/types.d.ts +9 -139
- package/esm/core/types.js +9 -24
- package/esm/generators/field-selector.d.ts +5 -28
- package/esm/generators/field-selector.js +5 -354
- package/esm/generators/mutations.d.ts +5 -29
- package/esm/generators/mutations.js +5 -195
- package/esm/generators/naming-helpers.d.ts +6 -0
- package/esm/generators/naming-helpers.js +6 -0
- package/esm/generators/select.d.ts +6 -48
- package/esm/generators/select.js +6 -634
- package/esm/types/query.d.ts +9 -0
- package/esm/types/schema.d.ts +4 -0
- package/generators/field-selector.d.ts +5 -28
- package/generators/field-selector.js +12 -360
- package/generators/mutations.d.ts +5 -29
- package/generators/mutations.js +9 -231
- package/generators/naming-helpers.d.ts +6 -0
- package/generators/naming-helpers.js +20 -0
- package/generators/select.d.ts +6 -48
- package/generators/select.js +17 -677
- package/package.json +7 -6
- package/types/query.d.ts +9 -0
- package/types/schema.d.ts +4 -0
- package/core/meta-object/format.json +0 -93
- package/esm/core/meta-object/format.json +0 -93
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export naming helpers from @constructive-io/graphql-query.
|
|
3
|
+
*
|
|
4
|
+
* Server-aware inflection naming functions now live in graphql-query.
|
|
5
|
+
*/
|
|
6
|
+
export { normalizeInflectionValue, toCamelCaseSingular, toCreateMutationName, toUpdateMutationName, toDeleteMutationName, toCreateInputTypeName, toUpdateInputTypeName, toDeleteInputTypeName, toFilterTypeName, toPatchFieldName, toOrderByEnumValue, } from '@constructive-io/graphql-query';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toOrderByEnumValue = exports.toPatchFieldName = exports.toFilterTypeName = exports.toDeleteInputTypeName = exports.toUpdateInputTypeName = exports.toCreateInputTypeName = exports.toDeleteMutationName = exports.toUpdateMutationName = exports.toCreateMutationName = exports.toCamelCaseSingular = exports.normalizeInflectionValue = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Re-export naming helpers from @constructive-io/graphql-query.
|
|
6
|
+
*
|
|
7
|
+
* Server-aware inflection naming functions now live in graphql-query.
|
|
8
|
+
*/
|
|
9
|
+
var graphql_query_1 = require("@constructive-io/graphql-query");
|
|
10
|
+
Object.defineProperty(exports, "normalizeInflectionValue", { enumerable: true, get: function () { return graphql_query_1.normalizeInflectionValue; } });
|
|
11
|
+
Object.defineProperty(exports, "toCamelCaseSingular", { enumerable: true, get: function () { return graphql_query_1.toCamelCaseSingular; } });
|
|
12
|
+
Object.defineProperty(exports, "toCreateMutationName", { enumerable: true, get: function () { return graphql_query_1.toCreateMutationName; } });
|
|
13
|
+
Object.defineProperty(exports, "toUpdateMutationName", { enumerable: true, get: function () { return graphql_query_1.toUpdateMutationName; } });
|
|
14
|
+
Object.defineProperty(exports, "toDeleteMutationName", { enumerable: true, get: function () { return graphql_query_1.toDeleteMutationName; } });
|
|
15
|
+
Object.defineProperty(exports, "toCreateInputTypeName", { enumerable: true, get: function () { return graphql_query_1.toCreateInputTypeName; } });
|
|
16
|
+
Object.defineProperty(exports, "toUpdateInputTypeName", { enumerable: true, get: function () { return graphql_query_1.toUpdateInputTypeName; } });
|
|
17
|
+
Object.defineProperty(exports, "toDeleteInputTypeName", { enumerable: true, get: function () { return graphql_query_1.toDeleteInputTypeName; } });
|
|
18
|
+
Object.defineProperty(exports, "toFilterTypeName", { enumerable: true, get: function () { return graphql_query_1.toFilterTypeName; } });
|
|
19
|
+
Object.defineProperty(exports, "toPatchFieldName", { enumerable: true, get: function () { return graphql_query_1.toPatchFieldName; } });
|
|
20
|
+
Object.defineProperty(exports, "toOrderByEnumValue", { enumerable: true, get: function () { return graphql_query_1.toOrderByEnumValue; } });
|
package/generators/select.d.ts
CHANGED
|
@@ -1,50 +1,8 @@
|
|
|
1
|
-
import { TypedDocumentString } from '../client/typed-document';
|
|
2
|
-
import { QueryBuilder } from '../core/query-builder';
|
|
3
|
-
import type { IntrospectionSchema, MetaObject } from '../core/types';
|
|
4
|
-
import type { QueryOptions } from '../types/query';
|
|
5
|
-
import type { CleanTable } from '../types/schema';
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2
|
+
* Re-export select query generators from @constructive-io/graphql-query.
|
|
3
|
+
*
|
|
4
|
+
* The canonical implementations of buildSelect, buildFindOne, buildCount,
|
|
5
|
+
* cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema,
|
|
6
|
+
* toCamelCasePlural, and toOrderByTypeName now live in graphql-query.
|
|
10
7
|
*/
|
|
11
|
-
export
|
|
12
|
-
/**
|
|
13
|
-
* Generate the PostGraphile OrderBy enum type name for a table
|
|
14
|
-
* PostGraphile uses pluralized PascalCase: "Product" -> "ProductsOrderBy"
|
|
15
|
-
* Example: "Product" -> "ProductsOrderBy", "Person" -> "PeopleOrderBy"
|
|
16
|
-
*/
|
|
17
|
-
export declare function toOrderByTypeName(tableName: string): string;
|
|
18
|
-
/**
|
|
19
|
-
* Convert CleanTable to MetaObject format for QueryBuilder
|
|
20
|
-
*/
|
|
21
|
-
export declare function cleanTableToMetaObject(tables: CleanTable[]): MetaObject;
|
|
22
|
-
/**
|
|
23
|
-
* Generate basic IntrospectionSchema from CleanTable array
|
|
24
|
-
* This creates a minimal schema for AST generation
|
|
25
|
-
*/
|
|
26
|
-
export declare function generateIntrospectionSchema(tables: CleanTable[]): IntrospectionSchema;
|
|
27
|
-
/**
|
|
28
|
-
* Create AST-based query builder for a table
|
|
29
|
-
*/
|
|
30
|
-
export declare function createASTQueryBuilder(tables: CleanTable[]): QueryBuilder;
|
|
31
|
-
/**
|
|
32
|
-
* Build a SELECT query for a table with optional filtering, sorting, and pagination
|
|
33
|
-
* Uses direct AST generation without intermediate conversions
|
|
34
|
-
*/
|
|
35
|
-
export declare function buildSelect(table: CleanTable, allTables: readonly CleanTable[], options?: QueryOptions): TypedDocumentString<Record<string, unknown>, QueryOptions>;
|
|
36
|
-
/**
|
|
37
|
-
* Build a single row query by primary key or unique field
|
|
38
|
-
*/
|
|
39
|
-
export declare function buildFindOne(table: CleanTable, _pkField?: string): TypedDocumentString<Record<string, unknown>, Record<string, unknown>>;
|
|
40
|
-
/**
|
|
41
|
-
* Build a count query for a table
|
|
42
|
-
*/
|
|
43
|
-
export declare function buildCount(table: CleanTable): TypedDocumentString<{
|
|
44
|
-
[key: string]: {
|
|
45
|
-
totalCount: number;
|
|
46
|
-
};
|
|
47
|
-
}, {
|
|
48
|
-
condition?: Record<string, unknown>;
|
|
49
|
-
filter?: Record<string, unknown>;
|
|
50
|
-
}>;
|
|
8
|
+
export { buildSelect, buildFindOne, buildCount, cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema, toCamelCasePlural, toOrderByTypeName, } from '@constructive-io/graphql-query';
|