@constructive-io/graphql-codegen 5.3.0 → 5.4.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.
@@ -2,7 +2,7 @@
2
2
  * API Schemas Resolution
3
3
  *
4
4
  * Utilities for resolving PostgreSQL schema names from API names
5
- * by querying the constructive_routing_public.api_schemas table.
5
+ * by querying the routing_public.api_schemas table.
6
6
  */
7
7
  import { Pool } from 'pg';
8
8
  /**
@@ -16,7 +16,7 @@ export interface RoutingSchemaValidation {
16
16
  * Validate that the required routing schemas exist in the database
17
17
  *
18
18
  * Checks for:
19
- * - constructive_routing_public schema with apis and api_schemas tables
19
+ * - routing_public schema with apis and api_schemas tables
20
20
  * - metaschema_public schema with schema table
21
21
  *
22
22
  * @param pool - Database connection pool
@@ -24,9 +24,9 @@ export interface RoutingSchemaValidation {
24
24
  */
25
25
  export declare function validateRoutingSchemas(pool: Pool): Promise<RoutingSchemaValidation>;
26
26
  /**
27
- * Resolve schema names from API names by querying constructive_routing_public.api_schemas
27
+ * Resolve schema names from API names by querying routing_public.api_schemas
28
28
  *
29
- * Joins constructive_routing_public.apis, constructive_routing_public.api_schemas, and metaschema_public.schema
29
+ * Joins routing_public.apis, routing_public.api_schemas, and metaschema_public.schema
30
30
  * to get the actual PostgreSQL schema names for the given API names.
31
31
  *
32
32
  * @param pool - Database connection pool
@@ -9,7 +9,7 @@ const pg_env_1 = require("pg-env");
9
9
  * Validate that the required routing schemas exist in the database
10
10
  *
11
11
  * Checks for:
12
- * - constructive_routing_public schema with apis and api_schemas tables
12
+ * - routing_public schema with apis and api_schemas tables
13
13
  * - metaschema_public schema with schema table
14
14
  *
15
15
  * @param pool - Database connection pool
@@ -17,28 +17,28 @@ const pg_env_1 = require("pg-env");
17
17
  */
