@constructive-io/graphql-codegen 4.17.1 → 4.18.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/core/codegen/barrel.d.ts +6 -6
- package/core/codegen/cli/arg-mapper.d.ts +3 -3
- package/core/codegen/cli/command-map-generator.d.ts +4 -4
- package/core/codegen/cli/custom-command-generator.d.ts +2 -2
- package/core/codegen/cli/docs-generator.d.ts +7 -7
- package/core/codegen/cli/index.d.ts +7 -7
- package/core/codegen/cli/table-command-generator.d.ts +3 -3
- package/core/codegen/custom-mutations.d.ts +3 -3
- package/core/codegen/custom-queries.d.ts +3 -3
- package/core/codegen/docs-utils.d.ts +10 -10
- package/core/codegen/docs-utils.js +1 -1
- package/core/codegen/hooks-ast.d.ts +4 -4
- package/core/codegen/hooks-docs-generator.d.ts +5 -5
- package/core/codegen/index.d.ts +5 -5
- package/core/codegen/invalidation.d.ts +2 -2
- package/core/codegen/mutation-keys.d.ts +3 -3
- package/core/codegen/mutations.d.ts +5 -5
- package/core/codegen/orm/barrel.d.ts +2 -2
- package/core/codegen/orm/client-generator.d.ts +2 -2
- package/core/codegen/orm/custom-ops-generator.d.ts +3 -3
- package/core/codegen/orm/custom-ops-generator.js +1 -1
- package/core/codegen/orm/docs-generator.d.ts +5 -5
- package/core/codegen/orm/index.d.ts +4 -4
- package/core/codegen/orm/input-types-generator.d.ts +4 -4
- package/core/codegen/orm/input-types-generator.js +1 -1
- package/core/codegen/orm/model-generator.d.ts +3 -3
- package/core/codegen/queries.d.ts +4 -4
- package/core/codegen/query-keys.d.ts +3 -3
- package/core/codegen/select-helpers.d.ts +3 -3
- package/core/codegen/shared/index.d.ts +4 -4
- package/core/codegen/type-resolver.d.ts +10 -10
- package/core/codegen/type-resolver.js +3 -3
- package/core/codegen/types.d.ts +2 -2
- package/core/codegen/utils.d.ts +34 -34
- package/core/codegen/utils.js +1 -1
- package/core/generate.d.ts +4 -4
- package/core/introspect/index.d.ts +1 -1
- package/core/introspect/source/database.js +6 -2
- package/core/introspect/source/types.d.ts +37 -0
- package/core/pipeline/index.d.ts +5 -5
- package/esm/core/codegen/barrel.d.ts +6 -6
- package/esm/core/codegen/cli/arg-mapper.d.ts +3 -3
- package/esm/core/codegen/cli/command-map-generator.d.ts +4 -4
- package/esm/core/codegen/cli/custom-command-generator.d.ts +2 -2
- package/esm/core/codegen/cli/docs-generator.d.ts +7 -7
- package/esm/core/codegen/cli/index.d.ts +7 -7
- package/esm/core/codegen/cli/table-command-generator.d.ts +3 -3
- package/esm/core/codegen/custom-mutations.d.ts +3 -3
- package/esm/core/codegen/custom-queries.d.ts +3 -3
- package/esm/core/codegen/docs-utils.d.ts +10 -10
- package/esm/core/codegen/docs-utils.js +1 -1
- package/esm/core/codegen/hooks-ast.d.ts +4 -4
- package/esm/core/codegen/hooks-docs-generator.d.ts +5 -5
- package/esm/core/codegen/index.d.ts +5 -5
- package/esm/core/codegen/invalidation.d.ts +2 -2
- package/esm/core/codegen/mutation-keys.d.ts +3 -3
- package/esm/core/codegen/mutations.d.ts +5 -5
- package/esm/core/codegen/orm/barrel.d.ts +2 -2
- package/esm/core/codegen/orm/client-generator.d.ts +2 -2
- package/esm/core/codegen/orm/custom-ops-generator.d.ts +3 -3
- package/esm/core/codegen/orm/custom-ops-generator.js +1 -1
- package/esm/core/codegen/orm/docs-generator.d.ts +5 -5
- package/esm/core/codegen/orm/index.d.ts +4 -4
- package/esm/core/codegen/orm/input-types-generator.d.ts +4 -4
- package/esm/core/codegen/orm/input-types-generator.js +1 -1
- package/esm/core/codegen/orm/model-generator.d.ts +3 -3
- package/esm/core/codegen/queries.d.ts +4 -4
- package/esm/core/codegen/query-keys.d.ts +3 -3
- package/esm/core/codegen/select-helpers.d.ts +3 -3
- package/esm/core/codegen/shared/index.d.ts +4 -4
- package/esm/core/codegen/type-resolver.d.ts +10 -10
- package/esm/core/codegen/type-resolver.js +3 -3
- package/esm/core/codegen/types.d.ts +2 -2
- package/esm/core/codegen/utils.d.ts +34 -34
- package/esm/core/codegen/utils.js +1 -1
- package/esm/core/generate.d.ts +4 -4
- package/esm/core/introspect/index.d.ts +1 -1
- package/esm/core/introspect/source/database.js +7 -3
- package/esm/core/introspect/source/types.d.ts +37 -0
- package/esm/core/pipeline/index.d.ts +5 -5
- package/esm/types/index.d.ts +1 -1
- package/esm/types/schema.d.ts +41 -33
- package/package.json +4 -4
- package/types/index.d.ts +1 -1
- package/types/schema.d.ts +41 -33
package/types/schema.d.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents a database table with its fields and relations
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface Table {
|
|
9
9
|
name: string;
|
|
10
10
|
/** Description from PostgreSQL COMMENT (smart comments stripped) */
|
|
11
11
|
description?: string;
|
|
12
|
-
fields:
|
|
13
|
-
relations:
|
|
12
|
+
fields: Field[];
|
|
13
|
+
relations: Relations;
|
|
14
14
|
/** PostGraphile inflection rules for this table */
|
|
15
15
|
inflection?: TableInflection;
|
|
16
16
|
/** Query operation names from introspection */
|
|
@@ -94,20 +94,20 @@ export interface TableConstraints {
|
|
|
94
94
|
}
|
|
95
95
|
export interface ConstraintInfo {
|
|
96
96
|
name: string;
|
|
97
|
-
fields:
|
|
97
|
+
fields: Field[];
|
|
98
98
|
}
|
|
99
99
|
export interface ForeignKeyConstraint extends ConstraintInfo {
|
|
100
100
|
refTable: string;
|
|
101
|
-
refFields:
|
|
101
|
+
refFields: Field[];
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Represents a field/column in a table
|
|
105
105
|
*/
|
|
106
|
-
export interface
|
|
106
|
+
export interface Field {
|
|
107
107
|
name: string;
|
|
108
108
|
/** Description from PostgreSQL COMMENT (smart comments stripped) */
|
|
109
109
|
description?: string;
|
|
110
|
-
type:
|
|
110
|
+
type: FieldType;
|
|
111
111
|
/** Whether the column has a NOT NULL constraint (inferred from NON_NULL wrapper on entity type field) */
|
|
112
112
|
isNotNull?: boolean | null;
|
|
113
113
|
/** Whether the column has a DEFAULT value (inferred by comparing entity vs CreateInput field nullability) */
|
|
@@ -116,7 +116,7 @@ export interface CleanField {
|
|
|
116
116
|
/**
|
|
117
117
|
* Field type information from PostGraphile introspection
|
|
118
118
|
*/
|
|
119
|
-
export interface
|
|
119
|
+
export interface FieldType {
|
|
120
120
|
/** GraphQL type name (e.g., "String", "UUID", "Int") */
|
|
121
121
|
gqlType: string;
|
|
122
122
|
/** Whether this is an array type */
|
|
@@ -135,64 +135,72 @@ export interface CleanFieldType {
|
|
|
135
135
|
/**
|
|
136
136
|
* All relation types for a table
|
|
137
137
|
*/
|
|
138
|
-
export interface
|
|
139
|
-
belongsTo:
|
|
140
|
-
hasOne:
|
|
141
|
-
hasMany:
|
|
142
|
-
manyToMany:
|
|
138
|
+
export interface Relations {
|
|
139
|
+
belongsTo: BelongsToRelation[];
|
|
140
|
+
hasOne: HasOneRelation[];
|
|
141
|
+
hasMany: HasManyRelation[];
|
|
142
|
+
manyToMany: ManyToManyRelation[];
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* BelongsTo relation (foreign key on this table)
|
|
146
146
|
*/
|
|
147
|
-
export interface
|
|
147
|
+
export interface BelongsToRelation {
|
|
148
148
|
fieldName: string | null;
|
|
149
149
|
isUnique: boolean;
|
|
150
150
|
referencesTable: string;
|
|
151
151
|
type: string | null;
|
|
152
|
-
keys:
|
|
152
|
+
keys: Field[];
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* HasOne relation (foreign key on other table, unique)
|
|
156
156
|
*/
|
|
157
|
-
export interface
|
|
157
|
+
export interface HasOneRelation {
|
|
158
158
|
fieldName: string | null;
|
|
159
159
|
isUnique: boolean;
|
|
160
160
|
referencedByTable: string;
|
|
161
161
|
type: string | null;
|
|
162
|
-
keys:
|
|
162
|
+
keys: Field[];
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* HasMany relation (foreign key on other table, not unique)
|
|
166
166
|
*/
|
|
167
|
-
export interface
|
|
167
|
+
export interface HasManyRelation {
|
|
168
168
|
fieldName: string | null;
|
|
169
169
|
isUnique: boolean;
|
|
170
170
|
referencedByTable: string;
|
|
171
171
|
type: string | null;
|
|
172
|
-
keys:
|
|
172
|
+
keys: Field[];
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* ManyToMany relation (through junction table)
|
|
176
176
|
*/
|
|
177
|
-
export interface
|
|
177
|
+
export interface ManyToManyRelation {
|
|
178
178
|
fieldName: string | null;
|
|
179
179
|
rightTable: string;
|
|
180
180
|
junctionTable: string;
|
|
181
181
|
type: string | null;
|
|
182
|
+
/** Junction FK field names pointing to the left table */
|
|
183
|
+
junctionLeftKeyFields?: string[];
|
|
184
|
+
/** Junction FK field names pointing to the right table */
|
|
185
|
+
junctionRightKeyFields?: string[];
|
|
186
|
+
/** Left table key fields (usually just 'id') */
|
|
187
|
+
leftKeyFields?: string[];
|
|
188
|
+
/** Right table key fields (usually just 'id') */
|
|
189
|
+
rightKeyFields?: string[];
|
|
182
190
|
}
|
|
183
191
|
/**
|
|
184
192
|
* Clean representation of a GraphQL operation (query or mutation)
|
|
185
193
|
* Derived from introspection data
|
|
186
194
|
*/
|
|
187
|
-
export interface
|
|
195
|
+
export interface Operation {
|
|
188
196
|
/** Operation name (e.g., "login", "currentUser", "cars") */
|
|
189
197
|
name: string;
|
|
190
198
|
/** Operation kind */
|
|
191
199
|
kind: 'query' | 'mutation';
|
|
192
200
|
/** Arguments/variables for the operation */
|
|
193
|
-
args:
|
|
201
|
+
args: Argument[];
|
|
194
202
|
/** Return type */
|
|
195
|
-
returnType:
|
|
203
|
+
returnType: TypeRef;
|
|
196
204
|
/** Description from schema */
|
|
197
205
|
description?: string;
|
|
198
206
|
/** Whether this is deprecated */
|
|
@@ -203,11 +211,11 @@ export interface CleanOperation {
|
|
|
203
211
|
/**
|
|
204
212
|
* Clean representation of an operation argument
|
|
205
213
|
*/
|
|
206
|
-
export interface
|
|
214
|
+
export interface Argument {
|
|
207
215
|
/** Argument name */
|
|
208
216
|
name: string;
|
|
209
217
|
/** Argument type */
|
|
210
|
-
type:
|
|
218
|
+
type: TypeRef;
|
|
211
219
|
/** Default value (as string) */
|
|
212
220
|
defaultValue?: string;
|
|
213
221
|
/** Description from schema */
|
|
@@ -216,30 +224,30 @@ export interface CleanArgument {
|
|
|
216
224
|
/**
|
|
217
225
|
* Clean type reference - simplified from introspection TypeRef
|
|
218
226
|
*/
|
|
219
|
-
export interface
|
|
227
|
+
export interface TypeRef {
|
|
220
228
|
/** Type kind */
|
|
221
229
|
kind: 'SCALAR' | 'OBJECT' | 'INPUT_OBJECT' | 'ENUM' | 'LIST' | 'NON_NULL';
|
|
222
230
|
/** Type name (null for LIST and NON_NULL wrappers) */
|
|
223
231
|
name: string | null;
|
|
224
232
|
/** Inner type for LIST and NON_NULL wrappers */
|
|
225
|
-
ofType?:
|
|
233
|
+
ofType?: TypeRef;
|
|
226
234
|
/** Resolved TypeScript type string */
|
|
227
235
|
tsType?: string;
|
|
228
236
|
/** Fields for OBJECT types */
|
|
229
|
-
fields?:
|
|
237
|
+
fields?: ObjectField[];
|
|
230
238
|
/** Input fields for INPUT_OBJECT types */
|
|
231
|
-
inputFields?:
|
|
239
|
+
inputFields?: Argument[];
|
|
232
240
|
/** Values for ENUM types */
|
|
233
241
|
enumValues?: string[];
|
|
234
242
|
}
|
|
235
243
|
/**
|
|
236
244
|
* Field on an object type
|
|
237
245
|
*/
|
|
238
|
-
export interface
|
|
246
|
+
export interface ObjectField {
|
|
239
247
|
/** Field name */
|
|
240
248
|
name: string;
|
|
241
249
|
/** Field type */
|
|
242
|
-
type:
|
|
250
|
+
type: TypeRef;
|
|
243
251
|
/** Description */
|
|
244
252
|
description?: string;
|
|
245
253
|
}
|
|
@@ -255,9 +263,9 @@ export interface ResolvedType {
|
|
|
255
263
|
name: string;
|
|
256
264
|
description?: string;
|
|
257
265
|
/** Fields for OBJECT types */
|
|
258
|
-
fields?:
|
|
266
|
+
fields?: ObjectField[];
|
|
259
267
|
/** Input fields for INPUT_OBJECT types */
|
|
260
|
-
inputFields?:
|
|
268
|
+
inputFields?: Argument[];
|
|
261
269
|
/** Values for ENUM types */
|
|
262
270
|
enumValues?: string[];
|
|
263
271
|
/** Possible types for UNION types */
|