We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e2aa50 + 450a0f2 commit 73b7b73Copy full SHA for 73b7b73
src/core/graphql/graphql.module.ts
@@ -35,9 +35,12 @@ export class GraphqlModule implements NestModule {
35
constructor(private readonly middleware: GqlContextHostImpl) {}
36
37
configure(consumer: MiddlewareConsumer) {
38
+ // Always attach our GQL Context middleware.
39
+ // It has its own logic to handle non-gql requests.
40
+ consumer.apply(this.middleware.use).forRoutes('*');
41
+
42
+ // Attach the graphql-upload middleware to the graphql endpoint.
43
const uploadMiddleware = createUploadMiddleware();
- consumer
- .apply(this.middleware.use, uploadMiddleware)
- .forRoutes('/graphql', '/graphql/*');
44
+ consumer.apply(uploadMiddleware).forRoutes('/graphql', '/graphql/*');
45
}
46
0 commit comments