Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

refactor: changed context to contain just req,res and connection objects for GraphQLModule

Balu Babu0aac046a0e8e
diff --git a/packages/hoppscotch-backend/src/app.module.ts b/packages/hoppscotch-backend/src/app.module.ts
index cbb9cd49c..c0e541604 100644
--- a/packages/hoppscotch-backend/src/app.module.ts
+++ b/packages/hoppscotch-backend/src/app.module.ts
@@ -34,21 +34,11 @@ import { UserHistoryModule } from './user-history/user-history.module';
},
},
},
- context: async ({ req, connection }) => {
- if (req) {
- return { reqHeaders: req.headers };
- } else {
- return {
- // Lowercase the keys
- reqHeaders: Object.fromEntries(
- Object.entries(connection.context).map(([k, v]) => [
- k.toLowerCase(),
- v,
- ]),
- ),
- };
- }
- },
+ context: ({ req, res, connection }) => ({
+ req,
+ res,
+ connection,
+ }),
driver: ApolloDriver,
}),
UserModule,