@pothos/plugin-drizzle 0.8.1 → 0.9.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 (122) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/TODO.md +25 -4
  3. package/dts/connection-helpers.d.ts +32 -0
  4. package/dts/connection-helpers.d.ts.map +1 -0
  5. package/dts/drizzle-field-builder.d.ts +18 -53
  6. package/dts/drizzle-field-builder.d.ts.map +1 -1
  7. package/dts/global-types.d.ts +22 -41
  8. package/dts/global-types.d.ts.map +1 -1
  9. package/dts/index.d.ts +4 -2
  10. package/dts/index.d.ts.map +1 -1
  11. package/dts/interface-ref.d.ts +3 -2
  12. package/dts/interface-ref.d.ts.map +1 -1
  13. package/dts/model-loader.d.ts +3 -2
  14. package/dts/model-loader.d.ts.map +1 -1
  15. package/dts/node-ref.d.ts +1 -1
  16. package/dts/node-ref.d.ts.map +1 -1
  17. package/dts/object-ref.d.ts +2 -2
  18. package/dts/object-ref.d.ts.map +1 -1
  19. package/dts/types.d.ts +61 -41
  20. package/dts/types.d.ts.map +1 -1
  21. package/dts/utils/config.d.ts +4 -3
  22. package/dts/utils/config.d.ts.map +1 -1
  23. package/dts/utils/cursors.d.ts +13 -7
  24. package/dts/utils/cursors.d.ts.map +1 -1
  25. package/dts/utils/drizzle-graphql.d.ts +0 -17
  26. package/dts/utils/drizzle-graphql.d.ts.map +1 -1
  27. package/dts/utils/map-query.d.ts.map +1 -1
  28. package/dts/utils/selections.d.ts +5 -5
  29. package/dts/utils/selections.d.ts.map +1 -1
  30. package/esm/connection-helpers.d.ts +34 -0
  31. package/esm/connection-helpers.d.ts.map +1 -0
  32. package/esm/connection-helpers.js +74 -0
  33. package/esm/connection-helpers.js.map +1 -0
  34. package/esm/drizzle-field-builder.d.ts +18 -73
  35. package/esm/drizzle-field-builder.d.ts.map +1 -1
  36. package/esm/drizzle-field-builder.js +25 -14
  37. package/esm/drizzle-field-builder.js.map +1 -1
  38. package/esm/field-builder.js +2 -3
  39. package/esm/field-builder.js.map +1 -1
  40. package/esm/global-types.d.ts +35 -60
  41. package/esm/global-types.d.ts.map +1 -1
  42. package/esm/global-types.js.map +1 -1
  43. package/esm/index.d.ts +4 -2
  44. package/esm/index.d.ts.map +1 -1
  45. package/esm/index.js +70 -61
  46. package/esm/index.js.map +1 -1
  47. package/esm/interface-ref.d.ts +3 -2
  48. package/esm/interface-ref.d.ts.map +1 -1
  49. package/esm/interface-ref.js.map +1 -1
  50. package/esm/model-loader.d.ts +3 -2
  51. package/esm/model-loader.d.ts.map +1 -1
  52. package/esm/model-loader.js +17 -10
  53. package/esm/model-loader.js.map +1 -1
  54. package/esm/node-ref.d.ts +1 -1
  55. package/esm/node-ref.d.ts.map +1 -1
  56. package/esm/object-ref.d.ts +2 -2
  57. package/esm/object-ref.d.ts.map +1 -1
  58. package/esm/schema-builder.js +111 -65
  59. package/esm/schema-builder.js.map +1 -1
  60. package/esm/types.d.ts +61 -41
  61. package/esm/types.d.ts.map +1 -1
  62. package/esm/types.js.map +1 -1
  63. package/esm/utils/config.d.ts +4 -3
  64. package/esm/utils/config.d.ts.map +1 -1
  65. package/esm/utils/config.js +32 -15
  66. package/esm/utils/config.js.map +1 -1
  67. package/esm/utils/cursors.d.ts +13 -7
  68. package/esm/utils/cursors.d.ts.map +1 -1
  69. package/esm/utils/cursors.js +137 -63
  70. package/esm/utils/cursors.js.map +1 -1
  71. package/esm/utils/drizzle-graphql.d.ts +0 -17
  72. package/esm/utils/drizzle-graphql.d.ts.map +1 -1
  73. package/esm/utils/drizzle-graphql.js +230 -198
  74. package/esm/utils/drizzle-graphql.js.map +1 -1
  75. package/esm/utils/map-query.d.ts.map +1 -1
  76. package/esm/utils/map-query.js +9 -5
  77. package/esm/utils/map-query.js.map +1 -1
  78. package/esm/utils/selections.d.ts +5 -5
  79. package/esm/utils/selections.d.ts.map +1 -1
  80. package/esm/utils/selections.js +19 -18
  81. package/esm/utils/selections.js.map +1 -1
  82. package/lib/connection-helpers.js +85 -0
  83. package/lib/connection-helpers.js.map +1 -0
  84. package/lib/drizzle-field-builder.js +24 -13
  85. package/lib/drizzle-field-builder.js.map +1 -1
  86. package/lib/field-builder.js +2 -3
  87. package/lib/field-builder.js.map +1 -1
  88. package/lib/index.js +75 -60
  89. package/lib/index.js.map +1 -1
  90. package/lib/interface-ref.js.map +1 -1
  91. package/lib/model-loader.js +17 -10
  92. package/lib/model-loader.js.map +1 -1
  93. package/lib/schema-builder.js +111 -65
  94. package/lib/schema-builder.js.map +1 -1
  95. package/lib/types.js.map +1 -1
  96. package/lib/utils/config.js +31 -14
  97. package/lib/utils/config.js.map +1 -1
  98. package/lib/utils/cursors.js +135 -63
  99. package/lib/utils/cursors.js.map +1 -1
  100. package/lib/utils/drizzle-graphql.js +230 -221
  101. package/lib/utils/drizzle-graphql.js.map +1 -1
  102. package/lib/utils/map-query.js +9 -5
  103. package/lib/utils/map-query.js.map +1 -1
  104. package/lib/utils/selections.js +18 -17
  105. package/lib/utils/selections.js.map +1 -1
  106. package/package.json +14 -14
  107. package/src/connection-helpers.ts +184 -0
  108. package/src/drizzle-field-builder.ts +30 -26
  109. package/src/field-builder.ts +4 -7
  110. package/src/global-types.ts +112 -119
  111. package/src/index.ts +90 -68
  112. package/src/interface-ref.ts +7 -3
  113. package/src/model-loader.ts +32 -17
  114. package/src/node-ref.ts +1 -1
  115. package/src/object-ref.ts +2 -2
  116. package/src/schema-builder.ts +114 -111
  117. package/src/types.ts +95 -62
  118. package/src/utils/config.ts +39 -30
  119. package/src/utils/cursors.ts +134 -101
  120. package/src/utils/drizzle-graphql.ts +273 -274
  121. package/src/utils/map-query.ts +19 -7
  122. package/src/utils/selections.ts +34 -28
