You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found a workaround to avoid this bug: consumer.apply(middleware).forRoutes worked properly when I specified exclude option in app.setGlobalPrefix and add "graphql".
// main.tsasyncfunctionbootstrap(){constapp=awaitNestFactory.create(AppModule);app.setGlobalPrefix('prefix',{// works properly with the following optionexclude: ['graphql']});awaitapp.listen(3000);}
(I have also noticed it in my minimal repro as a comment.)
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current behavior
Using
app.setGlobalPrefix
andGraphQLModule.forRoot
, I cannot specify/graphql
endpoint in the argument ofconsumer.apply(middleware).forRoutes
.Minimum reproduction code
https://codesandbox.io/p/devbox/nestjs-graphql-middleware-issue-8d6qfr
Steps to reproduce
npm start:dev
/graphql
endpointExpected behavior
The middleware should be called when I access
/graphql
endpoint.In my minimum example,
apply
should be shown in terminal outputs.Package version
12.1.1
Graphql version
graphql
: 16.8.1@apollo/server
: 4.10.1@nestjs/apollo
: 12.1.0NestJS version
10.3.3
Node.js version
20.11.0
In which operating systems have you tested?
Other
I have found a workaround to avoid this bug:
consumer.apply(middleware).forRoutes
worked properly when I specifiedexclude
option inapp.setGlobalPrefix
and add "graphql".(I have also noticed it in my minimal repro as a comment.)
The text was updated successfully, but these errors were encountered: