|
|
@@ -67,21 +67,7 @@ export class AppModule implements NestModule {
|
|
|
}),
|
|
|
)
|
|
|
.forRoutes('/graphiql')
|
|
|
- .apply([
|
|
|
- (req, res, next) => {
|
|
|
- res.header('Access-Control-Allow-Origin', '*');
|
|
|
- res.header(
|
|
|
- 'Access-Control-Allow-Headers',
|
|
|
- 'Content-Type, Authorization, Content-Length, X-Requested-With',
|
|
|
- );
|
|
|
- if (req.method === 'OPTIONS') {
|
|
|
- res.sendStatus(200);
|
|
|
- } else {
|
|
|
- next();
|
|
|
- }
|
|
|
- },
|
|
|
- graphqlExpress(req => ({ schema, rootValue: req })),
|
|
|
- ])
|
|
|
+ .apply(graphqlExpress(req => ({ schema, rootValue: req })))
|
|
|
.forRoutes('/graphql');
|
|
|
}
|
|
|
|