prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
Is it possible to use the generated types with rest api ?
trafficstars
something like below:
import { FindManyUserArgs , User } from 'prisma/@generated/prisma-nestjs-graphql';
import { PrismaService } from './prisma.service'
// just an example
@Get('users')
async getAllUsers(@Query() query: FindManyUserArgs): Promise<User[]> {
return this.prismaService.user.findMany(query);
}
It was not designed for that. But people are saying that they adopted it somehow, probably with some modification of result generated classes.