@constructive-io/graphql-codegen 3.3.2 → 4.0.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/README.md +0 -4
- package/core/ast.js +6 -5
- package/core/codegen/custom-mutations.js +22 -22
- package/core/codegen/custom-queries.js +24 -17
- package/core/codegen/hooks-ast.d.ts +1 -1
- package/core/codegen/hooks-ast.js +22 -5
- package/core/codegen/index.d.ts +1 -1
- package/core/codegen/mutations.js +16 -12
- package/core/codegen/orm/custom-ops-generator.js +37 -3
- package/core/codegen/orm/input-types-generator.js +161 -89
- package/core/codegen/orm/model-generator.js +72 -73
- package/core/codegen/orm/select-types.d.ts +27 -17
- package/core/codegen/queries.js +37 -25
- package/core/codegen/schema-types-generator.js +21 -0
- package/core/codegen/templates/hooks-selection.ts +12 -0
- package/core/codegen/templates/query-builder.ts +103 -59
- package/core/codegen/templates/select-types.ts +59 -33
- package/core/codegen/types.js +26 -0
- package/core/codegen/utils.d.ts +1 -1
- package/core/codegen/utils.js +1 -1
- package/core/custom-ast.js +9 -8
- package/core/database/index.js +2 -3
- package/core/index.d.ts +2 -0
- package/core/index.js +2 -0
- package/core/introspect/infer-tables.js +144 -58
- package/core/introspect/transform-schema.d.ts +1 -1
- package/core/introspect/transform-schema.js +3 -1
- package/esm/core/ast.js +6 -5
- package/esm/core/codegen/custom-mutations.js +23 -23
- package/esm/core/codegen/custom-queries.js +25 -18
- package/esm/core/codegen/hooks-ast.d.ts +1 -1
- package/esm/core/codegen/hooks-ast.js +22 -5
- package/esm/core/codegen/index.d.ts +1 -1
- package/esm/core/codegen/mutations.js +16 -12
- package/esm/core/codegen/orm/custom-ops-generator.js +38 -4
- package/esm/core/codegen/orm/input-types-generator.js +163 -91
- package/esm/core/codegen/orm/model-generator.js +73 -74
- package/esm/core/codegen/orm/select-types.d.ts +27 -17
- package/esm/core/codegen/queries.js +37 -25
- package/esm/core/codegen/schema-types-generator.js +21 -0
- package/esm/core/codegen/types.js +26 -0
- package/esm/core/codegen/utils.d.ts +1 -1
- package/esm/core/codegen/utils.js +1 -1
- package/esm/core/custom-ast.js +9 -8
- package/esm/core/database/index.js +2 -3
- package/esm/core/index.d.ts +2 -0
- package/esm/core/index.js +2 -0
- package/esm/core/introspect/infer-tables.js +144 -58
- package/esm/core/introspect/transform-schema.d.ts +1 -1
- package/esm/core/introspect/transform-schema.js +3 -1
- package/esm/generators/field-selector.js +1 -0
- package/esm/generators/index.d.ts +3 -0
- package/esm/generators/index.js +3 -0
- package/esm/generators/mutations.js +4 -4
- package/esm/generators/select.js +4 -4
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/types/schema.d.ts +5 -3
- package/generators/field-selector.js +1 -0
- package/generators/index.d.ts +3 -0
- package/generators/index.js +3 -0
- package/generators/mutations.js +3 -3
- package/generators/select.js +3 -3
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +10 -10
- package/types/schema.d.ts +5 -3
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @constructive-io/graphql-codegen
|
|
3
3
|
*
|
|
4
4
|
* GraphQL SDK generator for Constructive databases.
|
|
5
|
-
* Introspects via
|
|
5
|
+
* Introspects via standard GraphQL introspection and generates typed queries, mutations,
|
|
6
6
|
* and React Query v5 hooks.
|
|
7
7
|
*/
|
|
8
8
|
export * from './types';
|
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @constructive-io/graphql-codegen
|
|
4
4
|
*
|
|
5
5
|
* GraphQL SDK generator for Constructive databases.
|
|
6
|
-
* Introspects via
|
|
6
|
+
* Introspects via standard GraphQL introspection and generates typed queries, mutations,
|
|
7
7
|
* and React Query v5 hooks.
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-codegen",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "GraphQL SDK generator for Constructive databases with React Query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -56,23 +56,23 @@
|
|
|
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": "^
|
|
60
|
-
"@constructive-io/graphql-types": "^
|
|
59
|
+
"@constructive-io/graphql-server": "^4.0.0",
|
|
60
|
+
"@constructive-io/graphql-types": "^3.0.0",
|
|
61
61
|
"@inquirerer/utils": "^3.2.3",
|
|
62
|
-
"@pgpmjs/core": "^
|
|
62
|
+
"@pgpmjs/core": "^6.0.0",
|
|
63
63
|
"ajv": "^8.17.1",
|
|
64
64
|
"deepmerge": "^4.3.1",
|
|
65
65
|
"find-and-require-package-json": "^0.9.0",
|
|
66
|
-
"gql-ast": "^
|
|
67
|
-
"graphql": "
|
|
66
|
+
"gql-ast": "^3.0.0",
|
|
67
|
+
"graphql": "^16.9.0",
|
|
68
68
|
"inflekt": "^0.3.1",
|
|
69
69
|
"inquirerer": "^4.4.0",
|
|
70
70
|
"jiti": "^2.6.1",
|
|
71
71
|
"oxfmt": "^0.26.0",
|
|
72
|
-
"pg-cache": "^
|
|
72
|
+
"pg-cache": "^3.0.0",
|
|
73
73
|
"pg-env": "^1.4.0",
|
|
74
|
-
"pgsql-client": "^
|
|
75
|
-
"pgsql-seed": "^
|
|
74
|
+
"pgsql-client": "^3.0.0",
|
|
75
|
+
"pgsql-seed": "^2.0.0",
|
|
76
76
|
"undici": "^7.19.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"tsx": "^4.21.0",
|
|
100
100
|
"typescript": "^5.9.3"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "b2daeefe49cdefb3d01ea63cf778fb9b847ab5fe"
|
|
103
103
|
}
|
package/types/schema.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface CleanTable {
|
|
|
11
11
|
relations: CleanRelations;
|
|
12
12
|
/** PostGraphile inflection rules for this table */
|
|
13
13
|
inflection?: TableInflection;
|
|
14
|
-
/** Query operation names from
|
|
14
|
+
/** Query operation names from introspection */
|
|
15
15
|
query?: TableQueryNames;
|
|
16
16
|
/** Constraint information */
|
|
17
17
|
constraints?: TableConstraints;
|
|
@@ -66,19 +66,21 @@ export interface TableInflection {
|
|
|
66
66
|
updatePayloadType: string | null;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* Query operation names from
|
|
69
|
+
* Query operation names from introspection
|
|
70
70
|
*/
|
|
71
71
|
export interface TableQueryNames {
|
|
72
72
|
/** All rows query name */
|
|
73
73
|
all: string;
|
|
74
74
|
/** Single row query name */
|
|
75
|
-
one: string;
|
|
75
|
+
one: string | null;
|
|
76
76
|
/** Create mutation name */
|
|
77
77
|
create: string;
|
|
78
78
|
/** Update mutation name */
|
|
79
79
|
update: string | null;
|
|
80
80
|
/** Delete mutation name */
|
|
81
81
|
delete: string | null;
|
|
82
|
+
/** Patch field name in update mutation input (e.g., "userPatch" for UpdateUserInput) */
|
|
83
|
+
patchFieldName?: string;
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* Table constraints
|