I forked this repo for my own personal use case and stumbled upon some issues when attempting to upgrade to prisma 5.1.1
Just wanted to leave some notes here of findings thus far.
Feel free to take it over.
1.
[...]CountOutputTypeArgs types have been renamed e.g.
AddressCountOutputTypeArgs becomes AddressCountOutputTypeDefaultArgs
Added this after the isAggregateInputType check in Transformer.generateExportObjectSchemaStatement
if (name.endsWith('CountOutputTypeArgs')) {
name = name.replace(/Args$/, 'DefaultArgs')
}
2.
The one I got stuck on after that was the [...]WhereUniqueInput types.
So where previously a type might look like
export type AssetWhereUniqueInput = {
id?: number
uuid?: string
checksum?: string
}
Is now wrapped with a AtLeast<> type utility that requires at least one of the values to be present instead of them all being optional. This conflicts with the the ZodType argument in these type of files:
I don't know if there's an answer to this with zod?
I don't fully understand the code and how it's all laid out so I got a bit overwhelmed and tapped out, but hopefully this helps if you decide to keep supporting this package (which you should! it's great!)
Found a potential solution to Prisma's AtLeast type helper in zod: https://stackoverflow.com/a/73294947
Will try and implement it when I get time, leaving here for later.
I forked this repo for my own personal use case and stumbled upon some issues when attempting to upgrade to prisma 5.1.1
Just wanted to leave some notes here of findings thus far.
Feel free to take it over.
1.
[...]CountOutputTypeArgs
types have been renamed e.g.AddressCountOutputTypeArgs
becomesAddressCountOutputTypeDefaultArgs
Added this after theisAggregateInputType
check inTransformer.generateExportObjectSchemaStatement
2. The one I got stuck on after that was the
[...]WhereUniqueInput
types.So where previously a type might look like
Is now wrapped with a
AtLeast<>
type utility that requires at least one of the values to be present instead of them all being optional. This conflicts with the theZodType
argument in these type of files:I narrowed it down to the fact that
extendedWhereUnique
is enabled by default in prisma 5.Here's a related issue to watch: https://github.com/prisma/prisma/issues/20619
I don't know if there's an answer to this with zod?
I don't fully understand the code and how it's all laid out so I got a bit overwhelmed and tapped out, but hopefully this helps if you decide to keep supporting this package (which you should! it's great!)