@@ -1,15 +1,19 @@
1
1
  import { InterfaceRef, type SchemaTypes } from '@pothos/core';
2
+ import type { DrizzleNodeRef } from './node-ref';
2
3
  import { type DrizzleObjectRef, drizzleTableKey } from './object-ref';
3
4
 
4
5
  export type DrizzleRef<
5
6
  Types extends SchemaTypes,
6
- Table extends keyof Types['DrizzleRelationSchema'] = keyof Types['DrizzleRelationSchema'],
7
+ Table extends keyof Types['DrizzleRelationsConfig'] = keyof Types['DrizzleRelationsConfig'],
7
8
  T = {},
8
- > = DrizzleInterfaceRef<Types, Table, T> | DrizzleObjectRef<Types, Table, T>;
9
+ > =
10
+ | DrizzleInterfaceRef<Types, Table, T>
11
+ | DrizzleObjectRef<Types, Table, T>
12
+ | DrizzleNodeRef<Types, Table, T>;
9
13
 
10
14
  export class DrizzleInterfaceRef<
11
15
  Types extends SchemaTypes,
12
- Table extends keyof Types['DrizzleRelationSchema'] = keyof Types['DrizzleRelationSchema'],
16
+ Table extends keyof Types['DrizzleRelationsConfig'] = keyof Types['DrizzleRelationsConfig'],
13
17
  T = {},
