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
Is there a simple way to utilize Prisma's input types for queries/mutations without having to retype them in a DTO?
When attempting the method below im greeting with a reflection error. I tried looking for an example but came up with none.
import{Prisma}from'@prisma/client';import{Event}from'./entities/event.entity';
@Query(()=>Event)event(@Args('where')where: Prisma.EventWhereUniqueInput){returnthis.prisma.event.findUnique({ where });}
Error: Undefined type error. Make sure you are providing an explicit type for the "event" (parameter at index [0]) of the "EventResolver" class.
at Object.reflectTypeFromMetadata (/Users/rykuno/poptaro/apps/api/node_modules/@nestjs/graphql/dist/utils/reflection.utilts.js:15:15)
at /Users/rykuno/poptaro/apps/api/node_modules/@nestjs/graphql/dist/decorators/args.decorator.js:17:78
at /Users/rykuno/poptaro/apps/api/node_modules/@nestjs/graphql/dist/schema-builder/storages/lazy-metadata.storage.js:35:44
```
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there a simple way to utilize Prisma's input types for queries/mutations without having to retype them in a DTO?
When attempting the method below im greeting with a reflection error. I tried looking for an example but came up with none.
Beta Was this translation helpful? Give feedback.
All reactions