pothos-drizzle-generator 0.1.1 → 0.1.3

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.
@@ -17,7 +17,7 @@ class PothosDrizzleGeneratorPlugin extends core_1.BasePlugin {
17
17
  const builder = this.builder;
18
18
  const tables = generator.getTables();
19
19
  for (const [modelName, { table, tableInfo, relations, columns, operations, executable, limit, where, orderBy, inputData, depthLimit, },] of Object.entries(tables)) {
20
- const objectRef = builder.objectRef(modelName);
20
+ const objectRef = builder.objectRef(`${tableInfo.name}_`);
21
21
  objectRef.implement({
22
22
  fields: (t) => Object.fromEntries(columns.map((c) => {
23
23
  return [
@@ -360,7 +360,7 @@ class PothosDrizzleGeneratorPlugin extends core_1.BasePlugin {
360
360
  builder.mutationType({
361
361
  fields: (t) => ({
362
362
  [`delete${tableInfo.name}`]: t.field({
363
- type: [modelName],
363
+ type: [`${tableInfo.name}_`],
364
364
  nullable: false,
365
365
  args: {
366
366
  where: t.arg({ type: inputWhere }),
@@ -14,7 +14,7 @@ export class PothosDrizzleGeneratorPlugin extends BasePlugin {
14
14
  const builder = this.builder;
15
15
  const tables = generator.getTables();
16
16
  for (const [modelName, { table, tableInfo, relations, columns, operations, executable, limit, where, orderBy, inputData, depthLimit, },] of Object.entries(tables)) {
17
- const objectRef = builder.objectRef(modelName);
17
+ const objectRef = builder.objectRef(`${tableInfo.name}_`);
18
18
  objectRef.implement({
19
19
  fields: (t) => Object.fromEntries(columns.map((c) => {
20
20
  return [
@@ -357,7 +357,7 @@ export class PothosDrizzleGeneratorPlugin extends BasePlugin {
357
357
  builder.mutationType({
358
358
  fields: (t) => ({
359
359
  [`delete${tableInfo.name}`]: t.field({
360
- type: [modelName],
360
+ type: [`${tableInfo.name}_`],
361
361
  nullable: false,
362
362
  args: {
363
363
  where: t.arg({ type: inputWhere }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pothos-drizzle-generator",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "types": "./dist/cjs/index.d.ts",
6
6
  "exports": {
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@graphql-tools/utils": "^10.11.0",
20
20
  "@pothos/core": "^4.10.0",
21
- "@pothos/plugin-drizzle": "^0.16.0",
21
+ "@pothos/plugin-drizzle": "^0.16.1",
22
22
  "drizzle-orm": "1.0.0-beta.3-bd1ec83",
23
23
  "graphql": "^16.12.0",
24
24
  "graphql-scalars": "^1.25.0"