14
18
  > extends InterfaceRef<Types, T> {
15
19
  [drizzleTableKey]!: Table;
@@ -1,7 +1,13 @@
1
1
  import { type SchemaTypes, createContextCache } from '@pothos/core';
2
- import { type Column, type TableRelationalConfig, inArray, sql } from 'drizzle-orm';
2
+ import {
3
+ type AnyTable,
4
+ type Column,
5
+ type SQL,
6
+ type TableRelationalConfig,
7
+ inArray,
8
+ sql,
9
+ } from 'drizzle-orm';
3
10
  import type { GraphQLResolveInfo } from 'graphql';
4
- import type { DrizzleClient } from './types';
5
11
  import { type PothosDrizzleSchemaConfig, getClient, getSchemaConfig } from './utils/config';
6
12
  import { cacheKey, setLoaderMappings } from './utils/loader-map';
7
13
  import { selectionStateFromInfo, stateFromInfo } from './utils/map-query';
@@ -35,7 +41,8 @@ export class ModelLoader {
35
41
  config: PothosDrizzleSchemaConfig;
36
42
  table: TableRelationalConfig;
37
43
  columns: Column[];
38
- selectSQL;
44
+ primaryKey: Column[];
45
+ selectSQL: (table: AnyTable<{}>) => SQL;
39
46
 
40
47
  constructor(
41
48
  context: object,
@@ -47,12 +54,17 @@ export class ModelLoader {
47
54
  this.builder = builder;
48
55
  this.modelName = modelName;
49
56
  this.config = getSchemaConfig(builder);
50
- this.table = this.config.schema[modelName];
51
- this.columns = columns ?? this.table.primaryKey;
52
- this.selectSQL =
53
- this.columns.length > 1
54
- ? sql`(${sql.join(this.columns, sql`, `)})`
55
- : this.columns[0].getSQL();
57
+ this.table = this.config.relations.tablesConfig[modelName];
58
+ this.primaryKey = this.config.getPrimaryKey(modelName);
59
+ this.columns = columns ?? this.primaryKey;
60
+ this.selectSQL = (table) => {
61
+ const columns = this.columns.map((column) =>
62
+ Object.values(table).find(
63
+ (tblColumn) => 'columnType' in tblColumn && tblColumn.name === column.name,
64
+ ),
65
+ );
66
+ return columns.length > 1 ? sql`(${sql.join(columns, sql`, `)})` : columns[0].getSQL();
67
+ };
56
68
  }
57
69
 
58
70
  static forModel<Types extends SchemaTypes>(
@@ -84,7 +96,7 @@ export class ModelLoader {
84
96
  const selection = selectionStateFromInfo(this.config, this.context, info);
85
97
  this.queryCache.set(key, {
86
98
  selection,
87
- query: selectionToQuery(selection),
99
+ query: selectionToQuery(this.config, selection),
88
100
  });
89
101
  }
90
102
 
@@ -103,7 +115,7 @@ export class ModelLoader {
103
115
 
104
116
  this.queryCache.set(key, {
105
117
  selection,
106
- query: selectionToQuery(selection),
118
+ query: selectionToQuery(this.config, selection),
107
119
  });
108
120
  }
109
121
 
@@ -176,18 +188,21 @@ export class ModelLoader {
176
188
  )[this.modelName];
177
189
 
178
190
  const query = api.findMany({
179
- ...selectionToQuery(selection),
180
- where: inArray(
181
- this.selectSQL,
182
- [...entry.models.keys()].map((model) => this.sqlForModel(model)),
183
- ),
191
+ ...selectionToQuery(this.config, selection),
192
+ where: {
193
+ RAW: (table: AnyTable<{}>) =>
194
+ inArray(
195
+ this.selectSQL(table),
196
+ [...entry.models.keys()].map((model) => this.sqlForModel(model)),
197
+ ),
198
+ },
184
199
  });
185
200
 
186
201
  query.then(
187
202
  (results) => {
188
203
  for (const [model, promise] of entry.models.entries()) {
189
204
  const result = results.find((row) =>
190
- this.table.primaryKey.every(
205
+ this.primaryKey.every(
191
206
  (key) => row[key.name] === (model as Record<string, unknown>)[key.name],
192
207
  ),
193
208
  );
package/src/node-ref.ts CHANGED
@@ -5,7 +5,7 @@ export const relayIDShapeKey = Symbol.for('Pothos.relayIDShapeKey');
5
5
 
6
6
  export class DrizzleNodeRef<
7
7
  Types extends SchemaTypes,
8
- Table extends keyof Types['DrizzleRelationSchema'] = keyof Types['DrizzleRelationSchema'],
8
+ Table extends keyof Types['DrizzleRelationsConfig'] = keyof Types['DrizzleRelationsConfig'],
9
9
  T = {},
10
10
  IDShape = string,
11
11
  > extends DrizzleObjectRef<Types, Table, T> {
package/src/object-ref.ts CHANGED
@@ -11,10 +11,10 @@ export const drizzleTableKey = Symbol.for('Pothos.drizzleTableKey');
11
11
 
12
12
  export class DrizzleObjectRef<
13
13
  Types extends SchemaTypes,
14
- Table extends keyof Types['DrizzleRelationSchema'] = keyof Types['DrizzleRelationSchema'],
14
+ Table extends keyof Types['DrizzleRelationsConfig'] = keyof Types['DrizzleRelationsConfig'],
15
15
  T = {},
16
16
  > extends ObjectRef<Types, T> {
17
- [drizzleTableKey]!: Types['DrizzleRelationSchema'][Table];
17
+ [drizzleTableKey]!: Types['DrizzleRelationsConfig'][Table];
18
18
 
19
19
  [abstractReturnShapeKey]!: WithBrand<T>;
20
20
 
@@ -37,7 +37,7 @@ schemaBuilderProto.drizzleObject = function drizzleObject(table, { select, field
37
37
  extensions: {
38
38
  ...options.extensions,
39
39
  pothosDrizzleModel: table,
40
- pothosDrizzleTable: getSchemaConfig(this).schema?.[table],
40
+ pothosDrizzleTable: getSchemaConfig(this).relations.tablesConfig[table],
41
41
  pothosDrizzleSelect: select ?? {},
42
42
  pothosDrizzleLoader: ModelLoader.forModel(table, this),
43
43
  },
@@ -54,18 +54,14 @@ schemaBuilderProto.drizzleInterface = function drizzleInterface(
54
54
  ) {
55
55
  const name = options.name ?? table;
56
56
 
57
- const ref = options.variant
58
- ? new DrizzleInterfaceRef(options.variant, name)
59
- : (getRefFromModel(table, this, 'interface') as InterfaceRef<SchemaTypes, unknown>);
60
-
61
- ref.name = name ?? table;
57
+ const ref = new DrizzleInterfaceRef(name, table);
62
58
 
63
59
  this.interfaceType(ref, {
64
60
  ...(options as {}),
65
61
  extensions: {
66
62
  ...options.extensions,
67
63
  pothosDrizzleModel: table,
68
- pothosDrizzleTable: getSchemaConfig(this).schema?.[table],
64
+ pothosDrizzleTable: getSchemaConfig(this).relations.tablesConfig[table],
69
65
  pothosDrizzleSelect: select ?? {},
70
66
  pothosDrizzleLoader: ModelLoader.forModel(table, this),
71
67
  },
@@ -82,7 +78,7 @@ schemaBuilderProto.drizzleNode = function drizzleNode(
82
78
  this: PothosSchemaTypes.SchemaBuilder<SchemaTypes> & {
83
79
  nodeInterfaceRef?: () => InterfaceRef<SchemaTypes, unknown>;
84
80
  },
85
- table: keyof SchemaTypes['DrizzleRelationSchema'],
81
+ table: keyof SchemaTypes['DrizzleRelations']['config'],
86
82
  {
87
83
  id: { column, ...idOptions },
88
84
  name,
@@ -90,7 +86,7 @@ schemaBuilderProto.drizzleNode = function drizzleNode(
90
86
  ...options
91
87
  }: DrizzleNodeOptions<
92
88
  SchemaTypes,
93
- keyof SchemaTypes['DrizzleRelationSchema'],
89
+ keyof SchemaTypes['DrizzleRelations']['config'],
94
90
  {},
95
91
  {},
96
92
  [],
@@ -98,7 +94,7 @@ schemaBuilderProto.drizzleNode = function drizzleNode(
98
94
  >,
99
95
  ) {
100
96
  const schemaConfig = getSchemaConfig(this);
101
- const tableConfig = schemaConfig.schema![table];
97
+ const tableConfig = schemaConfig.relations.tablesConfig[table];
102
98
  const idColumn = typeof column === 'function' ? column(tableConfig.columns) : column;
103
99
  const idColumns = Array.isArray(idColumn) ? idColumn : [idColumn];
104
100
  const interfaceRef = this.nodeInterfaceRef?.();
@@ -106,7 +102,14 @@ schemaBuilderProto.drizzleNode = function drizzleNode(
106
102
  const idParser = getIDParser(idColumns);
107
103
  const typeName = variant ?? name ?? table;
108
104
  const nodeRef = new DrizzleNodeRef(typeName, table, {
109
- parseId: idParser,
105
+ parseId: (id) => {
106
+ const parsed = idParser(id);
107
+ if (Array.isArray(idColumn)) {
108
+ return parsed;
109
+ }
110
+
111
+ return parsed[schemaConfig.columnToTsName(idColumn)];
112
+ },
110
113
  });
111
114
  const modelLoader = ModelLoader.forModel(table, this, idColumns);
112
115
 
@@ -206,106 +209,106 @@ schemaBuilderProto.drizzleInterfaceFields = function drizzleInterfaceFields(type
206
209
  });
207
210
  };
208
211
 
209
- schemaBuilderProto.drizzleGraphQLOrderBy = function drizzleGraphQLOrderBy(
210
- this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
211
- table: string,
212
- type: GraphQLInputObjectType,
213
- options?: { extensions?: object },
214
- ) {
215
- return (
216
- this as typeof this & {
217
- addGraphQLInput: (
218
- type: GraphQLInputObjectType,
219
- options: Record<string, unknown>,
220
- ) => InputObjectRef<SchemaTypes, {}>;
221
- }
222
- ).addGraphQLInput(type, {
223
- ...options,
224
- extensions: {
225
- ...options?.extensions,
226
- drizzleGraphQL: {
227
- inputType: 'orderBy',
228
- table,
229
- tableConfig: getSchemaConfig(this).schema?.[table]!,
230
- } satisfies DrizzleGraphQLInputExtensions,
231
- },
232
- });
233
- } as never;
212
+ // schemaBuilderProto.drizzleGraphQLOrderBy = function drizzleGraphQLOrderBy(
213
+ // this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
214
+ // table: string,
215
+ // type: GraphQLInputObjectType,
216
+ // options?: { extensions?: object },
217
+ // ) {
218
+ // return (
219
+ // this as typeof this & {
220
+ // addGraphQLInput: (
221
+ // type: GraphQLInputObjectType,
222
+ // options: Record<string, unknown>,
223
+ // ) => InputObjectRef<SchemaTypes, {}>;
224
+ // }
225
+ // ).addGraphQLInput(type, {
226
+ // ...options,
227
+ // extensions: {
228
+ // ...options?.extensions,
229
+ // drizzleGraphQL: {
230
+ // inputType: 'orderBy',
231
+ // table,
232
+ // tableConfig: getSchemaConfig(this).relations.tablesConfig[table],
233
+ // } satisfies DrizzleGraphQLInputExtensions,
234
+ // },
235
+ // });
236
+ // } as never;
234
237
 
235
- schemaBuilderProto.drizzleGraphQLFilters = function drizzleGraphQLFilters(
236
- this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
237
- table: string,
238
- type: GraphQLInputObjectType,
239
- options?: { extensions?: object },
240
- ) {
241
- return (
242
- this as typeof this & {
243
- addGraphQLInput: (
244
- type: GraphQLInputObjectType,
245
- options: Record<string, unknown>,
246
- ) => InputObjectRef<SchemaTypes, {}>;
247
- }
248
- ).addGraphQLInput(type, {
249
- ...options,
250
- extensions: {
251
- ...options?.extensions,
252
- drizzleGraphQL: {
253
- inputType: 'filters',
254
- table,
255
- tableConfig: getSchemaConfig(this).schema?.[table]!,
256
- } satisfies DrizzleGraphQLInputExtensions,
257
- },
258
- });
259
- } as never;
238
+ // schemaBuilderProto.drizzleGraphQLFilters = function drizzleGraphQLFilters(
239
+ // this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
240
+ // table: string,
241
+ // type: GraphQLInputObjectType,
242
+ // options?: { extensions?: object },
243
+ // ) {
244
+ // return (
245
+ // this as typeof this & {
246
+ // addGraphQLInput: (
247
+ // type: GraphQLInputObjectType,
248
+ // options: Record<string, unknown>,
249
+ // ) => InputObjectRef<SchemaTypes, {}>;
250
+ // }
251
+ // ).addGraphQLInput(type, {
252
+ // ...options,
253
+ // extensions: {
254
+ // ...options?.extensions,
255
+ // drizzleGraphQL: {
256
+ // inputType: 'filters',
257
+ // table,
258
+ // tableConfig: getSchemaConfig(this).relations.tablesConfig[table],
259
+ // } satisfies DrizzleGraphQLInputExtensions,
260
+ // },
261
+ // });
262
+ // } as never;
260
263
 
261
- schemaBuilderProto.drizzleGraphQLInsert = function drizzleGraphQLInsert(
262
- this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
263
- table: string,
264
- type: GraphQLInputObjectType,
265
- options?: { extensions?: object },
266
- ) {
267
- return (
268
- this as typeof this & {
269
- addGraphQLInput: (
270
- type: GraphQLInputObjectType,
271
- options: Record<string, unknown>,
272
- ) => InputObjectRef<SchemaTypes, {}>;
273
- }
274
- ).addGraphQLInput(type, {
275
- ...options,
276
- extensions: {
277
- ...options?.extensions,
278
- drizzleGraphQL: {
279
- inputType: 'insert',
280
- table,
281
- tableConfig: getSchemaConfig(this).schema?.[table]!,
282
- } satisfies DrizzleGraphQLInputExtensions,
283
- },
284
- });
285
- } as never;
264
+ // schemaBuilderProto.drizzleGraphQLInsert = function drizzleGraphQLInsert(
265
+ // this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
266
+ // table: string,
267
+ // type: GraphQLInputObjectType,
268
+ // options?: { extensions?: object },
269
+ // ) {
270
+ // return (
271
+ // this as typeof this & {
272
+ // addGraphQLInput: (
273
+ // type: GraphQLInputObjectType,
274
+ // options: Record<string, unknown>,
275
+ // ) => InputObjectRef<SchemaTypes, {}>;
276
+ // }
277
+ // ).addGraphQLInput(type, {
278
+ // ...options,
279
+ // extensions: {
280
+ // ...options?.extensions,
281
+ // drizzleGraphQL: {
282
+ // inputType: 'insert',
283
+ // table,
284
+ // tableConfig: getSchemaConfig(this).relations.tablesConfig[table],
285
+ // } satisfies DrizzleGraphQLInputExtensions,
286
+ // },
287
+ // });
288
+ // } as never;
286
289
 
287
- schemaBuilderProto.drizzleGraphQLUpdate = function drizzleGraphQLUpdate(
288
- this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
289
- table: string,
290
- type: GraphQLInputObjectType,
291
- options?: { extensions?: object },
292
- ) {
293
- return (
294
- this as typeof this & {
295
- addGraphQLInput: (
296
- type: GraphQLInputObjectType,
297
- options: Record<string, unknown>,
298
- ) => InputObjectRef<SchemaTypes, {}>;
299
- }
300
- ).addGraphQLInput(type, {
301
- ...options,
302
- extensions: {
303
- ...options?.extensions,
304
- drizzleGraphQL: {
305
- inputType: 'update',
306
- table,
307
- tableConfig: getSchemaConfig(this).schema?.[table]!,
308
- } satisfies DrizzleGraphQLInputExtensions,
309
- },
310
- });
311
- } as never;
290
+ // schemaBuilderProto.drizzleGraphQLUpdate = function drizzleGraphQLUpdate(
291
+ // this: PothosSchemaTypes.SchemaBuilder<SchemaTypes>,
292
+ // table: string,
293
+ // type: GraphQLInputObjectType,
294
+ // options?: { extensions?: object },
295
+ // ) {
296
+ // return (
297
+ // this as typeof this & {
298
+ // addGraphQLInput: (
299
+ // type: GraphQLInputObjectType,
300
+ // options: Record<string, unknown>,
301
+ // ) => InputObjectRef<SchemaTypes, {}>;
302
+ // }
303
+ // ).addGraphQLInput(type, {
304
+ // ...options,
305
+ // extensions: {
306
+ // ...options?.extensions,
307
+ // drizzleGraphQL: {
308
+ // inputType: 'update',
309
+ // table,
310
+ // tableConfig: getSchemaConfig(this).relations.tablesConfig[table],
311
+ // } satisfies DrizzleGraphQLInputExtensions,
312
+ // },
313
+ // });
314
+ // } as never;