18
18
  async function validateRoutingSchemas(pool) {
19
19
  try {
20
- // Check for constructive_routing_public.apis table
20
+ // Check for routing_public.apis table
21
21
  const apisCheck = await pool.query(`
22
22
  SELECT 1 FROM information_schema.tables
23
- WHERE table_schema = 'constructive_routing_public'
23
+ WHERE table_schema = 'routing_public'
24
24
  AND table_name = 'apis'
25
25
  `);
26
26
  if (apisCheck.rows.length === 0) {
27
27
  return {
28
28
  valid: false,
29
- error: 'constructive_routing_public.apis table not found. The database must have the routing schema deployed.',
29
+ error: 'routing_public.apis table not found. The database must have the routing schema deployed.',
30
30
  };
31
31
  }
32
- // Check for constructive_routing_public.api_schemas table
32
+ // Check for routing_public.api_schemas table
33
33
  const apiSchemasCheck = await pool.query(`
34
34
  SELECT 1 FROM information_schema.tables
35
- WHERE table_schema = 'constructive_routing_public'
35
+ WHERE table_schema = 'routing_public'
36
36
  AND table_name = 'api_schemas'
37
37
  `);
38
38
  if (apiSchemasCheck.rows.length === 0) {
39
39
  return {
40
40
  valid: false,
41
- error: 'constructive_routing_public.api_schemas table not found. The database must have the routing schema deployed.',
41
+ error: 'routing_public.api_schemas table not found. The database must have the routing schema deployed.',
42
42
  };
43
43
  }
44
44
  // Check for metaschema_public.schema table
@@ -63,9 +63,9 @@ async function validateRoutingSchemas(pool) {
63
63
  }
64
64
  }
65
65
  /**
66
- * Resolve schema names from API names by querying constructive_routing_public.api_schemas
66
+ * Resolve schema names from API names by querying routing_public.api_schemas
67
67
  *
68
- * Joins constructive_routing_public.apis, constructive_routing_public.api_schemas, and metaschema_public.schema
68
+ * Joins routing_public.apis, routing_public.api_schemas, and metaschema_public.schema
69
69
  * to get the actual PostgreSQL schema names for the given API names.
70
70
  *
71
71
  * @param pool - Database connection pool
@@ -82,15 +82,15 @@ async function resolveApiSchemas(pool, apiNames) {
82
82
  // Query to get schema names for the given API names
83
83
  const result = await pool.query(`
84
84
  SELECT DISTINCT ms.schema_name
85
- FROM constructive_routing_public.api_schemas as_tbl
86
- JOIN constructive_routing_public.apis api ON api.id = as_tbl.api_id
85
+ FROM routing_public.api_schemas as_tbl
86
+ JOIN routing_public.apis api ON api.id = as_tbl.api_id
87
87
  JOIN metaschema_public.schema ms ON ms.id = as_tbl.schema_id
88
88
  WHERE api.name = ANY($1)
89
89
  ORDER BY ms.schema_name
90
90
  `, [apiNames]);
91
91
  if (result.rows.length === 0) {
92
92
  throw new Error(`No schemas found for API names: ${apiNames.join(', ')}. ` +
93
- 'Ensure the APIs exist and have schemas assigned in constructive_routing_public.api_schemas.');
93
+ 'Ensure the APIs exist and have schemas assigned in routing_public.api_schemas.');
94
94
  }
95
95
  return result.rows.map((row) => row.schema_name);
96
96
  }
@@ -13,7 +13,7 @@ export interface DatabaseSchemaSourceOptions {
13
13
  schemas?: string[];
14
14
  /**
15
15
  * API names to resolve schemas from
16
- * Queries constructive_routing_public.api_schemas to get schema names
16
+ * Queries routing_public.api_schemas to get schema names
17
17
  * Mutually exclusive with schemas
18
18
  */
19
19
  apiNames?: string[];
@@ -15,7 +15,7 @@ export interface PgpmModulePathOptions {
15
15
  schemas?: string[];
16
16
  /**
17
17
  * API names to resolve schemas from
18
- * Queries constructive_routing_public.api_schemas to get schema names
18
+ * Queries routing_public.api_schemas to get schema names
19
19
  * Mutually exclusive with schemas
20
20
  */
21
21
  apiNames?: string[];
@@ -45,7 +45,7 @@ export interface PgpmWorkspaceOptions {
45
45
  schemas?: string[];
46
46
  /**
47
47
  * API names to resolve schemas from
48
- * Queries constructive_routing_public.api_schemas to get schema names
48
+ * Queries routing_public.api_schemas to get schema names
49
49
  * Mutually exclusive with schemas
50
50
  */
51
51
  apiNames?: string[];
@@ -2,7 +2,7 @@
2
2
  * API Schemas Resolution
3
3
  *
4
4
  * Utilities for resolving PostgreSQL schema names from API names
5
- * by querying the constructive_routing_public.api_schemas table.
5
+ * by querying the routing_public.api_schemas table.
6
6
  */
7
7
  import { Pool } from 'pg';
8
8
  /**
@@ -16,7 +16,7 @@ export interface RoutingSchemaValidation {
16
16
  * Validate that the required routing schemas exist in the database
17
17
  *
18
18
  * Checks for:
19
- * - constructive_routing_public schema with apis and api_schemas tables
19
+ * - routing_public schema with apis and api_schemas tables
20
20
  * - metaschema_public schema with schema table
21
21
  *
22
22
  * @param pool - Database connection pool
@@ -24,9 +24,9 @@ export interface RoutingSchemaValidation {
24
24
  */
25
25
  export declare function validateRoutingSchemas(pool: Pool): Promise<RoutingSchemaValidation>;
26
26
  /**
27
- * Resolve schema names from API names by querying constructive_routing_public.api_schemas
27
+ * Resolve schema names from API names by querying routing_public.api_schemas
28
28
  *
29
- * Joins constructive_routing_public.apis, constructive_routing_public.api_schemas, and metaschema_public.schema
29
+ * Joins routing_public.apis, routing_public.api_schemas, and metaschema_public.schema
30
30
  * to get the actual PostgreSQL schema names for the given API names.
31
31
  *
32
32
  * @param pool - Database connection pool
@@ -4,7 +4,7 @@ import { getPgEnvOptions } from 'pg-env';
4
4
  * Validate that the required routing schemas exist in the database
5
5
  *
6
6
  * Checks for:
7
- * - constructive_routing_public schema with apis and api_schemas tables
7
+ * - routing_public schema with apis and api_schemas tables
8
8
  * - metaschema_public schema with schema table
9
9
  *
10
10
  * @param pool - Database connection pool
@@ -12,28 +12,28 @@ import { getPgEnvOptions } from 'pg-env';
12
12
  */
13
13
  export async function validateRoutingSchemas(pool) {
14
14
  try {
15
- // Check for constructive_routing_public.apis table
15
+ // Check for routing_public.apis table
16
16
  const apisCheck = await pool.query(`
17
17
  SELECT 1 FROM information_schema.tables
18
- WHERE table_schema = 'constructive_routing_public'
18
+ WHERE table_schema = 'routing_public'
19
19
  AND table_name = 'apis'
20
20
  `);
21
21
  if (apisCheck.rows.length === 0) {
22
22
  return {
23
23
  valid: false,
24
- error: 'constructive_routing_public.apis table not found. The database must have the routing schema deployed.',
24
+ error: 'routing_public.apis table not found. The database must have the routing schema deployed.',
25
25
  };
26
26
  }
27
- // Check for constructive_routing_public.api_schemas table
27
+ // Check for routing_public.api_schemas table
28
28
  const apiSchemasCheck = await pool.query(`
29
29
  SELECT 1 FROM information_schema.tables
30
- WHERE table_schema = 'constructive_routing_public'
30
+ WHERE table_schema = 'routing_public'
31
31
  AND table_name = 'api_schemas'
32
32
  `);
33
33
  if (apiSchemasCheck.rows.length === 0) {
34
34
  return {
35
35
  valid: false,
36
- error: 'constructive_routing_public.api_schemas table not found. The database must have the routing schema deployed.',
36
+ error: 'routing_public.api_schemas table not found. The database must have the routing schema deployed.',
37
37
  };
38
38
  }
39
39
  // Check for metaschema_public.schema table
@@ -58,9 +58,9 @@ export async function validateRoutingSchemas(pool) {
58
58
  }
59
59
  }
60
60
  /**
61
- * Resolve schema names from API names by querying constructive_routing_public.api_schemas
61
+ * Resolve schema names from API names by querying routing_public.api_schemas
62
62
  *
63
- * Joins constructive_routing_public.apis, constructive_routing_public.api_schemas, and metaschema_public.schema
63
+ * Joins routing_public.apis, routing_public.api_schemas, and metaschema_public.schema
64
64
  * to get the actual PostgreSQL schema names for the given API names.
65
65
  *
66
66
  * @param pool - Database connection pool
@@ -77,15 +77,15 @@ export async function resolveApiSchemas(pool, apiNames) {
77
77
  // Query to get schema names for the given API names
78
78
  const result = await pool.query(`
79
79
  SELECT DISTINCT ms.schema_name
80
- FROM constructive_routing_public.api_schemas as_tbl
81
- JOIN constructive_routing_public.apis api ON api.id = as_tbl.api_id
80
+ FROM routing_public.api_schemas as_tbl
81
+ JOIN routing_public.apis api ON api.id = as_tbl.api_id
82
82
  JOIN metaschema_public.schema ms ON ms.id = as_tbl.schema_id
83
83
  WHERE api.name = ANY($1)
84
84
  ORDER BY ms.schema_name
85
85
  `, [apiNames]);
86
86
  if (result.rows.length === 0) {
87
87
  throw new Error(`No schemas found for API names: ${apiNames.join(', ')}. ` +
88
- 'Ensure the APIs exist and have schemas assigned in constructive_routing_public.api_schemas.');
88
+ 'Ensure the APIs exist and have schemas assigned in routing_public.api_schemas.');
89
89
  }
90
90
  return result.rows.map((row) => row.schema_name);
91
91
  }
@@ -13,7 +13,7 @@ export interface DatabaseSchemaSourceOptions {
13
13
  schemas?: string[];
14
14
  /**
15
15
  * API names to resolve schemas from
16
- * Queries constructive_routing_public.api_schemas to get schema names
16
+ * Queries routing_public.api_schemas to get schema names
17
17
  * Mutually exclusive with schemas
18
18
  */
19
19
  apiNames?: string[];
@@ -15,7 +15,7 @@ export interface PgpmModulePathOptions {
15
15
  schemas?: string[];
16
16
  /**
17
17
  * API names to resolve schemas from
18
- * Queries constructive_routing_public.api_schemas to get schema names
18
+ * Queries routing_public.api_schemas to get schema names
19
19
  * Mutually exclusive with schemas
20
20
  */
21
21
  apiNames?: string[];
@@ -45,7 +45,7 @@ export interface PgpmWorkspaceOptions {
45
45
  schemas?: string[];
46
46
  /**
47
47
  * API names to resolve schemas from
48
- * Queries constructive_routing_public.api_schemas to get schema names
48
+ * Queries routing_public.api_schemas to get schema names
49
49
  * Mutually exclusive with schemas
50
50
  */
51
51
  apiNames?: string[];
@@ -100,7 +100,7 @@ export interface DbConfig {
100
100
  schemas?: string[];
101
101
  /**
102
102
  * API names to resolve schemas from
103
- * Queries constructive_routing_public.api_schemas to automatically determine schemas
103
+ * Queries routing_public.api_schemas to automatically determine schemas
104
104
  * Mutually exclusive with `schemas`
105
105
  * @example ['my_api']
106
106
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-codegen",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "GraphQL SDK generator for Constructive databases with React Query hooks",
5
5
  "keywords": [
6
6
  "graphql",
@@ -56,15 +56,15 @@
56
56
  "@0no-co/graphql.web": "^1.1.2",
57
57
  "@babel/generator": "^7.29.1",
58
58
  "@babel/types": "^7.29.0",
59
- "@constructive-io/graphql-query": "^4.2.0",
59
+ "@constructive-io/graphql-query": "^4.2.1",
60
60
  "@constructive-io/graphql-types": "^3.19.0",
61
61
  "@inquirerer/utils": "^3.3.9",
62
- "@pgpmjs/core": "^7.4.2",
62
+ "@pgpmjs/core": "^7.5.0",
63
63
  "ajv": "^8.20.0",
64
64
  "deepmerge": "^4.3.1",
65
65
  "find-and-require-package-json": "^0.9.1",
66
66
  "gql-ast": "^3.14.2",
67
- "graphile-schema": "^2.2.0",
67
+ "graphile-schema": "^2.2.1",
68
68
  "graphql": "16.13.0",
69
69
  "inflekt": "^0.7.1",
70
70
  "inquirerer": "^4.9.1",
@@ -72,8 +72,8 @@
72
72
  "oxfmt": "^0.51.0",
73
73
  "pg-cache": "^3.16.2",
74
74
  "pg-env": "^1.19.2",
75
- "pgsql-client": "^4.1.2",
76
- "pgsql-seed": "^3.1.2",
75
+ "pgsql-client": "^4.1.3",
76
+ "pgsql-seed": "^3.1.3",
77
77
  "query-spec": "^0.2.2",
78
78
  "undici": "^8.3.0"
79
79
  },
@@ -101,5 +101,5 @@
101
101
  "tsx": "^4.21.0",
102
102
  "typescript": "^5.9.3"
103
103
  },
104
- "gitHead": "518e7ab2270661c64875258436d90fdf76b4b336"
104
+ "gitHead": "763dcb96747f941fbf0cd5e5f733f19da286fc23"
105
105
  }
package/types/config.d.ts CHANGED
@@ -100,7 +100,7 @@ export interface DbConfig {
100
100
  schemas?: string[];
101
101
  /**
102
102
  * API names to resolve schemas from
103
- * Queries constructive_routing_public.api_schemas to automatically determine schemas
103
+ * Queries routing_public.api_schemas to automatically determine schemas
104
104
  * Mutually exclusive with `schemas`
105
105
  * @example ['my_api']
106
106
  */