Requirements
The nestjs-sdk RequireFlagsEnabled decorator does not support graphql contexts. The context.switchToHttp().getRequest() won't get you the http request with NestJS + Fastify + Graphql. You should check the host.getType() for http or graphql and switch accordingly.
Or, since the context is really only used for creating the default error, you could remove it entirely and make a more generic error. Something like cannot access this endpoint would be less informative, but not rely on the correct request object.
Requirements
The nestjs-sdk RequireFlagsEnabled decorator does not support graphql contexts. The
context.switchToHttp().getRequest()won't get you the http request with NestJS + Fastify + Graphql. You should check thehost.getType()forhttporgraphqland switch accordingly.Or, since the context is really only used for creating the default error, you could remove it entirely and make a more generic error. Something like
cannot access this endpointwould be less informative, but not rely on the correct request object.