Skip to content

[FEATURE] NestJS Graphql RequireFlagsEnabled Decorator Support #1369

@benkenawell

Description

@benkenawell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions