drizzle-graphql-plus 0.8.24 → 0.8.25

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/index.cjs CHANGED
@@ -2309,7 +2309,7 @@ var generateTypes = (db, schema) => {
2309
2309
  for (const [key, value] of schemaEntries) {
2310
2310
  if (value && typeof value === "object" && "getSQL" in value) {
2311
2311
  const table = value;
2312
- const tableName = (0, import_drizzle_orm8.getTableName)(table);
2312
+ const tableName = key;
2313
2313
  const columns = (0, import_drizzle_orm8.getTableColumns)(table);
2314
2314
  tables[tableName] = {
2315
2315
  name: tableName,
@@ -2424,21 +2424,8 @@ var generateTypeDefs = (tables, relations) => {
2424
2424
  const targetTableName = relationInfo.targetTableName;
2425
2425
  const targetTypeName = capitalize(targetTableName);
2426
2426
  if (isOne) {
2427
- const relation = relationInfo.relation;
2428
- const config = relation.config;
2429
- let isNonNullable = false;
2430
- if (config?.fields && config.fields.length > 0) {
2431
- isNonNullable = config.fields.every((field) => {
2432
- const fieldColumnName = field.name;
2433
- const column = Object.values(tableInfo.columns).find(
2434
- (col) => col.name === fieldColumnName
2435
- );
2436
- return column && column.notNull;
2437
- });
2438
- }
2439
- const nullableModifier = isNonNullable ? "!" : "";
2440
2427
  fields.push(
2441
- ` ${relationName}(where: ${targetTypeName}Filters): ${targetTypeName}${nullableModifier}`
2428
+ ` ${relationName}(where: ${targetTypeName}Filters): ${targetTypeName}`
2442
2429
  );
2443
2430
  } else {
2444
2431
  fields.push(