From 0991d91b7eef4aa15b72c3157e19b3432248fc39 Mon Sep 17 00:00:00 2001 From: Oche Date: Fri, 21 Feb 2025 14:01:59 +0100 Subject: [PATCH] fix: fix graphql CORS error --- src/app.module.ts | 9 --------- src/main.ts | 7 ------- 2 files changed, 16 deletions(-) diff --git a/src/app.module.ts b/src/app.module.ts index 2d83fab..547d5b2 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -16,15 +16,6 @@ import { ResolversModule } from './resolvers/resolvers.module'; driver: ApolloDriver, autoSchemaFile: true, resolvers: { JSON: GraphQLJSON }, - csrfPrevention: { - requestHeaders: [ - 'Accept', - 'Authorization', - 'Content-Type', - 'X-Requested-With', - 'apollo-require-preflight', - ], - }, }), PrismaModule, SharedIndexerModule, diff --git a/src/main.ts b/src/main.ts index 865c5bf..0d641ea 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,13 +7,6 @@ async function bootstrap() { app.enableCors({ origin: '*', credentials: true, - allowedHeaders: [ - 'Accept', - 'Authorization', - 'Content-Type', - 'X-Requested-With', - 'apollo-require-preflight', - ], methods: ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS'], });