You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like a way to pass our own defaultOptions type for PrismaSelect defaultOptions.
The select function is any, and the object keys are generic string.
For reference, here's an example that is fully typed for nexus autogenerated types. Nexus autogenerated types are dynamic nested objects.
import{NexusGenFieldTypes}from"/my/nexus-types.generated";// Can be the current default optiontypeAllowedNexusTypes=Partial<Omit<NexusGenFieldTypes,"Mutation"|"Query">>;typeDefaultFields<T=AllowedNexusTypes>=Required<{[KinkeyofT]:
|Partial<{[PinkeyofRequired<T>[K]]: boolean}>|((select: Required<T>[K])=>Record<string,boolean>);}>;constdefaultFields: TDefaultFields={Category: {id: true},// key and options are typedPage: (select)=>({// key, options, and select are typedid: true,categoryId: !!select.category,}),Tag: {id: true},}
The text was updated successfully, but these errors were encountered:
I'd like a way to pass our own
defaultOptions
type for PrismaSelectdefaultOptions
.The select function is
any
, and the object keys are genericstring
.For reference, here's an example that is fully typed for nexus autogenerated types. Nexus autogenerated types are dynamic nested objects.
The text was updated successfully, but these errors were encountered: