chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
661 stars 50 forks source link

[BUG] Wrong spatial typing generated #274

Open ian opened 2 months ago

ian commented 2 months ago

Describe the bug By default the wrong named type is generated for spatial:

Generated:

export const spatial_ref_sysAggregateArgsSchema: z.ZodType<Prisma.spatial_ref_sysAggregateArgs> = z.object({
  where: spatial_ref_sysWhereInputSchema.optional(),
  orderBy: z.union([ spatial_ref_sysOrderByWithRelationInputSchema.array(),spatial_ref_sysOrderByWithRelationInputSchema ]).optional(),
  cursor: spatial_ref_sysWhereUniqueInputSchema.optional(),
  take: z.number().optional(),
  skip: z.number().optional(),
}).strict() ;

Tye type should be Prisma.Spatial_ref_sysAggregateArgs not Prisma.spatial_ref_sysAggregateArgs

Screenshots Error trace:

api:typecheck: cache miss, executing 999dfe903cdb48ca
api:typecheck:
api:typecheck:
api:typecheck: > api@0.0.0 typecheck /Users/ian/Projects/brg/brg/apps/api
api:typecheck: > tsc --noEmit
api:typecheck:
api:typecheck: ../../packages/db/prisma/generated/zod/outputTypeSchemas/spatial_ref_sysAggregateArgsSchema.ts:7:67 - error TS2724: '"/Users/ian/Projects/brg/brg/node_modules/.prisma/client/index".Prisma' has no exported member named 'spatial_ref_sysAggregateArgs'. Did you mean 'Spatial_ref_sysAggregateArgs'?
api:typecheck:
api:typecheck: 7 export const spatial_ref_sysAggregateArgsSchema: z.ZodType<Prisma.spatial_ref_sysAggregateArgs> = z.object({
api:typecheck:                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
api:typecheck:
api:typecheck:
api:typecheck: Found 1 error in ../../packages/db/prisma/generated/zod/outputTypeSchemas/spatial_ref_sysAggregateArgsSchema.ts:7
api:typecheck:
api:typecheck:  ELIFECYCLE  Command failed with exit code 2.
api:typecheck: ERROR: command finished with error: command (/Users/ian/Projects/brg/brg/apps/api) /opt/homebrew/bin/pnpm run typecheck exited (2)
api#typecheck: command (/Users/ian/Projects/brg/brg/apps/api) /opt/homebrew/bin/pnpm run typecheck exited (2)

Package versions (please complete the following information):