Skip to content

Commit 73b7b73

Browse files
committed
Merge branch 'develop'
2 parents 5e2aa50 + 450a0f2 commit 73b7b73

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)