Skip to content

Commit 450a0f2

Browse files
committed
Revert not attaching our GQL context middleware for all routes
This affected logic checking for non "non gql request" because the exception changed. It's fine to continue attaching this middleware for all requests, as it handles non graphql requests fine.
1 parent 1713766 commit 450a0f2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/core/graphql/graphql.module.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ export class GraphqlModule implements NestModule {
3535
constructor(private readonly middleware: GqlContextHostImpl) {}
3636

3737
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.
3843
const uploadMiddleware = createUploadMiddleware();
39-
consumer
40-
.apply(this.middleware.use, uploadMiddleware)
41-
.forRoutes('/graphql', '/graphql/*');
44+
consumer.apply(uploadMiddleware).forRoutes('/graphql', '/graphql/*');
4245
}
4346
}

0 commit comments

Comments
 (0)