Removing Prisma and Grapql-nestjs-prisma resolvers (#2574)
* Some cleaning * Fix seeds * Fix all sign in, sign up flow and apiKey optimistic rendering * Fix
This commit is contained in:
@ -1,19 +1,11 @@
|
||||
import { Catch, UnauthorizedException } from '@nestjs/common';
|
||||
import { GqlExceptionFilter } from '@nestjs/graphql';
|
||||
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { GraphQLError } from 'graphql';
|
||||
|
||||
@Catch()
|
||||
export class ExceptionFilter implements GqlExceptionFilter {
|
||||
catch(exception: Error) {
|
||||
if (exception instanceof Prisma.PrismaClientValidationError) {
|
||||
throw new GraphQLError('Invalid request', {
|
||||
extensions: {
|
||||
code: 'INVALID_REQUEST',
|
||||
},
|
||||
});
|
||||
}
|
||||
if (exception instanceof UnauthorizedException) {
|
||||
throw new GraphQLError('Unauthorized', {
|
||||
extensions: {
|
||||
|
||||
Reference in New Issue
Block a user