@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.
Files changed (75) hide show
  1. package/client/error.d.ts +2 -93
  2. package/client/error.js +9 -273
  3. package/client/execute.d.ts +2 -55
  4. package/client/execute.js +5 -120
  5. package/client/typed-document.d.ts +2 -29
  6. package/client/typed-document.js +3 -39
  7. package/core/ast.d.ts +8 -10
  8. package/core/ast.js +17 -592
  9. package/core/custom-ast.d.ts +5 -33
  10. package/core/custom-ast.js +16 -203
  11. package/core/introspect/infer-tables.d.ts +2 -40
  12. package/core/introspect/infer-tables.js +4 -653
  13. package/core/introspect/schema-query.d.ts +3 -18
  14. package/core/introspect/schema-query.js +3 -118
  15. package/core/introspect/transform-schema.d.ts +2 -84
  16. package/core/introspect/transform-schema.js +14 -279
  17. package/core/introspect/transform.d.ts +2 -18
  18. package/core/introspect/transform.js +6 -39
  19. package/core/meta-object/convert.d.ts +2 -63
  20. package/core/meta-object/convert.js +4 -59
  21. package/core/meta-object/validate.d.ts +2 -7
  22. package/core/meta-object/validate.js +4 -30
  23. package/core/query-builder.d.ts +7 -46
  24. package/core/query-builder.js +8 -408
  25. package/core/types.d.ts +9 -139
  26. package/core/types.js +12 -26
  27. package/esm/client/error.d.ts +2 -93
  28. package/esm/client/error.js +2 -269
  29. package/esm/client/execute.d.ts +2 -55
  30. package/esm/client/execute.js +2 -118
  31. package/esm/client/typed-document.d.ts +2 -29
  32. package/esm/client/typed-document.js +2 -38
  33. package/esm/core/ast.d.ts +8 -10
  34. package/esm/core/ast.js +8 -550
  35. package/esm/core/custom-ast.d.ts +5 -33
  36. package/esm/core/custom-ast.js +5 -160
  37. package/esm/core/introspect/infer-tables.d.ts +2 -40
  38. package/esm/core/introspect/infer-tables.js +2 -652
  39. package/esm/core/introspect/schema-query.d.ts +3 -18
  40. package/esm/core/introspect/schema-query.js +2 -118
  41. package/esm/core/introspect/transform-schema.d.ts +2 -84
  42. package/esm/core/introspect/transform-schema.js +2 -269
  43. package/esm/core/introspect/transform.d.ts +2 -18
  44. package/esm/core/introspect/transform.js +2 -36
  45. package/esm/core/meta-object/convert.d.ts +2 -63
  46. package/esm/core/meta-object/convert.js +2 -58
  47. package/esm/core/meta-object/validate.d.ts +2 -7
  48. package/esm/core/meta-object/validate.js +2 -26
  49. package/esm/core/query-builder.d.ts +7 -46
  50. package/esm/core/query-builder.js +5 -373
  51. package/esm/core/types.d.ts +9 -139
  52. package/esm/core/types.js +9 -24
  53. package/esm/generators/field-selector.d.ts +5 -28
  54. package/esm/generators/field-selector.js +5 -354
  55. package/esm/generators/mutations.d.ts +5 -29
  56. package/esm/generators/mutations.js +5 -195
  57. package/esm/generators/naming-helpers.d.ts +6 -0
  58. package/esm/generators/naming-helpers.js +6 -0
  59. package/esm/generators/select.d.ts +6 -48
  60. package/esm/generators/select.js +6 -634
  61. package/esm/types/query.d.ts +9 -0
  62. package/esm/types/schema.d.ts +4 -0
  63. package/generators/field-selector.d.ts +5 -28
  64. package/generators/field-selector.js +12 -360
  65. package/generators/mutations.d.ts +5 -29
  66. package/generators/mutations.js +9 -231
  67. package/generators/naming-helpers.d.ts +6 -0
  68. package/generators/naming-helpers.js +20 -0
  69. package/generators/select.d.ts +6 -48
  70. package/generators/select.js +17 -677
  71. package/package.json +7 -6
  72. package/types/query.d.ts +9 -0
  73. package/types/schema.d.ts +4 -0
  74. package/core/meta-object/format.json +0 -93
  75. 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; } });
@@ -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
- * Convert PascalCase table name to camelCase plural for GraphQL queries
8
- * Uses the inflection library for proper pluralization
9
- * Example: "ActionGoal" -> "actionGoals", "User" -> "users", "Person" -> "people"
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 declare function toCamelCasePlural(tableName: string): string;
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';