remove graph
This commit is contained in:
@@ -1,25 +1,9 @@
|
||||
import { ArgumentsHost, Catch, ExceptionFilter, HttpException, HttpStatus, ExecutionContext } from '@nestjs/common';
|
||||
import { GqlExecutionContext } from '@nestjs/graphql';
|
||||
import { ArgumentsHost, Catch, ExceptionFilter, HttpException, HttpStatus } from '@nestjs/common';
|
||||
import { FastifyReply } from 'fastify';
|
||||
|
||||
@Catch(HttpException)
|
||||
export class HttpExceptionFilter implements ExceptionFilter {
|
||||
catch(exception: HttpException, host: ArgumentsHost) {
|
||||
// Check if this is a GraphQL context
|
||||
if (host.getType<'graphql' | 'http'>() === 'graphql') {
|
||||
try {
|
||||
// In GraphQL context, host is actually an ExecutionContext
|
||||
const gqlContext = GqlExecutionContext.create(host as ExecutionContext);
|
||||
if (gqlContext && gqlContext.getInfo()) {
|
||||
// For GraphQL, let the exception propagate - GraphQL will handle it automatically
|
||||
// We can't use HTTP response methods in GraphQL context
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
// Not a GraphQL context, continue with HTTP handling
|
||||
}
|
||||
}
|
||||
|
||||
// Handle HTTP/REST context
|
||||
try {
|
||||
const ctx = host.switchToHttp();
|
||||
|
||||
Reference in New Issue
Block a user